diff options
author | Andrew Manning <tamanning@zoho.com> | 2018-02-28 20:47:14 -0500 |
---|---|---|
committer | Andrew Manning <tamanning@zoho.com> | 2018-02-28 20:47:14 -0500 |
commit | 39fe80a196ee626dda15b5b844dd1d05893f7646 (patch) | |
tree | 1c66efd9cb61c2f18c0d98d57b1589de6164101e /include/text.php | |
parent | 1035c453ea6468de13db8eb04fbb55d38347ff2a (diff) | |
parent | 029d155a07e4d2a0af82a19d3234cee50b57a085 (diff) | |
download | volse-hubzilla-39fe80a196ee626dda15b5b844dd1d05893f7646.tar.gz volse-hubzilla-39fe80a196ee626dda15b5b844dd1d05893f7646.tar.bz2 volse-hubzilla-39fe80a196ee626dda15b5b844dd1d05893f7646.zip |
Merge branch 'dev' into oauth2
Diffstat (limited to 'include/text.php')
-rw-r--r-- | include/text.php | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/include/text.php b/include/text.php index 6014f7437..c82fad517 100644 --- a/include/text.php +++ b/include/text.php @@ -2019,18 +2019,37 @@ function item_post_type($item) { return $post_type; } +// This needs to be fixed to use quoted tag strings function undo_post_tagging($s) { + $matches = null; + // undo tags and mentions $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], '!' . quote_tag($mtch[2]),$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); |