require_once('include/map.php');
require_once('mod/proxy.php');
require_once('include/Contact.php');
+require_once('include/plaintext.php');
function bb_PictureCacheExt($matches) {
if (strpos($matches[3], "data:image/") === 0)
if (!$data)
return $Text;
+ if (isset($data["title"])) {
+ $data["title"] = strip_tags($data["title"]);
+ $data["title"] = str_replace(array("http://", "https://"), "", $data["title"]);
+ }
+
if (((strpos($data["text"], "[img=") !== false) OR (strpos($data["text"], "[img]") !== false)) AND ($data["image"] != "")) {
$data["preview"] = $data["image"];
$data["image"] = "";
elseif (($data["preview"] != "") AND !strstr(strtolower($oembed), "<img "))
$text .= sprintf('<a href="%s" target="_blank"><img src="%s" alt="" title="%s" class="attachment-preview" /></a><br />', $data["url"], proxy_url($data["preview"]), $data["title"]);
- $text .= $oembed;
+ if (($data["type"] == "photo") AND ($data["url"] != "") AND ($data["image"] != ""))
+ $text .= sprintf('<a href="%s" target="_blank"><img src="%s" alt="" title="%s" class="attachment-image" /></a>', $data["url"], proxy_url($data["image"]), $data["title"]);
+ else
+ $text .= $oembed;
- $text .= sprintf('<blockquote>%s</blockquote></span>', trim($data["description"]));
+ if (trim($data["description"]) != "")
+ $text .= sprintf('<blockquote>%s</blockquote></span>', trim($data["description"]));
}
}
return $data["text"].$text.$data["after"];
return $Text;
if ($nolink)
- return $data["text"];
+ return $data["text"].$data["after"];
if ($plaintext)
$data["title"] = $data["url"];
if (($data["text"] == "") AND ($data["title"] != "") AND ($data["url"] == ""))
- return $data["title"];
+ return $data["title"].$data["after"];
// If the link already is included in the post, don't add it again
if (($data["url"] != "") AND strpos($data["text"], $data["url"]))
- return $data["text"];
+ return $data["text"].$data["after"];
$text = $data["text"];
elseif (($link != ""))
$text .= "\n".$data["url"];
- return $text;
+ return $text.$data["after"];
}
function bb_cleanstyle($st) {