Ticket #21865: call-time-pass-by.diff
File call-time-pass-by.diff, 19.0 KB (added by , 13 years ago) |
---|
-
wp-includes/post-template.php
934 934 $walker = $r['walker']; 935 935 936 936 $args = array($pages, $depth, $r, $current_page); 937 return call_user_func_array(array( &$walker, 'walk'), $args);937 return call_user_func_array(array($walker, 'walk'), $args); 938 938 } 939 939 940 940 /** … … 951 951 else 952 952 $walker = $args[2]['walker']; 953 953 954 return call_user_func_array(array( &$walker, 'walk'), $args);954 return call_user_func_array(array($walker, 'walk'), $args); 955 955 } 956 956 957 957 /** -
wp-includes/nav-menu-template.php
469 469 $walker = ( empty($r->walker) ) ? new Walker_Nav_Menu : $r->walker; 470 470 $args = array( $items, $depth, $r ); 471 471 472 return call_user_func_array( array( &$walker, 'walk'), $args );472 return call_user_func_array( array($walker, 'walk'), $args ); 473 473 } 474 474 475 475 /** -
wp-includes/category.php
185 185 */ 186 186 function get_cat_name( $cat_id ) { 187 187 $cat_id = (int) $cat_id; 188 $category = &get_category( $cat_id );188 $category = get_category( $cat_id ); 189 189 if ( ! $category || is_wp_error( $category ) ) 190 190 return ''; 191 191 return $category->name; … … 319 319 */ 320 320 function _make_cat_compat( &$category ) { 321 321 if ( is_object( $category ) ) { 322 $category->cat_ID = &$category->term_id;323 $category->category_count = &$category->count;324 $category->category_description = &$category->description;325 $category->cat_name = &$category->name;326 $category->category_nicename = &$category->slug;327 $category->category_parent = &$category->parent;322 $category->cat_ID = $category->term_id; 323 $category->category_count = $category->count; 324 $category->category_description = $category->description; 325 $category->cat_name = $category->name; 326 $category->category_nicename = $category->slug; 327 $category->category_parent = $category->parent; 328 328 } elseif ( is_array( $category ) && isset( $category['term_id'] ) ) { 329 $category['cat_ID'] = &$category['term_id'];330 $category['category_count'] = &$category['count'];331 $category['category_description'] = &$category['description'];332 $category['cat_name'] = &$category['name'];333 $category['category_nicename'] = &$category['slug'];334 $category['category_parent'] = &$category['parent'];329 $category['cat_ID'] = $category['term_id']; 330 $category['category_count'] = $category['count']; 331 $category['category_description'] = $category['description']; 332 $category['cat_name'] = $category['name']; 333 $category['category_nicename'] = $category['slug']; 334 $category['category_parent'] = $category['parent']; 335 335 } 336 336 } -
wp-includes/taxonomy.php
1408 1408 if ( $child_of ) { 1409 1409 $children = _get_term_hierarchy($taxonomies[0]); 1410 1410 if ( ! empty($children) ) 1411 $terms = &_get_term_children($child_of, $terms, $taxonomies[0]);1411 $terms = _get_term_children($child_of, $terms, $taxonomies[0]); 1412 1412 } 1413 1413 1414 1414 // Update term counts to include children. … … 2981 2981 2982 2982 if ( !is_object($term) ) { 2983 2983 if ( is_int($term) ) { 2984 $term = &get_term($term, $taxonomy);2984 $term = get_term($term, $taxonomy); 2985 2985 } else { 2986 $term = &get_term_by('slug', $term, $taxonomy);2986 $term = get_term_by('slug', $term, $taxonomy); 2987 2987 } 2988 2988 } 2989 2989 -
wp-includes/class-http.php
1113 1113 } 1114 1114 1115 1115 if ( true === $r['blocking'] ) 1116 curl_setopt( $handle, CURLOPT_HEADERFUNCTION, array( &$this, 'stream_headers' ) );1116 curl_setopt( $handle, CURLOPT_HEADERFUNCTION, array( $this, 'stream_headers' ) ); 1117 1117 1118 1118 curl_setopt( $handle, CURLOPT_HEADER, false ); 1119 1119 -
wp-includes/post.php
3655 3655 update_post_cache( $pages ); 3656 3656 3657 3657 if ( $child_of || $hierarchical ) 3658 $pages = &get_page_children($child_of, $pages);3658 $pages = get_page_children($child_of, $pages); 3659 3659 3660 3660 if ( !empty($exclude_tree) ) { 3661 3661 $exclude = (int) $exclude_tree; -
wp-includes/default-widgets.php
536 536 parent::__construct('recent-posts', __('Recent Posts'), $widget_ops); 537 537 $this->alt_option_name = 'widget_recent_entries'; 538 538 539 add_action( 'save_post', array( &$this, 'flush_widget_cache') );540 add_action( 'deleted_post', array( &$this, 'flush_widget_cache') );541 add_action( 'switch_theme', array( &$this, 'flush_widget_cache') );539 add_action( 'save_post', array($this, 'flush_widget_cache') ); 540 add_action( 'deleted_post', array($this, 'flush_widget_cache') ); 541 add_action( 'switch_theme', array($this, 'flush_widget_cache') ); 542 542 } 543 543 544 544 function widget($args, $instance) { … … 626 626 $this->alt_option_name = 'widget_recent_comments'; 627 627 628 628 if ( is_active_widget(false, false, $this->id_base) ) 629 add_action( 'wp_head', array( &$this, 'recent_comments_style') );629 add_action( 'wp_head', array($this, 'recent_comments_style') ); 630 630 631 add_action( 'comment_post', array( &$this, 'flush_widget_cache') );632 add_action( 'transition_comment_status', array( &$this, 'flush_widget_cache') );631 add_action( 'comment_post', array($this, 'flush_widget_cache') ); 632 add_action( 'transition_comment_status', array($this, 'flush_widget_cache') ); 633 633 } 634 634 635 635 function recent_comments_style() { -
wp-includes/wp-diff.php
422 422 $chars2 = count_chars($string2); 423 423 424 424 // L1-norm of difference vector. 425 $difference = array_sum( array_map( array( &$this, 'difference'), $chars1, $chars2 ) );425 $difference = array_sum( array_map( array($this, 'difference'), $chars1, $chars2 ) ); 426 426 427 427 // $string1 has zero length? Odd. Give huge penalty by not dividing. 428 428 if ( !$string1 ) -
wp-includes/l10n.php
65 65 * @return string Translated text 66 66 */ 67 67 function translate( $text, $domain = 'default' ) { 68 $translations = &get_translations_for_domain( $domain );68 $translations = get_translations_for_domain( $domain ); 69 69 return apply_filters( 'gettext', $translations->translate( $text ), $text, $domain ); 70 70 } 71 71 … … 78 78 } 79 79 80 80 function translate_with_gettext_context( $text, $context, $domain = 'default' ) { 81 $translations = &get_translations_for_domain( $domain );81 $translations = get_translations_for_domain( $domain ); 82 82 return apply_filters( 'gettext_with_context', $translations->translate( $text, $context ), $text, $context, $domain ); 83 83 } 84 84 … … 236 236 * @return string Either $single or $plural translated text 237 237 */ 238 238 function _n( $single, $plural, $number, $domain = 'default' ) { 239 $translations = &get_translations_for_domain( $domain );239 $translations = get_translations_for_domain( $domain ); 240 240 $translation = $translations->translate_plural( $single, $plural, $number ); 241 241 return apply_filters( 'ngettext', $translation, $single, $plural, $number, $domain ); 242 242 } … … 249 249 * 250 250 */ 251 251 function _nx($single, $plural, $number, $context, $domain = 'default') { 252 $translations = &get_translations_for_domain( $domain );252 $translations = get_translations_for_domain( $domain ); 253 253 $translation = $translations->translate_plural( $single, $plural, $number, $context ); 254 254 return apply_filters( 'ngettext_with_context', $translation, $single, $plural, $number, $context, $domain ); 255 255 } -
wp-includes/comment-template.php
894 894 update_comment_cache($wp_query->comments); 895 895 896 896 if ( $separate_comments ) { 897 $wp_query->comments_by_type = &separate_comments($comments);897 $wp_query->comments_by_type = separate_comments($comments); 898 898 $comments_by_type = &$wp_query->comments_by_type; 899 899 } 900 900 … … 1428 1428 if ( empty($comments) ) 1429 1429 return; 1430 1430 if ( 'all' != $r['type'] ) { 1431 $comments_by_type = &separate_comments($comments);1431 $comments_by_type = separate_comments($comments); 1432 1432 if ( empty($comments_by_type[$r['type']]) ) 1433 1433 return; 1434 1434 $_comments = $comments_by_type[$r['type']]; … … 1440 1440 return; 1441 1441 if ( 'all' != $r['type'] ) { 1442 1442 if ( empty($wp_query->comments_by_type) ) 1443 $wp_query->comments_by_type = &separate_comments($wp_query->comments);1443 $wp_query->comments_by_type = separate_comments($wp_query->comments); 1444 1444 if ( empty($wp_query->comments_by_type[$r['type']]) ) 1445 1445 return; 1446 1446 $_comments = $wp_query->comments_by_type[$r['type']]; -
wp-includes/media.php
1054 1054 */ 1055 1055 function __construct() { 1056 1056 // Hack to get the [embed] shortcode to run before wpautop() 1057 add_filter( 'the_content', array( &$this, 'run_shortcode'), 8 );1057 add_filter( 'the_content', array($this, 'run_shortcode'), 8 ); 1058 1058 1059 1059 // Shortcode placeholder for strip_shortcodes() 1060 1060 add_shortcode( 'embed', '__return_false' ); 1061 1061 1062 1062 // Attempts to embed all URLs in a post 1063 1063 if ( get_option('embed_autourls') ) 1064 add_filter( 'the_content', array( &$this, 'autoembed'), 8 );1064 add_filter( 'the_content', array($this, 'autoembed'), 8 ); 1065 1065 1066 1066 // After a post is saved, invalidate the oEmbed cache 1067 add_action( 'save_post', array( &$this, 'delete_oembed_caches') );1067 add_action( 'save_post', array($this, 'delete_oembed_caches') ); 1068 1068 1069 1069 // After a post is saved, cache oEmbed items via AJAX 1070 add_action( 'edit_form_advanced', array( &$this, 'maybe_run_ajax_cache') );1070 add_action( 'edit_form_advanced', array($this, 'maybe_run_ajax_cache') ); 1071 1071 } 1072 1072 1073 1073 /** … … 1092 1092 $orig_shortcode_tags = $shortcode_tags; 1093 1093 remove_all_shortcodes(); 1094 1094 1095 add_shortcode( 'embed', array( &$this, 'shortcode') );1095 add_shortcode( 'embed', array($this, 'shortcode') ); 1096 1096 1097 1097 // Do the shortcode (only the [embed] one is registered) 1098 1098 $content = do_shortcode( $content ); … … 1282 1282 * @return string Potentially modified $content. 1283 1283 */ 1284 1284 function autoembed( $content ) { 1285 return preg_replace_callback( '|^\s*(https?://[^\s"]+)\s*$|im', array( &$this, 'autoembed_callback'), $content );1285 return preg_replace_callback( '|^\s*(https?://[^\s"]+)\s*$|im', array($this, 'autoembed_callback'), $content ); 1286 1286 } 1287 1287 1288 1288 /** -
wp-includes/cache.php
623 623 * @todo This should be moved to the PHP4 style constructor, PHP5 624 624 * already calls __destruct() 625 625 */ 626 register_shutdown_function( array( &$this, '__destruct' ) );626 register_shutdown_function( array( $this, '__destruct' ) ); 627 627 } 628 628 629 629 /** -
wp-includes/link-template.php
974 974 * @return string 975 975 */ 976 976 function get_edit_comment_link( $comment_id = 0 ) { 977 $comment = &get_comment( $comment_id );977 $comment = get_comment( $comment_id ); 978 978 979 979 if ( !current_user_can( 'edit_comment', $comment->comment_ID ) ) 980 980 return; -
wp-includes/wp-db.php
534 534 * @param string $dbhost MySQL database host 535 535 */ 536 536 function __construct( $dbuser, $dbpassword, $dbname, $dbhost ) { 537 register_shutdown_function( array( &$this, '__destruct' ) );537 register_shutdown_function( array( $this, '__destruct' ) ); 538 538 539 539 if ( WP_DEBUG ) 540 540 $this->show_errors(); … … 1000 1000 $query = str_replace( '"%s"', '%s', $query ); // doublequote unquoting 1001 1001 $query = str_replace( '%f' , '%F', $query ); // Force floats to be locale unaware 1002 1002 $query = preg_replace( '|(?<!%)%s|', "'%s'", $query ); // quote the strings, avoiding escaped strings like %%s 1003 array_walk( $args, array( &$this, 'escape_by_ref' ) );1003 array_walk( $args, array( $this, 'escape_by_ref' ) ); 1004 1004 return @vsprintf( $query, $args ); 1005 1005 } 1006 1006 -
wp-includes/class-wp-walker.php
126 126 if ( is_array( $args[0] ) ) 127 127 $args[0]['has_children'] = ! empty( $children_elements[$element->$id_field] ); 128 128 $cb_args = array_merge( array(&$output, $element, $depth), $args); 129 call_user_func_array(array( &$this, 'start_el'), $cb_args);129 call_user_func_array(array($this, 'start_el'), $cb_args); 130 130 131 131 $id = $element->$id_field; 132 132 … … 139 139 $newlevel = true; 140 140 //start the child delimiter 141 141 $cb_args = array_merge( array(&$output, $depth), $args); 142 call_user_func_array(array( &$this, 'start_lvl'), $cb_args);142 call_user_func_array(array($this, 'start_lvl'), $cb_args); 143 143 } 144 144 $this->display_element( $child, $children_elements, $max_depth, $depth + 1, $args, $output ); 145 145 } … … 149 149 if ( isset($newlevel) && $newlevel ){ 150 150 //end the child delimiter 151 151 $cb_args = array_merge( array(&$output, $depth), $args); 152 call_user_func_array(array( &$this, 'end_lvl'), $cb_args);152 call_user_func_array(array($this, 'end_lvl'), $cb_args); 153 153 } 154 154 155 155 //end this element 156 156 $cb_args = array_merge( array(&$output, $element, $depth), $args); 157 call_user_func_array(array( &$this, 'end_el'), $cb_args);157 call_user_func_array(array($this, 'end_el'), $cb_args); 158 158 } 159 159 160 160 /** -
wp-includes/class-wp.php
604 604 * @return string 605 605 */ 606 606 function _map() { 607 $callback = array( &$this, 'callback');607 $callback = array($this, 'callback'); 608 608 return preg_replace_callback($this->_pattern, $callback, $this->_subject); 609 609 } 610 610 -
wp-includes/capabilities.php
725 725 726 726 //Filter out caps that are not role names and assign to $this->roles 727 727 if ( is_array( $this->caps ) ) 728 $this->roles = array_filter( array_keys( $this->caps ), array( &$wp_roles, 'is_role' ) );728 $this->roles = array_filter( array_keys( $this->caps ), array( $wp_roles, 'is_role' ) ); 729 729 730 730 //Build $allcaps from role caps, overlay user's $caps 731 731 $this->allcaps = array(); … … 1317 1317 $args = array_slice( func_get_args(), 2 ); 1318 1318 $args = array_merge( array( $capability ), $args ); 1319 1319 1320 return call_user_func_array( array( &$author, 'has_cap' ), $args );1320 return call_user_func_array( array( $author, 'has_cap' ), $args ); 1321 1321 } 1322 1322 1323 1323 /** … … 1339 1339 $args = array_slice( func_get_args(), 2 ); 1340 1340 $args = array_merge( array( $capability ), $args ); 1341 1341 1342 return call_user_func_array( array( &$user, 'has_cap' ), $args );1342 return call_user_func_array( array( $user, 'has_cap' ), $args ); 1343 1343 } 1344 1344 1345 1345 /** -
wp-includes/class-oembed.php
51 51 ) ); 52 52 53 53 // Fix any embeds that contain new lines in the middle of the HTML which breaks wpautop(). 54 add_filter( 'oembed_dataparse', array( &$this, '_strip_newlines'), 10, 3 );54 add_filter( 'oembed_dataparse', array($this, '_strip_newlines'), 10, 3 ); 55 55 } 56 56 57 57 /** -
wp-includes/widgets.php
152 152 } 153 153 154 154 function _get_display_callback() { 155 return array( &$this, 'display_callback');155 return array($this, 'display_callback'); 156 156 } 157 157 158 158 function _get_update_callback() { 159 return array( &$this, 'update_callback');159 return array($this, 'update_callback'); 160 160 } 161 161 162 162 function _get_form_callback() { 163 return array( &$this, 'form_callback');163 return array($this, 'form_callback'); 164 164 } 165 165 166 166 /** Generate the actual widget content. … … 317 317 var $widgets = array(); 318 318 319 319 function WP_Widget_Factory() { 320 add_action( 'widgets_init', array( &$this, '_register_widgets' ), 100 );320 add_action( 'widgets_init', array( $this, '_register_widgets' ), 100 ); 321 321 } 322 322 323 323 function register($widget_class) { -
wp-includes/category-template.php
41 41 */ 42 42 function get_category_parents( $id, $link = false, $separator = '/', $nicename = false, $visited = array() ) { 43 43 $chain = ''; 44 $parent = &get_category( $id );44 $parent = get_category( $id ); 45 45 if ( is_wp_error( $parent ) ) 46 46 return $parent; 47 47 … … 135 135 */ 136 136 function get_the_category_by_ID( $cat_ID ) { 137 137 $cat_ID = (int) $cat_ID; 138 $category = &get_category( $cat_ID );138 $category = get_category( $cat_ID ); 139 139 if ( is_wp_error( $category ) ) 140 140 return $category; 141 141 return $category->name; … … 735 735 else 736 736 $walker = $args[2]['walker']; 737 737 738 return call_user_func_array(array( &$walker, 'walk' ), $args );738 return call_user_func_array(array( $walker, 'walk' ), $args ); 739 739 } 740 740 741 741 /** … … 753 753 else 754 754 $walker = $args[2]['walker']; 755 755 756 return call_user_func_array(array( &$walker, 'walk' ), $args );756 return call_user_func_array(array( $walker, 'walk' ), $args ); 757 757 } 758 758 759 759 /** -
wp-admin/includes/ajax-actions.php
331 331 $term_id = $parent->term_id; 332 332 333 333 while ( $parent->parent ) { // get the top parent 334 $parent = &get_term( $parent->parent, $taxonomy->name );334 $parent = get_term( $parent->parent, $taxonomy->name ); 335 335 if ( is_wp_error( $parent ) ) 336 336 break; 337 337 $term_id = $parent->term_id;