WordPress.org

Make WordPress Core

Ticket #18237: wp-fix-return-by-reference.svn.patch

File wp-fix-return-by-reference.svn.patch, 536 bytes (added by elyobo, 3 years ago)

Patch as svn diff from trunk

  • wp-includes/capabilities.php

     
    206206         * @return object|null Null, if role does not exist. WP_Role object, if found. 
    207207         */ 
    208208        function &get_role( $role ) { 
     209                $res = null; 
    209210                if ( isset( $this->role_objects[$role] ) ) 
    210                         return $this->role_objects[$role]; 
    211                 else 
    212                         return null; 
     211                        $res = $this->role_objects[$role]; 
     212                return $res; 
    213213        } 
    214214 
    215215        /**