]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - application/Utils.php
Merge pull request #1540 from ArthurHoaro/fix/metadata-regexes
[github/shaarli/Shaarli.git] / application / Utils.php
index 9c9eaaa2611eff24d62d24eb2d30e2da372d4aad..bcfda65c9ca14cef75aac304396f0512dba500d5 100644 (file)
@@ -95,14 +95,14 @@ function escape($input)
         return null;
     }
 
-    if (is_bool($input)) {
+    if (is_bool($input) || is_int($input) || is_float($input) || $input instanceof DateTimeInterface) {
         return $input;
     }
 
     if (is_array($input)) {
         $out = array();
         foreach ($input as $key => $value) {
-            $out[$key] = escape($value);
+            $out[escape($key)] = escape($value);
         }
         return $out;
     }