protect tags from double expansion during RT

This commit is contained in:
Friendika 2011-03-16 19:57:13 -07:00
parent 3f432a7b82
commit 8fd989c568

View file

@ -212,6 +212,8 @@ function item_post(&$a) {
if(count($tags)) { if(count($tags)) {
foreach($tags as $tag) { foreach($tags as $tag) {
if(strpos($tag,'#') === 0) { if(strpos($tag,'#') === 0) {
if(strpos($tag,'[url='))
continue;
$basetag = str_replace('_',' ',substr($tag,1)); $basetag = str_replace('_',' ',substr($tag,1));
$body = str_replace($tag,'#[url=' . $a->get_baseurl() . '/search?search=' . rawurlencode($basetag) . ']' . $basetag . '[/url]',$body); $body = str_replace($tag,'#[url=' . $a->get_baseurl() . '/search?search=' . rawurlencode($basetag) . ']' . $basetag . '[/url]',$body);
if(strlen($str_tags)) if(strlen($str_tags))
@ -220,6 +222,8 @@ function item_post(&$a) {
continue; continue;
} }
if(strpos($tag,'@') === 0) { if(strpos($tag,'@') === 0) {
if(strpos($tag,'[url='))
continue;
$stat = false; $stat = false;
$name = substr($tag,1); $name = substr($tag,1);
if((strpos($name,'@')) || (strpos($name,'http://'))) { if((strpos($name,'@')) || (strpos($name,'http://'))) {