aboutsummaryrefslogtreecommitdiffstats
path: root/mod/item.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-06-29 18:59:05 -0700
committerFriendika <info@friendika.com>2011-06-29 18:59:05 -0700
commitad5b976978011e2bf16fea5537af5b211e8e65eb (patch)
tree312714e2a62a8932efe24747e60d0c3f234f1810 /mod/item.php
parentf73bc7f010e98b078542869cf130dc2c6d7abb25 (diff)
downloadvolse-hubzilla-ad5b976978011e2bf16fea5537af5b211e8e65eb.tar.gz
volse-hubzilla-ad5b976978011e2bf16fea5537af5b211e8e65eb.tar.bz2
volse-hubzilla-ad5b976978011e2bf16fea5537af5b211e8e65eb.zip
allow spaces in @ tags
Diffstat (limited to 'mod/item.php')
-rw-r--r--mod/item.php20
1 files changed, 14 insertions, 6 deletions
diff --git a/mod/item.php b/mod/item.php
index f87b6074a..8a4f8293c 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -244,6 +244,10 @@ function item_post(&$a) {
}
+ /**
+ * Next link in any attachment references we find in the post.
+ */
+
$match = false;
if(preg_match_all("/\[attachment\](.*?)\[\/attachment\]/",$body,$match)) {
@@ -265,10 +269,6 @@ function item_post(&$a) {
}
}
-
-
-
-
/**
* Fold multi-line [code] sequences
*/
@@ -285,13 +285,21 @@ function item_post(&$a) {
$tags = get_tags($body);
- if(($parent_contact) && ($parent_contact['network'] === 'stat') && ($parent_contact['nick']) && (! in_array('@' . $parent_contact['nick'],$tags))) {
+ /**
+ * add a statusnet style reply tag if the original post was from there
+ * and we are replying, and there isn't one already
+ */
+
+ if(($parent_contact) && ($parent_contact['network'] === 'stat')
+ && ($parent_contact['nick']) && (! in_array('@' . $parent_contact['nick'],$tags))) {
$body = '@' . $parent_contact['nick'] . ' ' . $body;
$tags[] = '@' . $parent_contact['nick'];
}
if(count($tags)) {
foreach($tags as $tag) {
+ if(isset($profile))
+ unset($profile);
if(strpos($tag,'#') === 0) {
if(strpos($tag,'[url='))
continue;
@@ -325,7 +333,7 @@ function item_post(&$a) {
else {
$newname = $name;
$alias = '';
- if(strstr($name,'_')) {
+ if(strstr($name,'_') || strstr($name,' ')) {
$newname = str_replace('_',' ',$name);
$r = q("SELECT * FROM `contact` WHERE `name` = '%s' AND `uid` = %d LIMIT 1",
dbesc($newname),