Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#23032 closed defect (bug) (fixed)

Call get_page_hierarchy without passing by reference in wp-includes/rewrite.php page_uri_index

Reported by: askapache's profile Askapache Owned by: wonderboymusic's profile wonderboymusic
Milestone: 3.7 Priority: normal
Severity: minor Version: 3.0
Component: Warnings/Notices Keywords: has-patch
Focuses: Cc:

Description

PHP Strict Standards: Only variables should be passed by reference in wp-includes/rewrite.php on line 825

Due to &$pages in the function declaration.

function get_page_hierarchy( &$pages, $page_id = 0 )

Instead of calling get_page_hierarchy with the full $wpdb->get_results as the arg, save the get_results to a variable and pass that to get_page_hierarchy.

$pages = $wpdb->get_results(...)
$posts = get_page_hierarchy( $pages );

Attachments (1)

rewrite.php.patch (673 bytes) - added by Askapache 12 years ago.
Patch to call function with variable instead of referenced

Download all attachments as: .zip

Change History (5)

@Askapache
12 years ago

Patch to call function with variable instead of referenced

#1 @SergeyBiryukov
12 years ago

  • Component changed from General to Warnings/Notices
  • Milestone changed from Awaiting Review to 3.6
  • Version changed from trunk to 3.0

#2 @ryan
12 years ago

  • Milestone changed from 3.6 to Future Release

#3 @wonderboymusic
12 years ago

  • Milestone changed from Future Release to 3.7

#4 @wonderboymusic
12 years ago

  • Owner set to wonderboymusic
  • Resolution set to fixed
  • Status changed from new to closed

In 25263:

Only variables should be passed by reference.

Props Askapache.
Fixes #23032.

Note: See TracTickets for help on using tickets.