Opened 10 years ago
Closed 10 years ago
#33093 closed defect (bug) (fixed)
Upgrade from 4.2.2 produces a warning on upgrade
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.2.4 | Priority: | normal |
Severity: | normal | Version: | 4.2.2 |
Component: | Upgrade/Install | Keywords: | needs-patch fixed-major |
Focuses: | Cc: |
Description
Warning: Invalid argument supplied for foreach() in /sites/test1.eagle.servers.qsandbox.com/htdocs/wp-admin/includes/update-core.php on line 1252
Attachments (2)
Change History (11)
This ticket was mentioned in Slack in #core by pento. View the logs.
10 years ago
#3
@
10 years ago
- Component changed from Administration to Upgrade/Install
- Keywords needs-patch added; reporter-feedback removed
- Milestone changed from Awaiting Review to 4.3
- Version changed from trunk to 4.2.2
I can see how this warning would've happened, it doesn't need any custom plugins/themes, though it will need WP_DEBUG enabled.
This warning will also occur when upgrading to 4.3, so we should fix it before 4.3 is released, and backport to the 4.2 branch.
#5
@
10 years ago
For the patch, I grepped all glob(
and skipped SimplePie/Misc.php
. Maybe that is an upstream or we want a warning there, don't know. Note (array)false = array(false). Also, as PHP says, "On some systems it is impossible to distinguish between empty match and an error." The glob()
emulator in includes/class-ftp.php returns false or array, like PHP.
I don't see any unit tests.
#6
@
10 years ago
+1 for this patch. We do not have WP_DEBUG enabled anywhere, but noticed some of our sites never automatically updated to 4.2.3 - upon investigating, we found this PHP warning littering the error_log. Logging into the admin area and clicking to upgrade successfully worked, however.
As kitchin said, the php docs definitely mention the possibility of this issue on some systems, per the "Note" blockquote under Return Values. For the most broad system compatability, you can't simply trust a glob() inside a foreach() http://php.net/manual/en/function.glob.php
Did you have wp_debug on or not? Using any plugins or custom themes?