/// @TODO make a positive list of allowed characters
$hashtag = str_replace([" ", "+", "/", ".", "#", "'", "’", "`", "(", ")", "„", "“"],
["", "", "", "", "", "", "", "", "", "", "", ""], $keyword);
- $hashtags .= "#[url=" . System::baseUrl() . "/search?tag=" . rawurlencode($hashtag) . "]" . $hashtag . "[/url] ";
+ $hashtags .= "#[url=" . System::baseUrl() . "/search?tag=" . $hashtag . "]" . $hashtag . "[/url] ";
}
}
$tags .= ", ";
}
- $tags .= "#[url=" . System::baseUrl() . "/search?tag=" . rawurlencode($hashtag) . "]" . $hashtag . "[/url]";
+ $tags .= "#[url=" . System::baseUrl() . "/search?tag=" . $hashtag . "]" . $hashtag . "[/url]";
}
}
}
$profile = str_replace(',', '%2c', $profile);
- $str_tags .= '@[url='.$profile.']'.$newname.'[/url]';
+ $str_tags .= '@[url=' . $profile . ']' . $newname . '[/url]';
}
} elseif (strpos($tag, '#') === 0) {
$tagname = substr($tag, 1);
</target>
EOT;
- $tagid = System::baseUrl() . '/search?tag=' . $term;
+ $tagid = System::baseUrl() . '/search?tag=' . $xterm;
$objtype = ACTIVITY_OBJ_TAGTERM;
$obj = <<< EOT
return;
}
- $termlink = html_entity_decode('⌗') . '[url=' . System::baseUrl() . '/search?tag=' . urlencode($term) . ']'. $term . '[/url]';
+ $termlink = html_entity_decode('⌗') . '[url=' . System::baseUrl() . '/search?tag=' . $term . ']'. $term . '[/url]';
$arr = [];
$basetag = str_replace('_',' ',substr($tag,1));
- $newtag = '#[url=' . System::baseUrl() . '/search?tag=' . rawurlencode($basetag) . ']' . $basetag . '[/url]';
+ $newtag = '#[url=' . System::baseUrl() . '/search?tag=' . $basetag . ']' . $basetag . '[/url]';
$item["body"] = str_replace($tag, $newtag, $item["body"]);
if (!stristr($item["tag"], "/search?tag=" . $basetag . "]" . $basetag . "[/url]")) {
if (strlen($item["tag"])) {
- $item["tag"] = ','.$item["tag"];
+ $item["tag"] = ',' . $item["tag"];
}
- $item["tag"] = $newtag.$item["tag"];
+ $item["tag"] = $newtag . $item["tag"];
}
}
$tag["url"] = $searchpath . $tag["term"];
}
- $orig_tag = $tag["url"];
+ $orig_tag = $tag['url'];
$author = ['uid' => 0, 'id' => $item['author-id'],
'network' => $item['author-network'], 'url' => $item['author-link']];
- $tag["url"] = Contact::magicLinkByContact($author, $tag['url']);
+ $tag['url'] = Contact::magicLinkByContact($author, $tag['url']);
- if ($tag["type"] == TERM_HASHTAG) {
- if ($orig_tag != $tag["url"]) {
- $item['body'] = str_replace($orig_tag, $tag["url"], $item['body']);
+ if ($tag['type'] == TERM_HASHTAG) {
+ if ($orig_tag != $tag['url']) {
+ $item['body'] = str_replace($orig_tag, $tag['url'], $item['body']);
}
- $return['hashtags'][] = "#<a href=\"" . $tag["url"] . "\" target=\"_blank\">" . $tag["term"] . "</a>";
- $prefix = "#";
- } elseif ($tag["type"] == TERM_MENTION) {
- $return['mentions'][] = "@<a href=\"" . $tag["url"] . "\" target=\"_blank\">" . $tag["term"] . "</a>";
- $prefix = "@";
+ $return['hashtags'][] = '#<a href="' . $tag['url'] . '" target="_blank">' . $tag['term'] . '</a>';
+ $prefix = '#';
+ } elseif ($tag['type'] == TERM_MENTION) {
+ $return['mentions'][] = '@<a href="' . $tag['url'] . '" target="_blank">' . $tag['term'] . '</a>';
+ $prefix = '@';
}
- $return['tags'][] = $prefix . "<a href=\"" . $tag["url"] . "\" target=\"_blank\">" . $tag["term"] . "</a>";
+ $return['tags'][] = $prefix . '<a href="' . $tag['url'] . '" target="_blank">' . $tag['term'] . '</a>';
}
DBA::close($taglist);
$tags .= ', ';
}
- $taglink = "#[url=" . System::baseUrl() . "/search?tag=" . rawurlencode($hashtag) . "]" . $hashtag . "[/url]";
+ $taglink = "#[url=" . System::baseUrl() . "/search?tag=" . $hashtag . "]" . $hashtag . "[/url]";
$tags .= $taglink;
}
if ($categories) {
foreach ($categories as $category) {
foreach ($category->attributes as $attributes) {
- if ($attributes->name == "term") {
+ if ($attributes->name == 'term') {
$term = $attributes->textContent;
- if (!empty($item["tag"])) {
- $item["tag"] .= ',';
+ if (!empty($item['tag'])) {
+ $item['tag'] .= ',';
} else {
- $item["tag"] = '';
+ $item['tag'] = '';
}
- $item["tag"] .= "#[url=".System::baseUrl()."/search?tag=".$term."]".$term."[/url]";
+ $item['tag'] .= '#[url=' . System::baseUrl() . '/search?tag=' . $term . ']' . $term . '[/url]';
}
}
}