Skip to content

Commit

Permalink
Workaround for array vs SimpleXMLElement in PHP 8 (#4762) (#4763)
Browse files Browse the repository at this point in the history
Co-authored-by: mcdruid <drew@mcdruid.co.uk>
  • Loading branch information
mcdruid and mcdruid committed May 26, 2021
1 parent 687f954 commit 1eb7f60
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Drush/UpdateService/Project.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,13 @@ private static function parseXml(\SimpleXMLElement $xml) {
$releases = array();
$releases_xml = @$xml->xpath("/project/releases/release[status='published']");
foreach ($releases_xml as $release) {
$release_array = (array) $release;
$release_info = array();
$statuses = array();

// Extract general release info.
foreach ($items as $item) {
if (array_key_exists($item, $release)) {
if (array_key_exists($item, $release_array)) {
$value = $release->xpath($item);
$release_info[$item] = (string)$value[0];
}
Expand Down

0 comments on commit 1eb7f60

Please sign in to comment.