$URLSearchString = "^\[\]";
- /// @TODO old-lost code?
- // All hashtags should point to the home server
- //$item["body"] = preg_replace("/#\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
- // "#[url=".App::get_baseurl()."/search?tag=$2]$2[/url]", $item["body"]);
+ // All hashtags should point to the home server if "local_search" is activated
+ if (Config::get('system', 'local_search')) {
+ $item["body"] = preg_replace("/#\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
+ "#[url=".App::get_baseurl()."/search?tag=$2]$2[/url]", $item["body"]);
- //$item["tag"] = preg_replace("/#\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
- // "#[url=".App::get_baseurl()."/search?tag=$2]$2[/url]", $item["tag"]);
+ $item["tag"] = preg_replace("/#\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
+ "#[url=".App::get_baseurl()."/search?tag=$2]$2[/url]", $item["tag"]);
+ }
// mask hashtags inside of url, bookmarks and attachments to avoid urls in urls
$item["body"] = preg_replace_callback("/\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
$profile_base_friendica = $profile_data['host'].$profile_data['path']."/profile/";
$profile_base_diaspora = $profile_data['host'].$profile_data['path']."/u/";
- $searchpath = App::get_baseurl()."/search?tag=";
-
$messages = q("SELECT `guid`, `uid`, `id`, `edited`, `deleted`, `created`, `received`, `title`, `body`, `tag`, `parent` FROM `item` WHERE `id` = %d LIMIT 1", intval($itemid));
if (!$messages)
$pattern = "/\W\#([^\[].*?)[\s'\".,:;\?!\[\]\/]/ism";
if (preg_match_all($pattern, $data, $matches))
foreach ($matches[1] as $match)
- $tags["#".strtolower($match)] = ""; // $searchpath.strtolower($match);
+ $tags["#".strtolower($match)] = "";
$pattern = "/\W([\#@])\[url\=(.*?)\](.*?)\[\/url\]/ism";
if (preg_match_all($pattern, $data, $matches, PREG_SET_ORDER)) {