forked from LiveCarta/PayPal-PHP-SDK
Ensure backwards compatible behavior with PHP5
This commit is contained in:
@@ -21,6 +21,9 @@ class JsonValidator
|
||||
{
|
||||
@json_decode($string);
|
||||
if (json_last_error() != JSON_ERROR_NONE) {
|
||||
if ($string === '' || $string === null) {
|
||||
return true;
|
||||
}
|
||||
if ($silent == false) {
|
||||
//Throw an Exception for string or array
|
||||
throw new \InvalidArgumentException("Invalid JSON String");
|
||||
|
||||
Reference in New Issue
Block a user