Skip to content

Commit

Permalink
Merge pull request #25 from devgeniem/php8-deprecations
Browse files Browse the repository at this point in the history
Fix calling json_decode with non-string input
  • Loading branch information
HPiirainen authored Feb 6, 2024
2 parents 25a9a61 + 448b2c2 commit 454d5fe
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Changed
## [Released]

## [1.3.1] - 2024-01-29

### Changed
- Enabled PHP 8.0 and PHP 8.1 usage #18

## [Released]
### Fixed
- Fix PHP 8 deprecation. #25

## [1.3.0] - 2023-08-01
- Fixed the issue https://github.com/devgeniem/wp-oopi/issues/23 If OOPI_IGNORE_SSL has been enabled and the certificate on the source site is invalid, the exif_imagetype() function cannot be used in the AttachmentImporter.
Expand Down
2 changes: 1 addition & 1 deletion plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Oopi
* Plugin URI: https://github.com/devgeniem/wp-oopi
* Description: Oopi is an object-oriented developer friendly WordPress importer.
* Version: 1.3.0
* Version: 1.3.1
* Author: Geniem
* Author URI: http://www.github.com/devgeniem
* License: GPL3
Expand Down
4 changes: 4 additions & 0 deletions src/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ class Util {
*/
public static function is_json( $data ) {

if ( ! is_string( $data ) ) {
return false;
}

json_decode( $data );

return ( json_last_error() === JSON_ERROR_NONE );
Expand Down

0 comments on commit 454d5fe

Please sign in to comment.