[wp-trac] [WordPress Trac] #7781: Notice: Only variable references should be returned by reference in POST.PHP at Line 2006

WordPress Trac wp-trac at lists.automattic.com
Mon Sep 22 23:25:52 GMT 2008


#7781: Notice: Only variable references should be returned by reference in
POST.PHP at Line 2006
---------------------+------------------------------------------------------
 Reporter:  x11tech  |       Owner:  anonymous         
     Type:  defect   |      Status:  new               
 Priority:  normal   |   Milestone:  2.7               
Component:  General  |     Version:  2.6.1             
 Severity:  minor    |    Keywords:  get_pages post.php
---------------------+------------------------------------------------------
 '''Issue:'''

 Notice: Only variable references should be returned by reference at
 (references server directory)/POST.PHP at Line 2006

 '''Steps to reproduce:'''

 1.) File upload PHP script added to custom page template.

 2.) Upload a file via PHP script

 '''Expected results:'''

 Page updates normally

 '''Actual results:'''

 Notice: Only variable references should be returned by reference at
 (references server directory)/POST.PHP at Line 2006


 '''Solution:'''

 Reviewing Line 2006 results in the following code:

 ======================================================

 Current code from 2.6.1

 ======================================================

         if ( $cache = wp_cache_get( 'get_pages', 'posts' ) )
                 if ( isset( $cache[ $key ] ) )
                         return apply_filters('get_pages', $cache[ $key ],
 $r );

 ======================================================

 Proposed code

 ======================================================

         if ( $cache = wp_cache_get( 'get_pages', 'posts' ) )
                 if ( isset( $cache[ $key ] ) )
                 {
                         $retval = apply_filters('get_pages', $cache[ $key
 ], $r );
                         return $retval;
                 }

-- 
Ticket URL: <http://trac.wordpress.org/ticket/7781>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list