diff options
author | Giorgio Balduzzi <gio.balduz@gmail.com> | 2017-06-21 22:57:21 +0200 |
---|---|---|
committer | Brent Shaffer <betterbrent@google.com> | 2017-06-21 13:57:21 -0700 |
commit | b2a53166f9e2d8958be837e1b368c0897fc52a77 (patch) | |
tree | 48b48b5c6cc84aca4fa5848497fce58fa31394be /src | |
parent | d2c50fdaedaa64f91229c30fa4190b0113847b45 (diff) | |
download | php-jwt-b2a53166f9e2d8958be837e1b368c0897fc52a77.zip php-jwt-b2a53166f9e2d8958be837e1b368c0897fc52a77.tar.gz php-jwt-b2a53166f9e2d8958be837e1b368c0897fc52a77.tar.bz2 |
Add the proper Exception message for all JSON error types by PHP (#110)
Diffstat (limited to 'src')
-rw-r--r-- | src/JWT.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/JWT.php b/src/JWT.php index 7729143..814afc0 100644 --- a/src/JWT.php +++ b/src/JWT.php @@ -352,8 +352,10 @@ class JWT { $messages = array( JSON_ERROR_DEPTH => 'Maximum stack depth exceeded', + JSON_ERROR_STATE_MISMATCH => 'Invalid or malformed JSON', JSON_ERROR_CTRL_CHAR => 'Unexpected control character found', - JSON_ERROR_SYNTAX => 'Syntax error, malformed JSON' + JSON_ERROR_SYNTAX => 'Syntax error, malformed JSON', + JSON_ERROR_UTF8 => 'Malformed UTF-8 characters' //PHP >= 5.3.3 ); throw new DomainException( isset($messages[$errno]) |