WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#7781 closed defect (bug) (fixed)

Notice: Only variable references should be returned by reference in POST.PHP at Line 2006

Reported by: x11tech Owned by: jacobsantos
Milestone: 2.7 Priority: normal
Severity: minor Version: 2.6.1
Component: General Keywords: get_pages post.php
Focuses: Cc:

Description

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;

}

Change History (4)

comment:1 @jacobsantos7 years ago

What is the location of post.php from the base directory of WordPress?

comment:2 @jacobsantos7 years ago

  • Owner changed from anonymous to jacobsantos

comment:3 @jacobsantos7 years ago

  • Status changed from new to assigned

comment:4 @ryan7 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [9239]) Must pass var by ref. Props x11tech. fixes #7781

Note: See TracTickets for help on using tickets.