mirror of
https://github.com/friendica/friendica
synced 2024-11-19 07:03:40 +00:00
Fix test
This commit is contained in:
parent
c72abe48a8
commit
f37e808e02
1 changed files with 2 additions and 2 deletions
|
@ -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]]);
|
||||
|
|
Loading…
Reference in a new issue