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/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", 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", 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;