From 65fe32d3b534e296c33fd2d928c646d2f53e37a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reu=CC=88el=20van=20der=20Steege?= Date: Wed, 11 May 2022 10:23:57 +0200 Subject: [PATCH 1/3] Fix possible "Warning: Invalid argument supplied for foreach()" with incomplete config. --- src/XML/GatewaysResponseMessage.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/XML/GatewaysResponseMessage.php b/src/XML/GatewaysResponseMessage.php index 20e42e6..5143a8b 100644 --- a/src/XML/GatewaysResponseMessage.php +++ b/src/XML/GatewaysResponseMessage.php @@ -34,11 +34,13 @@ public static function parse( SimpleXMLElement $xml ) { $message->gateways = array(); - foreach ( $xml->gateways->gateway as $gateway ) { - $id = Security::filter( $gateway->id ); - $description = Security::filter( $gateway->description ); + if ( \is_array( $xml->gateways->gateway ) ) { + foreach ( $xml->gateways->gateway as $gateway ) { + $id = Security::filter( $gateway->id ); + $description = Security::filter( $gateway->description ); - $message->gateways[ $id ] = $description; + $message->gateways[ $id ] = $description; + } } return $message; From 2e2ecbcabd204ac7b3397797f476fef31666cc2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reu=CC=88el=20van=20der=20Steege?= Date: Fri, 20 May 2022 11:18:21 +0200 Subject: [PATCH 2/3] Update Composer allowed plugins (https://getcomposer.org/doc/06-config.md#allow-plugins). --- composer.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index a67a569..05ce95a 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,13 @@ } }, "config": { - "sort-packages": true + "sort-packages": true, + "allow-plugins": { + "composer/installers": true, + "dealerdirect/phpcodesniffer-composer-installer": true, + "roots/wordpress-core-installer": true, + "bamarni/composer-bin-plugin": true + } }, "require": { "php": ">=5.6.20", From 6e3d2be300cb56571e541fa5e9c94e91aa2b68aa Mon Sep 17 00:00:00 2001 From: Remco Tolsma <869674+remcotolsma@users.noreply.github.com> Date: Mon, 30 May 2022 20:04:54 +0200 Subject: [PATCH 3/3] 4.1.1 --- CHANGELOG.md | 9 +++++++-- package.json | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b20faf..1af9be1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ This projects adheres to [Semantic Versioning](http://semver.org/) and [Keep a C ## [Unreleased][unreleased] - +## [4.1.1] - 2022-05-30 +### Fixed +- Fix possible "Warning: Invalid argument supplied for foreach()" with incomplete config. + ## [4.1.0] - 2022-04-11 - No longer use global core mode. - No longer catch exceptions, should be handled downstream. @@ -82,8 +86,9 @@ This projects adheres to [Semantic Versioning](http://semver.org/) and [Keep a C ## 1.0.0 - 2015-01-19 - First release. -[unreleased]: https://github.com/pronamic/wp-pronamic-pay-multisafepay/compare/4.1.0...HEAD -[4.0.1]: https://github.com/pronamic/wp-pronamic-pay-multisafepay/compare/4.0.1...4.1.0 +[unreleased]: https://github.com/pronamic/wp-pronamic-pay-multisafepay/compare/4.1.1...HEAD +[4.1.1]: https://github.com/pronamic/wp-pronamic-pay-multisafepay/compare/4.1.0...4.1.1 +[4.1.0]: https://github.com/pronamic/wp-pronamic-pay-multisafepay/compare/4.0.1...4.1.0 [4.0.1]: https://github.com/pronamic/wp-pronamic-pay-multisafepay/compare/4.0.0...4.0.1 [4.0.0]: https://github.com/wp-pay-gateways/multisafepay/compare/3.0.0...4.0.0 [3.0.0]: https://github.com/wp-pay-gateways/multisafepay/compare/2.1.3...3.0.0 diff --git a/package.json b/package.json index 7cb9643..2261ca1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "multisafepay", - "version": "4.1.0", + "version": "4.1.1", "description": "MultiSafepay driver for the WordPress payment processing library.", "repository": { "type": "git",