]> git.mxchange.org Git - friendica.git/commitdiff
Fix test
authorMichael <heluecht@pirati.ca>
Sat, 3 Jul 2021 15:47:11 +0000 (15:47 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 3 Jul 2021 15:47:11 +0000 (15:47 +0000)
src/Model/Post/Media.php

index 65cd099f7d3b5e9a13eb85854dbdf8af2f9d81c4..90f42a45934fb9fecb458251159a4aae02f6ea81 100644 (file)
@@ -229,7 +229,7 @@ class Media
         */
        private static function fetchLocalData(array $media)
        {
-               if (!preg_match('|.*?/photo/(.*[a-fA-F0-9])\-(.*[0-9])\..*[\w]|', $media['url'], $matches)) {
+               if (!preg_match('|.*?/photo/(.*[a-fA-F0-9])\-(.*[0-9])\..*[\w]|', $media['url'] ?? '', $matches)) {
                        return $media;
                }
                $photo = Photo::selectFirst([], ['resource-id' => $matches[1], 'scale' => $matches[2]]);
@@ -240,7 +240,7 @@ class Media
                        $media['height'] = $photo['height'];
                }
 
-               if (!preg_match('|.*?/photo/(.*[a-fA-F0-9])\-(.*[0-9])\..*[\w]|', $media['preview'], $matches)) {
+               if (!preg_match('|.*?/photo/(.*[a-fA-F0-9])\-(.*[0-9])\..*[\w]|', $media['preview'] ?? '', $matches)) {
                        return $media;
                }
                $photo = Photo::selectFirst([], ['resource-id' => $matches[1], 'scale' => $matches[2]]);