Administration: Fix failing tests as a result of [48397].

Because of changes to how PHP handles arrays used in `foreach()` loops in PHP >= 7.0, [48397] resulted in a failing test for PHP 5.6.

This calls `reset()` after using the `$results` array in the `foreach()` to ensure the array is treated the same and as expected.

Props azaozz, desrosj, SergeyBiryukov, xknown.
See #50448.

git-svn-id: https://develop.svn.wordpress.org/trunk@48401 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jonathan Desrosiers 2020-07-07 20:36:41 +00:00
parent 7d3b647a16
commit dd64c95f65
2 changed files with 2 additions and 0 deletions

View File

@ -392,6 +392,7 @@ class Plugin_Upgrader extends WP_Upgrader {
unset( $past_failure_emails[ $plugin ] );
}
update_option( 'auto_plugin_theme_update_emails', $past_failure_emails );
reset( $results );
return $results;
}

View File

@ -501,6 +501,7 @@ class Theme_Upgrader extends WP_Upgrader {
unset( $past_failure_emails[ $theme ] );
}
update_option( 'auto_plugin_theme_update_emails', $past_failure_emails );
reset( $results );
return $results;
}