From da5a75a9ded1affb22a6648f8c8e5fda0adc8e84 Mon Sep 17 00:00:00 2001 From: Franzz Date: Thu, 27 Aug 2026 12:53:58 +0200 Subject: [PATCH] Fix geo constant scope --- lib/Geo.php | 4 ++-- lib/Media.php | 4 +++- resources/lang/en.json | 3 ++- resources/lang/es.json | 3 ++- resources/lang/fr.json | 3 ++- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/Geo.php b/lib/Geo.php index b6d1d66..e696f7d 100644 --- a/lib/Geo.php +++ b/lib/Geo.php @@ -7,8 +7,8 @@ use \Settings; abstract class Geo extends PhpObject { protected const EXT = ''; - private const GEO_FOLDER = 'geo'; - private const OPT_SIMPLE = 'simplification'; + protected const GEO_FOLDER = 'geo'; + protected const OPT_SIMPLE = 'simplification'; protected array $asTracks; protected string $sFilePath; diff --git a/lib/Media.php b/lib/Media.php index 61f7c46..32dea26 100644 --- a/lib/Media.php +++ b/lib/Media.php @@ -83,7 +83,7 @@ class Media extends PhpObject { } } } - return $bOwnMedia?$this->asMedia:$asMedias; + return $bOwnMedia?$this->asMedia:$asMedias ?? []; } public function getInfo() { @@ -273,6 +273,8 @@ class Media extends PhpObject { //Resize $asThumbInfo = ToolBox::createThumbnail($sTempPath, self::THUMB_MAX_WIDTH, 0, $sThumbPath, true); break; + default: + $asThumbInfo = ['error'=>'error.unknown_type', 'out'=>'']; } } diff --git a/resources/lang/en.json b/resources/lang/en.json index a4a42ca..cf734a9 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -72,7 +72,8 @@ "impossible_value": "Value \"$0\" is not valid for field \"$1\"", "no_auth": "Not authorized", "not_found": "Unknown action", - "unknown_field": "Unknown field \"$0\"" + "unknown_field": "Unknown field \"$0\"", + "unknown_type": "Unknown type \"$0\"" }, "feed": { "counter": "#$0", diff --git a/resources/lang/es.json b/resources/lang/es.json index 811811a..8fd2b1f 100644 --- a/resources/lang/es.json +++ b/resources/lang/es.json @@ -72,7 +72,8 @@ "impossible_value": "El valor \"$0\" no es posible para el campo \"$1\"", "no_auth": "Sin autorización", "not_found": "Acción desconocida", - "unknown_field": "Campo \"$0\" desconocido" + "unknown_field": "Campo \"$0\" desconocido", + "unknown_type": "Tipo \"$0\" desconocido" }, "feed": { "counter": "N.º $0", diff --git a/resources/lang/fr.json b/resources/lang/fr.json index 8df5db6..4a8309f 100644 --- a/resources/lang/fr.json +++ b/resources/lang/fr.json @@ -72,7 +72,8 @@ "impossible_value": "La valeur \"$0\" n'est pas possible pour le champ \"$1\"", "no_auth": "Pas d'autorisation", "not_found": "Action inconnue", - "unknown_field": "Champ \"$0\" inconnu" + "unknown_field": "Champ \"$0\" inconnu", + "unknown_type": "Type \"$0\" inconnu" }, "feed": { "counter": "N°$0",