Hi,
Multibyte Character does not work.
cause: It's title="regular expression" error.
reason: It's first argument 1byte character.
But, Japan,korea,china,etc....many 2byte character.

/* Example */
[acronym title=Hello!]Hello English[/acronym]
[acronym title=こんにちは!]Hello Japanese[/acronym]
[acronym title=안녕하세요!]Hello Korean[/acronym]
[acronym title=你好!]Hello Chinese[/acronym]

I fixd regular expression.

before:
'#\[acronym=([\w\s-,\.]+)(?::\w+)?\](.*?)\[/acronym(?::\w+)?\]#si'
'#\[abbr=([\w\s-,\.]+)(?::\w+)?\](.*?)\[/abbr(?::\w+)?\]#si'

after:
'#\[acronym=(.*?)(?::\w+)?\](.*?)\[/acronym(?::\w+)?\]#si'
'#\[abbr=(.*?)(?::\w+)?\](.*?)\[/abbr(?::\w+)?\]#si'

result: It's work.

Please change an original cord if there is not no problem.
I'm sorry to trouble you but thank you for your help.

Thanks

Comments

naudefj’s picture

Are you sure it's the multi-byte characters and not the exclamation mark (!) that's causing the problem?

PS: The problem with your regular expressions is that they will allow HTML injection.

batumaru’s picture

Title: Acronyms & abbreviations show Multibyte description. » Thank you for a reply.
Status: Active » Closed (fixed)

Asian's 2byte character is not [:alnum:].
And I add a sanitizing cord.

//change
'_bbcode_acronym_tag(\'\\1\' , \'\\2\')',

//add
function _bbcode_acronym_tag($title = NULL, $text = NULL){
  $title= preg_replace('/PATTERN/','',$title);
  return '<acronym title="'.$title.'">'.$text.'</acronym>';
}

I try to think about PATTERN a little more.

Thanks

batumaru’s picture

Title: Thank you for a reply. » Acronyms & abbreviations show Multibyte description.

I'm sorry.
Title post mistake.
Thank you for support.