Opened 14 years ago
Closed 14 years ago
#21716 closed defect (bug) (fixed)
PHP 5.4 warning when updating plugins
| Reported by: | knutsp | Owned by: | ryan |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.5 |
| Component: | Warnings/Notices | Version: | 3.4.1 |
| Severity: | minor | Keywords: | has-patch |
| Cc: | Focuses: |
Description
When updating plugins from either /wp-admin/network/update-core.php (Multisite) or from /wp-admin/update-core.php (Single site) I get this error logged (many times), using PHP 5.4:
PHP Warning: Creating default object from empty value in /mysite/wp-admin/includes/update.php on line 90
update-core.php:89 reads
if ( ! isset( $cur->current ) ) $cur->current = '';
I'm not sure what is the best approach to avoid this. Both the bad (?)
@$cur->current = '';
and the better (?)
if ( ! is_object( $cur ) ) $cur = new stdClass; if ( ! isset( $cur->current ) ) $cur->current = '';
will avoid the warning, and seems to work.
Attachments (1)
Change History (6)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Closed #21838 as a duplicate.