+ if (($post["url"] == "") AND (in_array($post["type"], array("link", "video")))
+ AND preg_match("/\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", $attacheddata, $matches)) {
+ $post["url"] = $matches[1];
+ }
// Search for description
if (preg_match("/\[quote\](.*?)\[\/quote\]/ism", $attacheddata, $matches))
// Search for description
if (preg_match("/\[quote\](.*?)\[\/quote\]/ism", $attacheddata, $matches))
- $title = bbcode(html_entity_decode($title, ENT_QUOTES, 'UTF-8'), false, false, true);
- $title = html_entity_decode($title, ENT_QUOTES, 'UTF-8');
- $title = str_replace(array("[", "]"), array("[", "]"), $title);
- if ($title != "")
+ if ($title != "") {
+ $title = bbcode(html_entity_decode($title, ENT_QUOTES, 'UTF-8'), false, false, true);
+ $title = html_entity_decode($title, ENT_QUOTES, 'UTF-8');
+ $title = str_replace(array("[", "]"), array("[", "]"), $title);
// if nothing is found, it maybe having an image.
if (!isset($post["type"])) {
// if nothing is found, it maybe having an image.
if (!isset($post["type"])) {
$URLSearchString = "^\[\]";
if (preg_match_all("(\[url=([$URLSearchString]*)\]\s*\[img\]([$URLSearchString]*)\[\/img\]\s*\[\/url\])ism", $body, $pictures, PREG_SET_ORDER)) {
if (count($pictures) == 1) {
// Checking, if the link goes to a picture
$URLSearchString = "^\[\]";
if (preg_match_all("(\[url=([$URLSearchString]*)\]\s*\[img\]([$URLSearchString]*)\[\/img\]\s*\[\/url\])ism", $body, $pictures, PREG_SET_ORDER)) {
if (count($pictures) == 1) {
// Checking, if the link goes to a picture
- $data = parseurl_getsiteinfo_cached($pictures[0][1], true);
+ $data = ParseUrl::getSiteinfoCached($pictures[0][1], true);
+
+ // Workaround:
+ // Sometimes photo posts to the own album are not detected at the start.
+ // So we seem to cannot use the cache for these cases. That's strange.
+ if (($data["type"] != "photo") AND strstr($pictures[0][1], "/photos/"))
+ $data = ParseUrl::getSiteinfo($pictures[0][1], true);
+
* @return string The converted message
*/
function plaintext($a, $b, $limit = 0, $includedlinks = false, $htmlmode = 2, $target_network = "") {
* @return string The converted message
*/
function plaintext($a, $b, $limit = 0, $includedlinks = false, $htmlmode = 2, $target_network = "") {