Skip to content

Commit 60575a7

Browse files
authored
Merge pull request #61 from awesomemotive/release/2.0.1
WIP - Release 2.0.1
2 parents b61c239 + 776bb36 commit 60575a7

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

readme.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Tags: cron, tool, transient
99
Requires PHP: 5.6.20
1010
Requires at least: 5.3
1111
Tested up to: 5.9
12-
Stable Tag: 2.0.0
12+
Stable Tag: 2.0.1
1313

1414
Provides a familiar interface to view, search, edit, and delete Transients.
1515

@@ -90,6 +90,10 @@ No. It only works when transients are stored in the database.
9090

9191
== Changelog ==
9292

93+
= 2.0.1 - December 21, 2021 =
94+
95+
* Fix: PHP fatal error when guessing JSON value type
96+
9397
= 2.0.0 - December 16, 2021 =
9498

9599
* Added: Small-screen support

transients-manager.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Text Domain: transients-manager
1212
* Requires PHP: 5.6.20
1313
* Requires at least: 5.3
14-
* Version: 2.0.0
14+
* Version: 2.0.1
1515
*/
1616

1717
// Exit if accessed directly
@@ -825,10 +825,6 @@ private function get_transient_value_type( $transient ) {
825825
if ( is_array( $value ) ) {
826826
$type = esc_html__( 'array', 'transients-manager' );
827827

828-
// JSON
829-
} elseif ( is_object( json_decode( $value ) ) ) {
830-
$type = esc_html__( 'json', 'transients-manager' );
831-
832828
// Object
833829
} elseif ( is_object( $value ) ) {
834830
$type = esc_html__( 'object', 'transients-manager' );
@@ -859,6 +855,11 @@ private function get_transient_value_type( $transient ) {
859855
$type = esc_html__( 'numeric', 'transients-manager' );
860856
}
861857

858+
// JSON
859+
} elseif ( is_string( $value ) && is_object( json_decode( $value ) ) ) {
860+
$type = esc_html__( 'json', 'transients-manager' );
861+
862+
// Scalar
862863
} else {
863864
$type = esc_html__( 'scalar', 'transients-manager' );
864865
}

0 commit comments

Comments
 (0)