From db919666561f6c226b3ad19865703d73d280cf1c Mon Sep 17 00:00:00 2001 From: itthinx Date: Sat, 7 May 2022 22:19:00 +0200 Subject: [PATCH 1/2] version 4.13.0 --- affiliates.php | 4 ++-- changelog.txt | 3 +++ readme.txt | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/affiliates.php b/affiliates.php index bb74319..ca5a486 100644 --- a/affiliates.php +++ b/affiliates.php @@ -21,7 +21,7 @@ * Plugin Name: Affiliates * Plugin URI: http://www.itthinx.com/plugins/affiliates * Description: The Affiliates plugin provides the right tools to maintain a partner referral program. - * Version: 4.12.0 + * Version: 4.13.0 * Author: itthinx * Author URI: http://www.itthinx.com * Donate-Link: http://www.itthinx.com @@ -35,7 +35,7 @@ } if ( !defined( 'AFFILIATES_CORE_VERSION' ) ) { - define( 'AFFILIATES_CORE_VERSION', '4.12.0' ); + define( 'AFFILIATES_CORE_VERSION', '4.13.0' ); define( 'AFFILIATES_PLUGIN_NAME', 'affiliates' ); define( 'AFFILIATES_FILE', __FILE__ ); define( 'AFFILIATES_PLUGIN_BASENAME', plugin_basename( AFFILIATES_FILE ) ); diff --git a/changelog.txt b/changelog.txt index 8f16485..d3edc61 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,8 @@ == Affiliates - Changelog == += 4.13.0 = +* WordPress 6.0 compatible. + = 4.12.0 = * WordPress 6.0 compatible. * Requires at least WordPress 5.6. diff --git a/readme.txt b/readme.txt index f89045b..331f23c 100644 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Tags: affiliate, affiliates, affiliate marketing, referral, growth marketing, ad Requires at least: 5.6.0 Tested up to: 6.0 Requires PHP: 5.6.0 -Stable tag: 4.12.0 +Stable tag: 4.13.0 License: GPLv3 The Affiliates system provides the most powerful growth-oriented tools to run a successful Affiliate Marketing Program. From a874cff4e9c64445fc7a6df77a116572411e0949 Mon Sep 17 00:00:00 2001 From: itthinx Date: Sat, 7 May 2022 22:33:41 +0200 Subject: [PATCH 2/2] fixed deprecated passing null --- changelog.txt | 3 +++ lib/core/affiliates-admin-hits-uri.php | 8 ++++---- lib/core/class-affiliates-shortcodes.php | 2 +- lib/core/class-affiliates-totals.php | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/changelog.txt b/changelog.txt index d3edc61..7d89727 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,9 @@ = 4.13.0 = * WordPress 6.0 compatible. +* PHP 8.1 compatibility fixed deprecated passing null to stripslashes(). +* PHP 8.1 compatibility fixed deprecated passing null to strcmp(). +* PHP 8.1 compatibility fixed deprecated passing null to trim(). = 4.12.0 = * WordPress 6.0 compatible. diff --git a/lib/core/affiliates-admin-hits-uri.php b/lib/core/affiliates-admin-hits-uri.php index 2f129af..ecb477e 100644 --- a/lib/core/affiliates-admin-hits-uri.php +++ b/lib/core/affiliates-admin-hits-uri.php @@ -583,25 +583,25 @@ function affiliates_admin_hits_uri() { sprintf( '' . ' ' . sprintf( '' . ' ' . sprintf( '' . ' ' . '' . '' . '
' . diff --git a/lib/core/class-affiliates-shortcodes.php b/lib/core/class-affiliates-shortcodes.php index 2f3e830..f9448dd 100644 --- a/lib/core/class-affiliates-shortcodes.php +++ b/lib/core/class-affiliates-shortcodes.php @@ -870,7 +870,7 @@ public static function affiliates_url( $atts, $content = null ) { "SELECT $affiliates_users_table.affiliate_id FROM $affiliates_users_table LEFT JOIN $affiliates_table ON $affiliates_users_table.affiliate_id = $affiliates_table.affiliate_id WHERE $affiliates_users_table.user_id = %d AND $affiliates_table.status = 'active'", intval( $user_id ) ))) { - $content = trim( $content ); + $content = $content !== null ? trim( $content ) : ''; if ( strlen( $content ) > 0 ) { // wp_texturize() has already been applied to $content and // it indiscriminately replaces ampersands with the HTML diff --git a/lib/core/class-affiliates-totals.php b/lib/core/class-affiliates-totals.php index 093b69f..d01142e 100644 --- a/lib/core/class-affiliates-totals.php +++ b/lib/core/class-affiliates-totals.php @@ -494,7 +494,7 @@ public static function view() { $name_suffix = ''; $class_deleted = ''; - if ( $is_deleted = ( strcmp( $result->status, 'deleted' ) == 0 ) ) { + if ( $is_deleted = ( $result->status !== null && strcmp( $result->status, 'deleted' ) == 0 ) ) { $class_deleted = ' deleted '; $name_suffix .= ' ' . __( '(removed)', 'affiliates' ); }