Ticket #7781 (closed defect (bug): fixed)

Opened 4 months ago

Last modified 3 months ago

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

Reported by: x11tech Assigned to: jacobsantos
Priority: normal Milestone: 2.7
Component: General Version: 2.6.1
Severity: minor Keywords: get_pages post.php
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

09/23/08 15:15:36 changed by jacobsantos

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

10/15/08 04:32:16 changed by jacobsantos

  • owner changed from anonymous to jacobsantos.

10/15/08 04:32:28 changed by jacobsantos

  • status changed from new to assigned.

10/17/08 22:55:30 changed by ryan

  • status changed from assigned to closed.
  • resolution set to fixed.

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