]> git.mxchange.org Git - friendica.git/blobdiff - include/plaintext.php
Fix wrong french translation string.php
[friendica.git] / include / plaintext.php
index e18604334b2041f3c0b5fe6f62f28978ae66fd2f..539ef020df8571a7e49a8ec0b48b19a311bf061c 100644 (file)
@@ -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])) {