Explorar o código

Functions - Adjust is_json() function for better detection.

fusionate %!s(int64=2) %!d(string=hai) anos
pai
achega
9f75df5148
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      resources/functions.php

+ 1 - 1
resources/functions.php

@@ -1484,7 +1484,7 @@ function number_pad($number,$n) {
 //json detection
 //json detection
 	if (!function_exists('is_json')) {
 	if (!function_exists('is_json')) {
 		function is_json($str) {
 		function is_json($str) {
-			return (is_string($str) && is_object(json_decode($str))) ? true : false;
+			return is_string($str) && is_array(json_decode($str, true)) ? true : false;
 		}
 		}
 	}
 	}