Skip to content

Commit

Permalink
Merge pull request #61 from awesomemotive/release/2.0.1
Browse files Browse the repository at this point in the history
WIP - Release 2.0.1
  • Loading branch information
JJJ authored Dec 21, 2021
2 parents b61c239 + 776bb36 commit 60575a7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
6 changes: 5 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Tags: cron, tool, transient
Requires PHP: 5.6.20
Requires at least: 5.3
Tested up to: 5.9
Stable Tag: 2.0.0
Stable Tag: 2.0.1

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

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

== Changelog ==

= 2.0.1 - December 21, 2021 =

* Fix: PHP fatal error when guessing JSON value type

= 2.0.0 - December 16, 2021 =

* Added: Small-screen support
Expand Down
11 changes: 6 additions & 5 deletions transients-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Text Domain: transients-manager
* Requires PHP: 5.6.20
* Requires at least: 5.3
* Version: 2.0.0
* Version: 2.0.1
*/

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

// JSON
} elseif ( is_object( json_decode( $value ) ) ) {
$type = esc_html__( 'json', 'transients-manager' );

// Object
} elseif ( is_object( $value ) ) {
$type = esc_html__( 'object', 'transients-manager' );
Expand Down Expand Up @@ -859,6 +855,11 @@ private function get_transient_value_type( $transient ) {
$type = esc_html__( 'numeric', 'transients-manager' );
}

// JSON
} elseif ( is_string( $value ) && is_object( json_decode( $value ) ) ) {
$type = esc_html__( 'json', 'transients-manager' );

// Scalar
} else {
$type = esc_html__( 'scalar', 'transients-manager' );
}
Expand Down

0 comments on commit 60575a7

Please sign in to comment.