]> git.mxchange.org Git - friendica.git/blobdiff - mod/item.php
get_tags tests corrected. They test for the right things now.
[friendica.git] / mod / item.php
index 0ff7f6a7c8f43e176d4eb93ec8a71cc8e761a1cd..e4336b974cbb3f6b7b85f1e8f9ec434f8f4952b2 100755 (executable)
@@ -425,7 +425,7 @@ function item_post(&$a) {
 
        if(count($tags)) {
                foreach($tags as $tag) {
-                       handle_tag($body, $inform, $str_tags, $profile_uid, $tag); 
+                       handle_tag($a, $body, $inform, $str_tags, $profile_uid, $tag); 
                }
        }
 
@@ -830,7 +830,7 @@ function item_content(&$a) {
  * @param unknown_type $profile_uid
  * @param unknown_type $tag the tag to replace
  */
-function handle_body(&$body, &$inform, &$str_tags, $profile_uid, $tag) {
+function handle_tag($a, &$body, &$inform, &$str_tags, $profile_uid, $tag) {
        //is it a hash tag? 
        if(strpos($tag,'#') === 0) {\r
                //if the tag is replaced...
@@ -851,7 +851,7 @@ function handle_body(&$body, &$inform, &$str_tags, $profile_uid, $tag) {
                                $str_tags .= ',';\r
                        $str_tags .= $newtag;\r
                }\r
-               continue;\r
+               return;\r
        }
        //is it a person tag? \r
        if(strpos($tag,'@') === 0) {\r
@@ -887,14 +887,15 @@ function handle_body(&$body, &$inform, &$str_tags, $profile_uid, $tag) {
                                //get the id
                                $tagcid = intval(substr($newname,strrpos($newname,'+') + 1));\r
                                //remove the next word from tag's name
-                               if(strpos($name,' '))\r
-                                       $name = substr($name,0,strpos($name,' '));\r
+                               if(strpos($name,' ')) {\r
+                                       $name = substr($name,0,strpos($name,' '));
+                               }\r
                        }
                        if($tagcid) { //if there was an id
                                //select contact with that id from the logged in user's contact list\r
                                $r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",\r
                                                intval($tagcid),\r
-                                               intval($profile_uid)\r
+                                               intval($profile_uid)
                                );\r
                        } elseif(strstr($name,'_') || strstr($name,' ')) { //no id
                                //get the real name\r