diff options
Diffstat (limited to 'include/text.php')
-rw-r--r-- | include/text.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/text.php b/include/text.php index d4cfecd75..c82fad517 100644 --- a/include/text.php +++ b/include/text.php @@ -2028,14 +2028,14 @@ function undo_post_tagging($s) { $cnt = preg_match_all('/([@#])(\!*)\[zrl=(.*?)\](.*?)\[\/zrl\]/ism',$s,$matches,PREG_SET_ORDER); if($cnt) { foreach($matches as $mtch) { - $s = str_replace($mtch[0], $mtch[1] . $mtch[2] . str_replace(' ','_',$mtch[4]),$s); + $s = str_replace($mtch[0], $mtch[1] . $mtch[2] . quote_tag($mtch[4]),$s); } } // undo forum tags $cnt = preg_match_all('/\!\[zrl=(.*?)\](.*?)\[\/zrl\]/ism',$s,$matches,PREG_SET_ORDER); if($cnt) { foreach($matches as $mtch) { - $s = str_replace($mtch[0], '!' . str_replace(' ','_',$mtch[2]),$s); + $s = str_replace($mtch[0], '!' . quote_tag($mtch[2]),$s); } } @@ -2043,6 +2043,13 @@ function undo_post_tagging($s) { return $s; } +function quote_tag($s) { + if(strpos($s,' ') !== false) + return '"' . $s . '"'; + return $s; +} + + function fix_mce_lf($s) { $s = str_replace("\r\n","\n",$s); // $s = str_replace("\n\n","\n",$s); |