diff options
Diffstat (limited to 'include/text.php')
-rw-r--r-- | include/text.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/text.php b/include/text.php index 92a74eb49..6f66cef65 100644 --- a/include/text.php +++ b/include/text.php @@ -1338,3 +1338,16 @@ function file_tag_unsave_file($uid,$item,$file) { function normalise_openid($s) { return trim(str_replace(array('http://','https://'),array('',''),$s),'/'); } + + +function undo_post_tagging($s) { + $matches = null; + $cnt = preg_match_all('/([@#])\[url=(.*?)\](.*?)\[\/url\]/ism',$s,$matches,PREG_SET_ORDER); + if($cnt) { + foreach($matches as $mtch) { + $s = str_replace($mtch[0], $mtch[1] . $mtch[3],$s); + } + } + return $s; +} + |