Partial fix Label font display problem(標簽字型顯示的問題)

yoching

Member
當會員從別處轉貼過來的文章
When a member from the articles posted elsewhere

常會發生如第二篇文章的情況
Often occurs as the second article

當然這只有在轉貼有中文的網頁並有設定中文字型時才會發生。
Of course this is only posted a Chinese Web page and only occurs when there is a Chinese font set.

我是有找到相關的問題在 \library\XenForo\BbCode\Formatter\Base.php 這個檔案上。
Related issues in the \library\XenForo\BbCode\Formatter\Base.php I have found on this file.

我將該FONT的正則從原來的
I will be the FONT is from the original
'optionRegex' => '/^[a-z0-9 \-]+$/i',

修改為
'optionRegex' => '/[\x{4E00}-\x{9FBF}]|[a-zA-Z0-9\s]/u',

當然這樣的確就可以使用了。但我也不確定這是否會帶來什麼樣的錯誤
This does, of course you can use. But I'm not sure if this is what error

在此提供參考,也希望是否能依你們的專業角度來看該正則是否還會存在什麼樣的問題
This reference also can according to your professional point of view that are there are also what kind of problems
 
I have made a change for this issue, and I'll likely make a further change in a future version when I can do proper testing on it (on a wide range of servers).

Right now, the HTML -> BB code processor will now ignore font tags that won't be processed by the BB code parser. I'm hesitant to negate the regex (blacklist rather than whitelist) due to potential security issues.
 
Top Bottom