Skip to content

Commit

Permalink
fix fatal error on php 8 (stay on 4.5.5 upstream)
Browse files Browse the repository at this point in the history
  • Loading branch information
Server committed Jul 31, 2023
1 parent fdfeb76 commit cc6c5ff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions includes/api/class-api-v3-client.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,12 +281,14 @@ private function request( $method, $resource, array $args = array() ) {
$data_to['audiences'] = $value.(!empty($data_to['audiences']) ? ','.$data_to['audiences'] : '');

$data_to['privacy'] = 1; // forzatura Privacy
$method = 'user.subscribe';
if ($args['status'] == 'pending') { //GESTIONE DOUBLE OPTIN!!
$this->get_log()->debug( sprintf( "CALL service_user_subscribe %s %s", print_r($data_to, true), $ip ) );
$result = service_user_subscribe($data_to, $ip);
} else {
$this->get_log()->debug( sprintf( "CALL service_user_create %s %s", print_r($data_to, true) ) );
$this->get_log()->debug( sprintf( "CALL service_user_create %s", print_r($data_to, true) ) );
$result = service_user_create($data_to);
$method = 'user.create';
}

if (!$result) {
Expand All @@ -298,7 +300,7 @@ private function request( $method, $resource, array $args = array() ) {
$this->get_log()->debug( sprintf( "CALL service_user_update %s %s", $data_to["mail"], print_r($data_to, true) ) );
$result = service_user_update($data_to["mail"],$data_to);
if (!$result) throw new NL4WP_API_Exception( service_errormessage(), service_errorcode(), $result, $args );
} else throw new NL4WP_API_Exception( 'Unexpected status after user.create', 999, false, $args );
} else throw new NL4WP_API_Exception( 'Unexpected status after '.$method.': '.service_errormessage(), service_errorcode(), false, $args );
}
$ret = array('id' => $result) + $args;
return (object) $ret;
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Contributors: Morloi, Bago
Tags: newsletter, nl4wp, email, marketing, newsletter, subscribe, widget, nl4wp, contact form 7, woocommerce, buddypress, ibericode, newsletter forms, newsletter integrations
Requires at least: 4.1
Tested up to: 6.0.1
Tested up to: 6.2.2
Stable tag: 4.5.9
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Expand Down

0 comments on commit cc6c5ff

Please sign in to comment.