Strict standards could break admin css in wordpress


The following method in class.wp-scripts.php could break your css if you have strict standards enabled on your server.

	function set_group( $handle, $recursion, $group = false ) {
		$grp = isset($this->registered[$handle]->extra['group']) ? (int) $this->registered[$handle]->extra['group'] : 0;
		if ( false !== $group && $grp > $group )
			$grp = $group;
 
		return parent::set_group( $handle, $recursion, $grp );
	}

This is because the WP_Scripts inheritance from WP_Dependencies does not follow the signature of the method. WP_Dependencies have the set_group function declared without any default parameters while the subclass have defaulted $group to false.

Easy fix! Just remove the default value on the group parameter so it looks like this:

	function set_group( $handle, $recursion, $group ) {
		$grp = isset($this->registered[$handle]->extra['group']) ? (int) $this->registered[$handle]->extra['group'] : 0;
		if ( false !== $group && $grp > $group )
			$grp = $group;
 
		return parent::set_group( $handle, $recursion, $grp );
	}

The only place I can find this possible being called from send in a value anyway so there’s no need for having the default value as of right now.

  1. #1 by FalkSchoolBlog on November 24th, 2011

    Hey

    - Do You want to conscious all wide popular Russian site odnoklassniki.ru in support of classmates search?
    - Are You going to treks to Egypt?
    - Do You want to eat a way and entertain a coffee break in Rome?
    - Do You like mobile to Berlin?

    - May be you after to remember all nigh Swine influenza?

    - Or may be you unprejudiced stand in want to decide between doing sports or watching it on the TV?

    You be enduring to afflict additional Falk School Blog at falk-school.com

    I’s repentant if I’m offtopic here.
    And a talented allege to Admin, transfer this transmit to suitable field!

    Thanks through despite your r‚clame!

    Falk-School

(will not be published)

  1. No trackbacks yet.