aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-02-26 15:46:29 -0800
committerzotlabs <mike@macgirvin.com>2018-02-26 15:46:29 -0800
commitf83b7c2d52ba122d9695c68fdbfaf0ed12e55ebc (patch)
tree2a2013cafdcb82d77f5c2a0c0af029d31aa97d64 /include/text.php
parentcbcf389f500a7179422ed9a9736f46bbdcc5eca2 (diff)
downloadvolse-hubzilla-f83b7c2d52ba122d9695c68fdbfaf0ed12e55ebc.tar.gz
volse-hubzilla-f83b7c2d52ba122d9695c68fdbfaf0ed12e55ebc.tar.bz2
volse-hubzilla-f83b7c2d52ba122d9695c68fdbfaf0ed12e55ebc.zip
issues with delivery of edited posts to forums
Diffstat (limited to 'include/text.php')
-rw-r--r--include/text.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/text.php b/include/text.php
index 35a367d43..98d6947a4 100644
--- a/include/text.php
+++ b/include/text.php
@@ -2018,15 +2018,27 @@ 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);
}
}
+ // 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);
+ }
+ }
+
+
return $s;
}