diff options
Diffstat (limited to 'include/text.php')
-rwxr-xr-x | include/text.php | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/include/text.php b/include/text.php index 520c9c506..63fb76422 100755 --- a/include/text.php +++ b/include/text.php @@ -574,9 +574,20 @@ function get_tags($s) { $s = preg_replace('/\[style=(.*?)\]/sm','',$s); + // match any double quoted tags + + if(preg_match_all('/([@#]\"\;.*?\"\;)/',$s,$match)) { + foreach($match[1] as $mtch) { + $ret[] = $mtch; + } + } + // Match full names against @tags including the space between first and last // We will look these up afterward to see if they are full names or not recognisable. + + + if(preg_match_all('/(@[^ \x0D\x0A,:?]+ [^ \x0D\x0A@,:?]+)([ \x0D\x0A@,:?]|$)/',$s,$match)) { foreach($match[1] as $mtch) { if(strstr($mtch,"]")) { @@ -607,6 +618,10 @@ function get_tags($s) { // try not to catch url fragments if(strpos($s,$mtch) && preg_match('/[a-zA-z0-9\/]/',substr($s,strpos($s,$mtch)-1,1))) continue; + // or quote remnants from the quoted strings we already picked out earlier + if(strpos($mtch,'"')) + continue; + $ret[] = $mtch; } } @@ -627,7 +642,7 @@ function get_tags($s) { usort($ret,'tag_sort_length'); - //logger('get_tags: ' . print_r($ret,true)); +// logger('get_tags: ' . print_r($ret,true)); return $ret; } |