From fe45499ecfcdee1a233dd5b5d52bd5b3b080d333 Mon Sep 17 00:00:00 2001 From: nacin Date: Sun, 25 Jul 2010 07:34:49 +0000 Subject: [PATCH] More curses on PHP 5.0.5. see #13757, fixes #14160. for 3.0.1. git-svn-id: http://svn.automattic.com/wordpress/branches/3.0@15470 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/admin-ajax.php | 2 +- wp-admin/includes/nav-menu.php | 2 +- wp-admin/ms-edit.php | 2 +- wp-app.php | 2 +- wp-includes/query.php | 3 ++- wp-includes/wp-db.php | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php index 44cdf64dbf..df64921b72 100644 --- a/wp-admin/admin-ajax.php +++ b/wp-admin/admin-ajax.php @@ -893,7 +893,7 @@ case 'add-meta' : 'supplemental' => array('postid' => $pid) ) ); } else { // Update? - $mid = (int) array_pop(array_keys($_POST['meta'])); + $mid = (int) array_pop( $var_by_ref = array_keys($_POST['meta']) ); $key = $_POST['meta'][$mid]['key']; $value = $_POST['meta'][$mid]['value']; if ( '' == trim($key) ) diff --git a/wp-admin/includes/nav-menu.php b/wp-admin/includes/nav-menu.php index e467559841..8c8e9697f5 100644 --- a/wp-admin/includes/nav-menu.php +++ b/wp-admin/includes/nav-menu.php @@ -324,7 +324,7 @@ function _wp_ajax_menu_quick_search( $request = array() ) { while ( have_posts() ) { the_post(); if ( 'markup' == $response_format ) { - echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', array( get_post( get_the_ID() ) ) ), 0, (object) $args ); + echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', array( get_post( $var_by_ref = get_the_ID() ) ) ), 0, (object) $args ); } elseif ( 'json' == $response_format ) { echo json_encode( array( diff --git a/wp-admin/ms-edit.php b/wp-admin/ms-edit.php index 5f6af9d1c2..c58c25c97f 100644 --- a/wp-admin/ms-edit.php +++ b/wp-admin/ms-edit.php @@ -104,7 +104,7 @@ switch ( $_GET['action'] ) { $move_users = array(); foreach ( (array)$users as $user ) { $user_meta_value = unserialize( $user->meta_value ); - if ( is_array( $user_meta_value ) && array_pop( array_keys( $user_meta_value ) ) == 'subscriber' ) + if ( is_array( $user_meta_value ) && array_pop( $var_by_ref = array_keys( $user_meta_value ) ) == 'subscriber' ) $move_users[] = $user->user_id; } if ( false == empty( $move_users ) ) { diff --git a/wp-app.php b/wp-app.php index f8feb372e2..f21c3c0683 100644 --- a/wp-app.php +++ b/wp-app.php @@ -223,7 +223,7 @@ class AtomServer { */ function AtomServer() { - $this->script_name = array_pop(explode('/',$_SERVER['SCRIPT_NAME'])); + $this->script_name = array_pop( $var_by_ref = explode( '/', $_SERVER['SCRIPT_NAME'] ) ); $this->app_base = site_url( $this->script_name . '/' ); $this->selectors = array( diff --git a/wp-includes/query.php b/wp-includes/query.php index cf3cc1e29b..3a8c1e9b60 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -2738,7 +2738,8 @@ class WP_Query { $this->queried_object = $term; $this->queried_object_id = $term->term_id; } elseif ( $this->is_posts_page ) { - $this->queried_object = & get_page(get_option('page_for_posts')); + $page_for_posts = get_option('page_for_posts'); + $this->queried_object = & get_page( $page_for_posts ); $this->queried_object_id = (int) $this->queried_object->ID; } elseif ( $this->is_single && !is_null($this->post) ) { $this->queried_object = $this->post; diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php index 6630efcf31..61f6d9aab4 100644 --- a/wp-includes/wp-db.php +++ b/wp-includes/wp-db.php @@ -1402,7 +1402,7 @@ class wpdb { // Return an array of row objects with keys from column 1 // (Duplicates are discarded) foreach ( $this->last_result as $row ) { - $key = array_shift( get_object_vars( $row ) ); + $key = array_shift( $var_by_ref = get_object_vars( $row ) ); if ( ! isset( $new_array[ $key ] ) ) $new_array[ $key ] = $row; }