]> git.mxchange.org Git - friendica.git/blobdiff - src/Util/JsonLD.php
Fixed max value check, improved request value fetching
[friendica.git] / src / Util / JsonLD.php
index fa169c00468c7c3c0d55b5e3b1b365159b65f5a5..866fc2cdf54d532142039db2214ba55b3d8187f0 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -21,7 +21,7 @@
 
 namespace Friendica\Util;
 
-use Friendica\Core\Cache\Duration;
+use Friendica\Core\Cache\Enum\Duration;
 use Friendica\Core\Logger;
 use Exception;
 use Friendica\DI;
@@ -165,7 +165,7 @@ class JsonLD
                }
                catch (Exception $e) {
                        $compacted = false;
-                       Logger::error('compacting error', ['line' => $e->getLine(), 'message' => $e->getMessage()]);
+                       Logger::notice('compacting error', ['line' => $e->getLine(), 'exception' => $e]);
                }
 
                $json = json_decode(json_encode($compacted, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), true);
@@ -193,7 +193,7 @@ class JsonLD
                }
 
                // If it isn't an array yet, make it to one
-               if (!is_int(key($array[$element]))) {
+               if (!is_array($array[$element]) || !is_int(key($array[$element]))) {
                        $array[$element] = [$array[$element]];
                }