X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fplaintext.php;h=539ef020df8571a7e49a8ec0b48b19a311bf061c;hb=07ce216064603395a86304835c2dd71e66bc8a58;hp=e18604334b2041f3c0b5fe6f62f28978ae66fd2f;hpb=8bcf52d1805f63ab28bc1ad099265abd2e76069c;p=friendica.git diff --git a/include/plaintext.php b/include/plaintext.php index e18604334b..539ef020df 100644 --- a/include/plaintext.php +++ b/include/plaintext.php @@ -82,7 +82,7 @@ function get_attachment_data($body) { $data = array(); - if (!preg_match("/(.*)\[attachment(.*)\](.*?)\[\/attachment\](.*)/ism", $body, $match)) + if (!preg_match("/(.*)\[attachment(.*?)\](.*?)\[\/attachment\](.*)/ism", $body, $match)) return get_old_attachment_data($body); $attributes = $match[2]; @@ -189,6 +189,13 @@ function get_attached_data($body) { if (count($pictures) == 1) { // Checking, if the link goes to a picture $data = parseurl_getsiteinfo_cached($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); + if ($data["type"] == "photo") { $post["type"] = "photo"; if (isset($data["images"][0])) {