[wp-trac] [WordPress Trac] #25462: set_group fails on deregistered but not dequeued

WordPress Trac noreply at wordpress.org
Fri Jan 24 11:51:46 UTC 2014


#25462: set_group fails on deregistered but not dequeued
-----------------------------------+------------------------------
 Reporter:  tivnet                 |       Owner:
     Type:  defect (bug)           |      Status:  new
 Priority:  normal                 |   Milestone:  Awaiting Review
Component:  Script Loader          |     Version:
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch 2nd-opinion  |     Focuses:
-----------------------------------+------------------------------

Comment (by tivnet):

 I checked again, with 3.8 - and there was no warning.
 However, theoretically, `args` can be null

 {{{
         public function add( $handle, $src, $deps = array(), $ver = false,
 $args = null ) {
                 if ( isset($this->registered[$handle]) )
                         return false;
                 $this->registered[$handle] = new _WP_Dependency( $handle,
 $src, $deps, $ver, $args );
                 return true;
         }
 }}}

 So, checking for `if ( $this->registered[$handle]->args === 1 )` may
 produce warnings.
 I believe, the code will be safer with the patch.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/25462#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list