aboutsummaryrefslogtreecommitdiffstats
path: root/mod/item.php
diff options
context:
space:
mode:
authorAlexander Kampmann <programmer@nurfuerspam.de>2012-03-14 12:30:52 +0100
committerAlexander Kampmann <programmer@nurfuerspam.de>2012-03-14 12:30:52 +0100
commit509532d168bf716eb24e030ab59476a88ab91571 (patch)
treec9d2f482633773d14d4480d6f3f35e3c3f749252 /mod/item.php
parentbce3bfff38ad6f540dca39f6ed5b1d8cae19edb1 (diff)
downloadvolse-hubzilla-509532d168bf716eb24e030ab59476a88ab91571.tar.gz
volse-hubzilla-509532d168bf716eb24e030ab59476a88ab91571.tar.bz2
volse-hubzilla-509532d168bf716eb24e030ab59476a88ab91571.zip
get_tags tests corrected. They test for the right things now.
Diffstat (limited to 'mod/item.php')
-rwxr-xr-xmod/item.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/mod/item.php b/mod/item.php
index 0ff7f6a7c..e4336b974 100755
--- a/mod/item.php
+++ b/mod/item.php
@@ -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) {
//if the tag is replaced...
@@ -851,7 +851,7 @@ function handle_body(&$body, &$inform, &$str_tags, $profile_uid, $tag) {
$str_tags .= ',';
$str_tags .= $newtag;
}
- continue;
+ return;
}
//is it a person tag?
if(strpos($tag,'@') === 0) {
@@ -887,14 +887,15 @@ function handle_body(&$body, &$inform, &$str_tags, $profile_uid, $tag) {
//get the id
$tagcid = intval(substr($newname,strrpos($newname,'+') + 1));
//remove the next word from tag's name
- if(strpos($name,' '))
- $name = substr($name,0,strpos($name,' '));
+ if(strpos($name,' ')) {
+ $name = substr($name,0,strpos($name,' '));
+ }
}
if($tagcid) { //if there was an id
//select contact with that id from the logged in user's contact list
$r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
intval($tagcid),
- intval($profile_uid)
+ intval($profile_uid)
);
} elseif(strstr($name,'_') || strstr($name,' ')) { //no id
//get the real name