Diaspora: Bugfix for the hashtag detection of incoming posts
This commit is contained in:
parent
e0d3594933
commit
fcaf71691f
|
@ -834,6 +834,7 @@ function diaspora_post($importer,$xml,$msg) {
|
||||||
$str_tags = '';
|
$str_tags = '';
|
||||||
|
|
||||||
$tags = get_tags($body);
|
$tags = get_tags($body);
|
||||||
|
rsort($tags);
|
||||||
|
|
||||||
if(count($tags)) {
|
if(count($tags)) {
|
||||||
foreach($tags as $tag) {
|
foreach($tags as $tag) {
|
||||||
|
@ -843,9 +844,9 @@ function diaspora_post($importer,$xml,$msg) {
|
||||||
|
|
||||||
// don't link tags that are already embedded in links
|
// don't link tags that are already embedded in links
|
||||||
|
|
||||||
if(preg_match('/\[(.*?)' . preg_quote($tag,'/') . '(.*?)\]/',$body))
|
if(preg_match('/\[(\S*?)' . preg_quote($tag,'/') . '(\S*?)\]/',$body))
|
||||||
continue;
|
continue;
|
||||||
if(preg_match('/\[(.*?)\]\((.*?)' . preg_quote($tag,'/') . '(.*?)\)/',$body))
|
if(preg_match('/\[(\S*?)\]\((\S*?)' . preg_quote($tag,'/') . '(\S*?)\)/',$body))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
$basetag = str_replace('_',' ',substr($tag,1));
|
$basetag = str_replace('_',' ',substr($tag,1));
|
||||||
|
|
Loading…
Reference in a new issue