X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=twitter%2Fvendor%2Fabraham%2Ftwitteroauth%2Fsrc%2FUtil%2FJsonDecoder.php;fp=twitter%2Fvendor%2Fabraham%2Ftwitteroauth%2Fsrc%2FUtil%2FJsonDecoder.php;h=c8589c53cc79bbce0ed470079ecb76b33da4dbd9;hb=d18bb44f8a58b0aa8ecd82eab25caca3f9f574b6;hp=0000000000000000000000000000000000000000;hpb=01738518a25392aefea8586463121024ae3a1a4c;p=friendica-addons.git diff --git a/twitter/vendor/abraham/twitteroauth/src/Util/JsonDecoder.php b/twitter/vendor/abraham/twitteroauth/src/Util/JsonDecoder.php new file mode 100644 index 00000000..c8589c53 --- /dev/null +++ b/twitter/vendor/abraham/twitteroauth/src/Util/JsonDecoder.php @@ -0,0 +1,26 @@ + + */ +class JsonDecoder +{ + /** + * Decodes a JSON string to stdObject or associative array + * + * @param string $string + * @param bool $asArray + * + * @return array|object + */ + public static function decode($string, $asArray) + { + if (version_compare(PHP_VERSION, '5.4.0', '>=') && !(defined('JSON_C_VERSION') && PHP_INT_SIZE > 4)) { + return json_decode($string, $asArray, 512, JSON_BIGINT_AS_STRING); + } + + return json_decode($string, $asArray); + } +}