Skip to content

Commit

Permalink
feat: Added empty check before is array to prevent errors on PHP >= 8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmolinacano committed Jul 5, 2024
1 parent 0cd866b commit 709c007
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions doofinder-for-woocommerce/doofinder-for-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin Name: DOOFINDER Search and Discovery for WP & WooCommerce
* License: GPLv2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
* Version: 2.4.2
* Version: 2.4.3
* Requires at least: 5.6
* Requires PHP: 7.0
* Author: Doofinder
Expand Down Expand Up @@ -35,7 +35,7 @@ class Doofinder_For_WordPress
* @var string
*/

public static $version = '2.4.2';
public static $version = '2.4.3';

/**
* The only instance of Doofinder_For_WordPress
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ private static function get_custom_attributes($product_id, $custom_attr){
$custom_attributes[$attribute_slug][] = $option;
}

if ( is_array( $custom_attributes[ $attribute_slug ] ) ) {
if ( ! empty( $custom_attributes[ $attribute_slug ] ) && is_array( $custom_attributes[ $attribute_slug ] ) ) {
if ( 0 === count( $custom_attributes[ $attribute_slug ] ) ) {
$custom_attributes[ $attribute_slug ] = '';
} elseif ( 1 === count( $custom_attributes[ $attribute_slug ] ) ) {
Expand Down
7 changes: 5 additions & 2 deletions doofinder-for-woocommerce/readme.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
=== DOOFINDER Search and Discovery for WP & WooCommerce ===
Contributors: Doofinder
Tags: search, autocomplete
Version: 2.4.2
Version: 2.4.3
Requires at least: 5.6
Tested up to: 6.3.1
Requires PHP: 7.0
Stable tag: 2.4.2
Stable tag: 2.4.3
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -126,6 +126,9 @@ You can report security bugs through the Patchstack Vulnerability Disclosure Pro

== Changelog ==

= 2.4.3 =
- Bugfix, added array checking on attributes data for PHP >= 8.0.

= 2.4.2 =
- Bugfix, added array checking on attributes data.

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "doofinder-woocommerce",
"version": "2.4.2",
"version": "2.4.3",
"description": "Integrate Doofinder in your WooCommerce site with (almost) no effort.",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 709c007

Please sign in to comment.