diff options
author | Michael <icarus@dabo.de> | 2012-02-19 20:09:42 +0100 |
---|---|---|
committer | Michael <icarus@dabo.de> | 2012-02-19 20:09:42 +0100 |
commit | cafd4003522a472d2709569ea5eb5f80b817af23 (patch) | |
tree | bbd512126515afc929de06dce79ba847b9681092 /include/diaspora.php | |
parent | 73e0e4d78341cb96ef9665a0ee4fb7e7ee2a701f (diff) | |
parent | a9ed5915cebcf51347acaad51d0c252e57bceaff (diff) | |
download | volse-hubzilla-cafd4003522a472d2709569ea5eb5f80b817af23.tar.gz volse-hubzilla-cafd4003522a472d2709569ea5eb5f80b817af23.tar.bz2 volse-hubzilla-cafd4003522a472d2709569ea5eb5f80b817af23.zip |
Merge remote branch 'upstream/master'
Conflicts:
view/theme/vier/style.css
Diffstat (limited to 'include/diaspora.php')
-rwxr-xr-x | include/diaspora.php | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/include/diaspora.php b/include/diaspora.php index cded389c3..a8e02e509 100755 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -598,7 +598,7 @@ function diaspora_request($importer,$xml) { `uri-date` = '%s', `avatar-date` = '%s', `blocked` = 0, - `pending` = 0, + `pending` = 0 WHERE `id` = %d LIMIT 1 ", dbesc($photos[0]), @@ -611,7 +611,7 @@ function diaspora_request($importer,$xml) { intval($contact_record['id']) ); - $u = q("select * from user where id = %d limit 1",intval($importer['uid'])); + $u = q("select * from user where uid = %d limit 1",intval($importer['uid'])); if($u) $ret = diaspora_share($u[0],$contact_record); } @@ -673,6 +673,14 @@ function diaspora_post($importer,$xml) { if(strpos($tag,'#') === 0) { if(strpos($tag,'[url=')) continue; + + // don't link tags that are already embedded in links + + if(preg_match('/\[(.*?)' . preg_quote($tag) . '(.*?)\]/',$body)) + continue; + if(preg_match('/\[(.*?)\]\((.*?)' . preg_quote($tag) . '(.*?)\)/',$body)) + continue; + $basetag = str_replace('_',' ',substr($tag,1)); $body = str_replace($tag,'#[url=' . $a->get_baseurl() . '/search?search=' . rawurlencode($basetag) . ']' . $basetag . '[/url]',$body); if(strlen($str_tags)) @@ -830,6 +838,15 @@ function diaspora_reshare($importer,$xml) { if(strpos($tag,'#') === 0) { if(strpos($tag,'[url=')) continue; + + // don't link tags that are already embedded in links + + if(preg_match('/\[(.*?)' . preg_quote($tag) . '(.*?)\]/',$body)) + continue; + if(preg_match('/\[(.*?)\]\((.*?)' . preg_quote($tag) . '(.*?)\)/',$body)) + continue; + + $basetag = str_replace('_',' ',substr($tag,1)); $body = str_replace($tag,'#[url=' . $a->get_baseurl() . '/search?search=' . rawurlencode($basetag) . ']' . $basetag . '[/url]',$body); if(strlen($str_tags)) @@ -1062,6 +1079,15 @@ function diaspora_comment($importer,$xml,$msg) { if(strpos($tag,'#') === 0) { if(strpos($tag,'[url=')) continue; + + // don't link tags that are already embedded in links + + if(preg_match('/\[(.*?)' . preg_quote($tag) . '(.*?)\]/',$body)) + continue; + if(preg_match('/\[(.*?)\]\((.*?)' . preg_quote($tag) . '(.*?)\)/',$body)) + continue; + + $basetag = str_replace('_',' ',substr($tag,1)); $body = str_replace($tag,'#[url=' . $a->get_baseurl() . '/search?search=' . rawurlencode($basetag) . ']' . $basetag . '[/url]',$body); if(strlen($str_tags)) @@ -1282,6 +1308,7 @@ function diaspora_conversation($importer,$xml,$msg) { 'language' => $importer['language'], 'to_name' => $importer['username'], 'to_email' => $importer['email'], + 'uid' =>$importer['importer_uid'], 'item' => array('subject' => $subject, 'body' => $body), 'source_name' => $person['name'], 'source_link' => $person['url'], |