aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-02-26 20:30:36 -0800
committerzotlabs <mike@macgirvin.com>2018-02-26 20:30:36 -0800
commit5277e79fa2dcac5ddd5e4577fb1719fe57ee3829 (patch)
tree97ff8efb30dcec35db563447cf7dab77e124ed91
parentafe2ba36904de4d308fb0620ebef52d7eefecda0 (diff)
downloadvolse-hubzilla-5277e79fa2dcac5ddd5e4577fb1719fe57ee3829.tar.gz
volse-hubzilla-5277e79fa2dcac5ddd5e4577fb1719fe57ee3829.tar.bz2
volse-hubzilla-5277e79fa2dcac5ddd5e4577fb1719fe57ee3829.zip
change undo_post_tagging() to emit quoted tags rather than using underscore replacement if they contain spaces.
-rw-r--r--include/text.php11
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 '&quot;' . $s . '&quot;';
+ return $s;
+}
+
+
function fix_mce_lf($s) {
$s = str_replace("\r\n","\n",$s);
// $s = str_replace("\n\n","\n",$s);