[wp-trac] [WordPress Trac] #17911: WP_Dependencies::remove() may generate PHP Warning
WordPress Trac
wp-trac at lists.automattic.com
Mon Jun 27 19:25:48 UTC 2011
#17911: WP_Dependencies::remove() may generate PHP Warning
------------------------------+-----------------------------
Reporter: ftrudeau | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Warnings/Notices | Version: 3.1.3
Severity: minor | Keywords:
------------------------------+-----------------------------
The following code will always generate a PHP Warning: Illegal offset type
in unset, on line 159 of /wp-includes/class.wp-dependencies.php
{{{
global $wp_styles;
foreach ($wp_styles->registered AS $handle) $wp_styles->remove($handle);
}}}
... and here is a simple fix :
{{{
if (@isset($this->registered[$handle])) {
unset($this->registered[$handle]);
}
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/17911>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list