Skip to content

Commit b17f5a7

Browse files
committed
add BC for 5.3 because why not
1 parent 86d8310 commit b17f5a7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/JWT.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,12 @@ public static function jsonDecode($input)
330330
*/
331331
public static function jsonEncode($input)
332332
{
333-
$json = \json_encode($input);
333+
if (PHP_VERSION_ID >= 50400) {
334+
$json = \json_encode($input, \JSON_UNESCAPED_SLASHES);
335+
} else {
336+
// PHP 5.3 only
337+
$json = \json_encode($input);
338+
}
334339
if ($errno = \json_last_error()) {
335340
static::handleJsonError($errno);
336341
} elseif ($json === 'null' && $input !== null) {

0 commit comments

Comments
 (0)