diff options
author | Friendika <info@friendika.com> | 2011-07-05 16:23:27 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-07-05 16:23:27 -0700 |
commit | 308d98f7ac7d72bbaaeb02d7acc228d856c9d660 (patch) | |
tree | 94aa69f71ab9be9947b9deac9465cd975179f74d | |
parent | 24d41e2c6e759baf17a10aa2e48d4b1907d5c7a0 (diff) | |
download | volse-hubzilla-308d98f7ac7d72bbaaeb02d7acc228d856c9d660.tar.gz volse-hubzilla-308d98f7ac7d72bbaaeb02d7acc228d856c9d660.tar.bz2 volse-hubzilla-308d98f7ac7d72bbaaeb02d7acc228d856c9d660.zip |
hash tags cannot contains spaces
-rw-r--r-- | boot.php | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -4,7 +4,7 @@ set_time_limit(0); ini_set('pcre.backtrack_limit', 250000); -define ( 'FRIENDIKA_VERSION', '2.2.1031' ); +define ( 'FRIENDIKA_VERSION', '2.2.1032' ); define ( 'DFRN_PROTOCOL_VERSION', '2.21' ); define ( 'DB_UPDATE_VERSION', 1073 ); @@ -2031,7 +2031,10 @@ function get_tags($s) { $s = preg_replace('/\[code\](.*?)\[\/code\]/sm','',$s); - if(preg_match_all('/([@#][^ \x0D\x0A,:?]+ [^ \x0D\x0A,:?]+)([ \x0D\x0A,:?]|$)/',$s,$match)) { + // 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,"]")) { // we might be inside a bbcode color tag - leave it alone @@ -2044,6 +2047,9 @@ function get_tags($s) { } } + // Otherwise pull out single word tags. These can be @nickname, @first_last + // and #hash tags. + if(preg_match_all('/([@#][^ \x0D\x0A,:?]+)([ \x0D\x0A,:?]|$)/',$s,$match)) { foreach($match[1] as $mtch) { if(strstr($mtch,"]")) { |