]> git.mxchange.org Git - friendica.git/commitdiff
hash tags cannot contains spaces
authorFriendika <info@friendika.com>
Tue, 5 Jul 2011 23:23:27 +0000 (16:23 -0700)
committerFriendika <info@friendika.com>
Tue, 5 Jul 2011 23:23:27 +0000 (16:23 -0700)
boot.php

index 97aee73cd31bae453c09646ca64219ee9d9554d0..c95e24dc1c889e7c0d00e8ca7c571e0d99213984 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -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,"]")) {