Make WordPress Core

Ticket #25160: 25160.3.patch

File 25160.3.patch, 46.2 KB (added by jdgrimes, 11 years ago)

Cleaning last patch.

  • src/wp-admin/custom-background.php

     
    6767                if ( ! current_user_can('edit_theme_options') )
    6868                        return;
    6969
    70                 $this->page = $page = add_theme_page(__('Background'), __('Background'), 'edit_theme_options', 'custom-background', array(&$this, 'admin_page'));
     70                $this->page = $page = add_theme_page(__('Background'), __('Background'), 'edit_theme_options', 'custom-background', array($this, 'admin_page'));
    7171
    72                 add_action("load-$page", array(&$this, 'admin_load'));
    73                 add_action("load-$page", array(&$this, 'take_action'), 49);
    74                 add_action("load-$page", array(&$this, 'handle_upload'), 49);
     72                add_action("load-$page", array($this, 'admin_load'));
     73                add_action("load-$page", array($this, 'take_action'), 49);
     74                add_action("load-$page", array($this, 'handle_upload'), 49);
    7575
    7676                if ( $this->admin_header_callback )
    7777                        add_action("admin_head-$page", $this->admin_header_callback, 51);
  • src/wp-admin/custom-header.php

     
    8484                if ( ! current_user_can('edit_theme_options') )
    8585                        return;
    8686
    87                 $this->page = $page = add_theme_page(__('Header'), __('Header'), 'edit_theme_options', 'custom-header', array(&$this, 'admin_page'));
     87                $this->page = $page = add_theme_page(__('Header'), __('Header'), 'edit_theme_options', 'custom-header', array($this, 'admin_page'));
    8888
    89                 add_action("admin_print_scripts-$page", array(&$this, 'js_includes'));
    90                 add_action("admin_print_styles-$page", array(&$this, 'css_includes'));
    91                 add_action("admin_head-$page", array(&$this, 'help') );
    92                 add_action("admin_head-$page", array(&$this, 'take_action'), 50);
    93                 add_action("admin_head-$page", array(&$this, 'js'), 50);
     89                add_action("admin_print_scripts-$page", array($this, 'js_includes'));
     90                add_action("admin_print_styles-$page", array($this, 'css_includes'));
     91                add_action("admin_head-$page", array($this, 'help') );
     92                add_action("admin_head-$page", array($this, 'take_action'), 50);
     93                add_action("admin_head-$page", array($this, 'js'), 50);
    9494                if ( $this->admin_header_callback )
    9595                        add_action("admin_head-$page", $this->admin_header_callback, 51);
    9696        }
  • src/wp-admin/includes/class-wp-importer.php

     
    179179         */
    180180        function get_page( $url, $username = '', $password = '', $head = false ) {
    181181                // Increase the timeout
    182                 add_filter( 'http_request_timeout', array( &$this, 'bump_request_timeout' ) );
     182                add_filter( 'http_request_timeout', array( $this, 'bump_request_timeout' ) );
    183183
    184184                $headers = array();
    185185                $args = array();
  • src/wp-admin/includes/class-wp-list-table.php

     
    8787
    8888                $this->screen = convert_to_screen( $args['screen'] );
    8989
    90                 add_filter( "manage_{$this->screen->id}_columns", array( &$this, 'get_columns' ), 0 );
     90                add_filter( "manage_{$this->screen->id}_columns", array( $this, 'get_columns' ), 0 );
    9191
    9292                if ( !$args['plural'] )
    9393                        $args['plural'] = $this->screen->base;
     
    9999
    100100                if ( $args['ajax'] ) {
    101101                        // wp_enqueue_script( 'list-table' );
    102                         add_action( 'admin_footer', array( &$this, '_js_vars' ) );
     102                        add_action( 'admin_footer', array( $this, '_js_vars' ) );
    103103                }
    104104        }
    105105
     
    857857                        }
    858858                        elseif ( method_exists( $this, 'column_' . $column_name ) ) {
    859859                                echo "<td $attributes>";
    860                                 echo call_user_func( array( &$this, 'column_' . $column_name ), $item );
     860                                echo call_user_func( array( $this, 'column_' . $column_name ), $item );
    861861                                echo "</td>";
    862862                        }
    863863                        else {
  • src/wp-admin/includes/class-wp-ms-themes-list-table.php

     
    8484
    8585                if ( $s ) {
    8686                        $status = 'search';
    87                         $themes['search'] = array_filter( array_merge( $themes['all'], $themes['broken'] ), array( &$this, '_search_callback' ) );
     87                        $themes['search'] = array_filter( array_merge( $themes['all'], $themes['broken'] ), array( $this, '_search_callback' ) );
    8888                }
    8989
    9090                $totals = array();
     
    108108                                if ( 'ASC' == $order )
    109109                                        $this->items = array_reverse( $this->items );
    110110                        } else {
    111                                 uasort( $this->items, array( &$this, '_order_callback' ) );
     111                                uasort( $this->items, array( $this, '_order_callback' ) );
    112112                        }
    113113                }
    114114
  • src/wp-admin/includes/class-wp-plugins-list-table.php

     
    9999
    100100                if ( $s ) {
    101101                        $status = 'search';
    102                         $plugins['search'] = array_filter( $plugins['all'], array( &$this, '_search_callback' ) );
     102                        $plugins['search'] = array_filter( $plugins['all'], array( $this, '_search_callback' ) );
    103103                }
    104104
    105105                $totals = array();
     
    121121                        $orderby = ucfirst( $orderby );
    122122                        $order = strtoupper( $order );
    123123
    124                         uasort( $this->items, array( &$this, '_order_callback' ) );
     124                        uasort( $this->items, array( $this, '_order_callback' ) );
    125125                }
    126126
    127127                $plugins_per_page = $this->get_items_per_page( str_replace( '-', '_', $screen->id . '_per_page' ), 999 );
  • src/wp-admin/includes/class-wp-upgrader.php

     
    402402                $this->init();
    403403                $this->install_strings();
    404404
    405                 add_filter('upgrader_source_selection', array(&$this, 'check_package') );
     405                add_filter('upgrader_source_selection', array($this, 'check_package') );
    406406
    407407                $this->run(array(
    408408                                        'package' => $package,
     
    412412                                        'hook_extra' => array()
    413413                                        ));
    414414
    415                 remove_filter('upgrader_source_selection', array(&$this, 'check_package') );
     415                remove_filter('upgrader_source_selection', array($this, 'check_package') );
    416416
    417417                if ( ! $this->result || is_wp_error($this->result) )
    418418                        return $this->result;
     
    442442                // Get the URL to the zip file
    443443                $r = $current->response[ $plugin ];
    444444
    445                 add_filter('upgrader_pre_install', array(&$this, 'deactivate_plugin_before_upgrade'), 10, 2);
    446                 add_filter('upgrader_clear_destination', array(&$this, 'delete_old_plugin'), 10, 4);
    447                 //'source_selection' => array(&$this, 'source_selection'), //there's a trac ticket to move up the directory for zip's which are made a bit differently, useful for non-.org plugins.
     445                add_filter('upgrader_pre_install', array($this, 'deactivate_plugin_before_upgrade'), 10, 2);
     446                add_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'), 10, 4);
     447                //'source_selection' => array($this, 'source_selection'), //there's a trac ticket to move up the directory for zip's which are made a bit differently, useful for non-.org plugins.
    448448
    449449                $this->run(array(
    450450                                        'package' => $r->package,
     
    457457                                ));
    458458
    459459                // Cleanup our hooks, in case something else does a upgrade on this connection.
    460                 remove_filter('upgrader_pre_install', array(&$this, 'deactivate_plugin_before_upgrade'));
    461                 remove_filter('upgrader_clear_destination', array(&$this, 'delete_old_plugin'));
     460                remove_filter('upgrader_pre_install', array($this, 'deactivate_plugin_before_upgrade'));
     461                remove_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'));
    462462
    463463                if ( ! $this->result || is_wp_error($this->result) )
    464464                        return $this->result;
     
    477477
    478478                $current = get_site_transient( 'update_plugins' );
    479479
    480                 add_filter('upgrader_clear_destination', array(&$this, 'delete_old_plugin'), 10, 4);
     480                add_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'), 10, 4);
    481481
    482482                $this->skin->header();
    483483
     
    547547                $this->skin->footer();
    548548
    549549                // Cleanup our hooks, in case something else does a upgrade on this connection.
    550                 remove_filter('upgrader_clear_destination', array(&$this, 'delete_old_plugin'));
     550                remove_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'));
    551551
    552552                // Force refresh of plugin update information
    553553                delete_site_transient('update_plugins');
     
    711711                if ( ! $api || is_wp_error($api) ) {
    712712                        $this->skin->feedback( 'parent_theme_not_found', $theme_info->get('Template') );
    713713                        // Don't show activate or preview actions after install
    714                         add_filter('install_theme_complete_actions', array(&$this, 'hide_activate_preview_actions') );
     714                        add_filter('install_theme_complete_actions', array($this, 'hide_activate_preview_actions') );
    715715                        return $install_result;
    716716                }
    717717
     
    736736                ) );
    737737
    738738                if ( is_wp_error($parent_result) )
    739                         add_filter('install_theme_complete_actions', array(&$this, 'hide_activate_preview_actions') );
     739                        add_filter('install_theme_complete_actions', array($this, 'hide_activate_preview_actions') );
    740740
    741741                // Start cleaning up after the parents installation
    742742                remove_filter('install_theme_complete_actions', '__return_false', 999);
     
    759759                $this->init();
    760760                $this->install_strings();
    761761
    762                 add_filter('upgrader_source_selection', array(&$this, 'check_package') );
    763                 add_filter('upgrader_post_install', array(&$this, 'check_parent_theme_filter'), 10, 3);
     762                add_filter('upgrader_source_selection', array($this, 'check_package') );
     763                add_filter('upgrader_post_install', array($this, 'check_parent_theme_filter'), 10, 3);
    764764
    765765                $options = array(
    766766                        'package' => $package,
     
    771771
    772772                $this->run($options);
    773773
    774                 remove_filter('upgrader_source_selection', array(&$this, 'check_package') );
    775                 remove_filter('upgrader_post_install', array(&$this, 'check_parent_theme_filter'));
     774                remove_filter('upgrader_source_selection', array($this, 'check_package') );
     775                remove_filter('upgrader_post_install', array($this, 'check_parent_theme_filter'));
    776776
    777777                if ( ! $this->result || is_wp_error($this->result) )
    778778                        return $this->result;
     
    801801
    802802                $r = $current->response[ $theme ];
    803803
    804                 add_filter('upgrader_pre_install', array(&$this, 'current_before'), 10, 2);
    805                 add_filter('upgrader_post_install', array(&$this, 'current_after'), 10, 2);
    806                 add_filter('upgrader_clear_destination', array(&$this, 'delete_old_theme'), 10, 4);
     804                add_filter('upgrader_pre_install', array($this, 'current_before'), 10, 2);
     805                add_filter('upgrader_post_install', array($this, 'current_after'), 10, 2);
     806                add_filter('upgrader_clear_destination', array($this, 'delete_old_theme'), 10, 4);
    807807
    808808                $options = array(
    809809                        'package' => $r['package'],
     
    817817
    818818                $this->run($options);
    819819
    820                 remove_filter('upgrader_pre_install', array(&$this, 'current_before'));
    821                 remove_filter('upgrader_post_install', array(&$this, 'current_after'));
    822                 remove_filter('upgrader_clear_destination', array(&$this, 'delete_old_theme'));
     820                remove_filter('upgrader_pre_install', array($this, 'current_before'));
     821                remove_filter('upgrader_post_install', array($this, 'current_after'));
     822                remove_filter('upgrader_clear_destination', array($this, 'delete_old_theme'));
    823823
    824824                if ( ! $this->result || is_wp_error($this->result) )
    825825                        return $this->result;
     
    839839
    840840                $current = get_site_transient( 'update_themes' );
    841841
    842                 add_filter('upgrader_pre_install', array(&$this, 'current_before'), 10, 2);
    843                 add_filter('upgrader_post_install', array(&$this, 'current_after'), 10, 2);
    844                 add_filter('upgrader_clear_destination', array(&$this, 'delete_old_theme'), 10, 4);
     842                add_filter('upgrader_pre_install', array($this, 'current_before'), 10, 2);
     843                add_filter('upgrader_post_install', array($this, 'current_after'), 10, 2);
     844                add_filter('upgrader_clear_destination', array($this, 'delete_old_theme'), 10, 4);
    845845
    846846                $this->skin->header();
    847847
     
    911911                $this->skin->footer();
    912912
    913913                // Cleanup our hooks, in case something else does a upgrade on this connection.
    914                 remove_filter('upgrader_pre_install', array(&$this, 'current_before'));
    915                 remove_filter('upgrader_post_install', array(&$this, 'current_after'));
    916                 remove_filter('upgrader_clear_destination', array(&$this, 'delete_old_theme'));
     914                remove_filter('upgrader_pre_install', array($this, 'current_before'));
     915                remove_filter('upgrader_post_install', array($this, 'current_after'));
     916                remove_filter('upgrader_clear_destination', array($this, 'delete_old_theme'));
    917917
    918918                // Force refresh of theme update information
    919919                wp_clean_themes_cache();
  • src/wp-admin/includes/deprecated.php

     
    519519                        $this->query_where .= " AND $wpdb->users.ID = $wpdb->usermeta.user_id AND meta_key = '{$level_key}'";
    520520                }
    521521
    522                 do_action_ref_array( 'pre_user_search', array( &$this ) );
     522                do_action( 'pre_user_search', $this );
    523523        }
    524524
    525525        /**
  • src/wp-admin/includes/list-table.php

     
    9595
    9696                if ( !empty( $columns ) ) {
    9797                        $this->_columns = $columns;
    98                         add_filter( 'manage_' . $screen->id . '_columns', array( &$this, 'get_columns' ), 0 );
     98                        add_filter( 'manage_' . $screen->id . '_columns', array( $this, 'get_columns' ), 0 );
    9999                }
    100100        }
    101101
  • src/wp-includes/class-wp.php

     
    305305
    306306                $this->query_vars = apply_filters('request', $this->query_vars);
    307307
    308                 do_action_ref_array('parse_request', array(&$this));
     308                do_action( 'parse_request', $this );
    309309        }
    310310
    311311        /**
     
    404404                if ( $exit_required )
    405405                        exit();
    406406
    407                 do_action_ref_array('send_headers', array(&$this));
     407                do_action( 'send_headers', $this );
    408408        }
    409409
    410410        /**
     
    549549                $this->query_posts();
    550550                $this->handle_404();
    551551                $this->register_globals();
    552                 do_action_ref_array('wp', array(&$this));
     552                do_action( 'wp', $this );
    553553        }
    554554
    555555}
  • src/wp-includes/class.wp-styles.php

     
    2929        var $default_dirs;
    3030
    3131        function __construct() {
    32                 do_action_ref_array( 'wp_default_styles', array(&$this) );
     32                do_action( 'wp_default_styles', $this );
    3333        }
    3434
    3535        function do_item( $handle ) {
  • src/wp-includes/comment.php

     
    251251                $this->meta_query = new WP_Meta_Query();
    252252                $this->meta_query->parse_query_vars( $this->query_vars );
    253253
    254                 do_action_ref_array( 'pre_get_comments', array( &$this ) );
     254                do_action( 'pre_get_comments', $this );
    255255                extract( $this->query_vars, EXTR_SKIP );
    256256
    257257                // $args can be whatever, only use the args defined in defaults to compute the key
     
    376376                }
    377377
    378378                $pieces = array( 'fields', 'join', 'where', 'orderby', 'order', 'limits', 'groupby' );
    379                 $clauses = apply_filters_ref_array( 'comments_clauses', array( compact( $pieces ), &$this ) );
     379                $clauses = apply_filters( 'comments_clauses', compact( $pieces ), $this );
    380380                foreach ( $pieces as $piece )
    381381                        $$piece = isset( $clauses[ $piece ] ) ? $clauses[ $piece ] : '';
    382382
     
    389389                        return $wpdb->get_var( $query );
    390390
    391391                $comments = $wpdb->get_results( $query );
    392                 $comments = apply_filters_ref_array( 'the_comments', array( $comments, &$this ) );
     392                $comments = apply_filters( 'the_comments', $comments, $this );
    393393
    394394                wp_cache_add( $cache_key, $comments, 'comment' );
    395395
  • src/wp-includes/query.php

     
    16821682                $this->query_vars_hash = md5( serialize( $this->query_vars ) );
    16831683                $this->query_vars_changed = false;
    16841684
    1685                 do_action_ref_array('parse_query', array(&$this));
     1685                do_action( 'parse_query', $this );
    16861686        }
    16871687
    16881688        /*
     
    19301930
    19311931                $this->parse_query();
    19321932
    1933                 do_action_ref_array('pre_get_posts', array(&$this));
     1933                do_action( 'pre_get_posts', $this );
    19341934
    19351935                // Shorthand.
    19361936                $q = &$this->query_vars;
     
    22382238                }
    22392239
    22402240                // Allow plugins to contextually add/remove/modify the search section of the database query
    2241                 $search = apply_filters_ref_array('posts_search', array( $search, &$this ) );
     2241                $search = apply_filters( 'posts_search', $search, $this );
    22422242
    22432243                // Taxonomies
    22442244                if ( !$this->is_singular ) {
     
    25622562                // Apply filters on where and join prior to paging so that any
    25632563                // manipulations to them are reflected in the paging by day queries.
    25642564                if ( !$q['suppress_filters'] ) {
    2565                         $where = apply_filters_ref_array('posts_where', array( $where, &$this ) );
    2566                         $join = apply_filters_ref_array('posts_join', array( $join, &$this ) );
     2565                        $where = apply_filters( 'posts_where', $where, $this );
     2566                        $join = apply_filters('posts_join', $join, $this );
    25672567                }
    25682568
    25692569                // Paging
     
    25942594                        }
    25952595
    25962596                        if ( !$q['suppress_filters'] ) {
    2597                                 $cjoin = apply_filters_ref_array('comment_feed_join', array( $cjoin, &$this ) );
    2598                                 $cwhere = apply_filters_ref_array('comment_feed_where', array( $cwhere, &$this ) );
    2599                                 $cgroupby = apply_filters_ref_array('comment_feed_groupby', array( $cgroupby, &$this ) );
    2600                                 $corderby = apply_filters_ref_array('comment_feed_orderby', array( 'comment_date_gmt DESC', &$this ) );
    2601                                 $climits = apply_filters_ref_array('comment_feed_limits', array( 'LIMIT ' . get_option('posts_per_rss'), &$this ) );
     2597                                $cjoin = apply_filters( 'comment_feed_join', $cjoin, $this );
     2598                                $cwhere = apply_filters( 'comment_feed_where', $cwhere, $this );
     2599                                $cgroupby = apply_filters( 'comment_feed_groupby', $cgroupby, $this );
     2600                                $corderby = apply_filters( 'comment_feed_orderby', 'comment_date_gmt DESC', $this );
     2601                                $climits = apply_filters( 'comment_feed_limits', 'LIMIT ' . get_option('posts_per_rss'), $this );
    26022602                        }
    26032603                        $cgroupby = ( ! empty( $cgroupby ) ) ? 'GROUP BY ' . $cgroupby : '';
    26042604                        $corderby = ( ! empty( $corderby ) ) ? 'ORDER BY ' . $corderby : '';
     
    26242624                // Apply post-paging filters on where and join. Only plugins that
    26252625                // manipulate paging queries should use these hooks.
    26262626                if ( !$q['suppress_filters'] ) {
    2627                         $where          = apply_filters_ref_array( 'posts_where_paged', array( $where, &$this ) );
    2628                         $groupby        = apply_filters_ref_array( 'posts_groupby',             array( $groupby, &$this ) );
    2629                         $join           = apply_filters_ref_array( 'posts_join_paged',  array( $join, &$this ) );
    2630                         $orderby        = apply_filters_ref_array( 'posts_orderby',             array( $orderby, &$this ) );
    2631                         $distinct       = apply_filters_ref_array( 'posts_distinct',    array( $distinct, &$this ) );
    2632                         $limits         = apply_filters_ref_array( 'post_limits',               array( $limits, &$this ) );
    2633                         $fields         = apply_filters_ref_array( 'posts_fields',              array( $fields, &$this ) );
     2627                        $where          = apply_filters( 'posts_where_paged',   $where, $this );
     2628                        $groupby        = apply_filters( 'posts_groupby',               $groupby, $this );
     2629                        $join           = apply_filters( 'posts_join_paged',    $join, $this );
     2630                        $orderby        = apply_filters( 'posts_orderby',               $orderby, $this );
     2631                        $distinct       = apply_filters( 'posts_distinct',          $distinct, $this );
     2632                        $limits         = apply_filters( 'post_limits',                 $limits, $this );
     2633                        $fields         = apply_filters( 'posts_fields',                $fields, $this );
    26342634
    26352635                        // Filter all clauses at once, for convenience
    2636                         $clauses = (array) apply_filters_ref_array( 'posts_clauses', array( compact( $pieces ), &$this ) );
     2636                        $clauses = (array) apply_filters( 'posts_clauses', compact( $pieces ), $this );
    26372637                        foreach ( $pieces as $piece )
    26382638                                $$piece = isset( $clauses[ $piece ] ) ? $clauses[ $piece ] : '';
    26392639                }
     
    26432643
    26442644                // Filter again for the benefit of caching plugins. Regular plugins should use the hooks above.
    26452645                if ( !$q['suppress_filters'] ) {
    2646                         $where          = apply_filters_ref_array( 'posts_where_request',               array( $where, &$this ) );
    2647                         $groupby        = apply_filters_ref_array( 'posts_groupby_request',             array( $groupby, &$this ) );
    2648                         $join           = apply_filters_ref_array( 'posts_join_request',                array( $join, &$this ) );
    2649                         $orderby        = apply_filters_ref_array( 'posts_orderby_request',             array( $orderby, &$this ) );
    2650                         $distinct       = apply_filters_ref_array( 'posts_distinct_request',    array( $distinct, &$this ) );
    2651                         $fields         = apply_filters_ref_array( 'posts_fields_request',              array( $fields, &$this ) );
    2652                         $limits         = apply_filters_ref_array( 'post_limits_request',               array( $limits, &$this ) );
     2646                        $where          = apply_filters( 'posts_where_request',         $where, $this );
     2647                        $groupby        = apply_filters( 'posts_groupby_request',       $groupby, $this );
     2648                        $join           = apply_filters( 'posts_join_request',          $join, $this );
     2649                        $orderby        = apply_filters( 'posts_orderby_request',       $orderby, $this );
     2650                        $distinct       = apply_filters( 'posts_distinct_request',      $distinct, $this );
     2651                        $fields         = apply_filters( 'posts_fields_request',        $fields, $this );
     2652                        $limits         = apply_filters( 'post_limits_request',         $limits, $this );
    26532653
    26542654                        // Filter all clauses at once, for convenience
    2655                         $clauses = (array) apply_filters_ref_array( 'posts_clauses_request', array( compact( $pieces ), &$this ) );
     2655                        $clauses = (array) apply_filters( 'posts_clauses_request', compact( $pieces ), $this );
    26562656                        foreach ( $pieces as $piece )
    26572657                                $$piece = isset( $clauses[ $piece ] ) ? $clauses[ $piece ] : '';
    26582658                }
     
    26692669                $this->request = $old_request = "SELECT $found_rows $distinct $fields FROM $wpdb->posts $join WHERE 1=1 $where $groupby $orderby $limits";
    26702670
    26712671                if ( !$q['suppress_filters'] ) {
    2672                         $this->request = apply_filters_ref_array( 'posts_request', array( $this->request, &$this ) );
     2672                        $this->request = apply_filters( 'posts_request', $this->request, $this );
    26732673                }
    26742674
    26752675                if ( 'ids' == $q['fields'] ) {
     
    27222722
    27232723                // Raw results filter. Prior to status checks.
    27242724                if ( !$q['suppress_filters'] )
    2725                         $this->posts = apply_filters_ref_array('posts_results', array( $this->posts, &$this ) );
     2725                        $this->posts = apply_filters( 'posts_results', $this->posts, $this );
    27262726
    27272727                if ( !empty($this->posts) && $this->is_comment_feed && $this->is_singular ) {
    2728                         $cjoin = apply_filters_ref_array('comment_feed_join', array( '', &$this ) );
    2729                         $cwhere = apply_filters_ref_array('comment_feed_where', array( "WHERE comment_post_ID = '{$this->posts[0]->ID}' AND comment_approved = '1'", &$this ) );
    2730                         $cgroupby = apply_filters_ref_array('comment_feed_groupby', array( '', &$this ) );
     2728                        $cjoin    = apply_filters( 'comment_feed_join', '', $this );
     2729                        $cwhere   = apply_filters( 'comment_feed_where', "WHERE comment_post_ID = '{$this->posts[0]->ID}' AND comment_approved = '1'", $this );
     2730                        $cgroupby = apply_filters( 'comment_feed_groupby', '', $this );
    27312731                        $cgroupby = ( ! empty( $cgroupby ) ) ? 'GROUP BY ' . $cgroupby : '';
    2732                         $corderby = apply_filters_ref_array('comment_feed_orderby', array( 'comment_date_gmt DESC', &$this ) );
     2732                        $corderby = apply_filters( 'comment_feed_orderby', 'comment_date_gmt DESC', $this );
    27332733                        $corderby = ( ! empty( $corderby ) ) ? 'ORDER BY ' . $corderby : '';
    2734                         $climits = apply_filters_ref_array('comment_feed_limits', array( 'LIMIT ' . get_option('posts_per_rss'), &$this ) );
     2734                        $climits  = apply_filters( 'comment_feed_limits', 'LIMIT ' . get_option('posts_per_rss'), $this );
    27352735                        $comments_request = "SELECT $wpdb->comments.* FROM $wpdb->comments $cjoin $cwhere $cgroupby $corderby $climits";
    27362736                        $this->comments = $wpdb->get_results($comments_request);
    27372737                        $this->comment_count = count($this->comments);
     
    27662766                        }
    27672767
    27682768                        if ( $this->is_preview && $this->posts && current_user_can( $edit_cap, $this->posts[0]->ID ) )
    2769                                 $this->posts[0] = get_post( apply_filters_ref_array( 'the_preview', array( $this->posts[0], &$this ) ) );
     2769                                $this->posts[0] = get_post( apply_filters( 'the_preview', $this->posts[0], $this ) );
    27702770                }
    27712771
    27722772                // Put sticky posts at the top of the posts array
     
    28112811                }
    28122812
    28132813                if ( !$q['suppress_filters'] )
    2814                         $this->posts = apply_filters_ref_array('the_posts', array( $this->posts, &$this ) );
     2814                        $this->posts = apply_filters( 'the_posts', $this->posts, $this );
    28152815
    28162816                // Ensure that any posts added/modified via one of the filters above are
    28172817                // of the type WP_Post and are filtered.
     
    28482848                        return;
    28492849
    28502850                if ( ! empty( $limits ) )
    2851                         $this->found_posts = $wpdb->get_var( apply_filters_ref_array( 'found_posts_query', array( 'SELECT FOUND_ROWS()', &$this ) ) );
     2851                        $this->found_posts = $wpdb->get_var( apply_filters( 'found_posts_query', 'SELECT FOUND_ROWS()', $this ) );
    28522852                else
    28532853                        $this->found_posts = count( $this->posts );
    28542854
    2855                 $this->found_posts = apply_filters_ref_array( 'found_posts', array( $this->found_posts, &$this ) );
     2855                $this->found_posts = apply_filters( 'found_posts', $this->found_posts, $this );
    28562856
    28572857                if ( ! empty( $limits ) )
    28582858                        $this->max_num_pages = ceil( $this->found_posts / $q['posts_per_page'] );
     
    28902890                $this->in_the_loop = true;
    28912891
    28922892                if ( $this->current_post == -1 ) // loop has just started
    2893                         do_action_ref_array('loop_start', array(&$this));
     2893                        do_action( 'loop_start', $this );
    28942894
    28952895                $post = $this->next_post();
    28962896                setup_postdata($post);
     
    29112911                if ( $this->current_post + 1 < $this->post_count ) {
    29122912                        return true;
    29132913                } elseif ( $this->current_post + 1 == $this->post_count && $this->post_count > 0 ) {
    2914                         do_action_ref_array('loop_end', array(&$this));
     2914                        do_action( 'loop_end', $this );
    29152915                        // Do some cleaning up after the loop
    29162916                        $this->rewind_posts();
    29172917                }
  • src/wp-includes/rewrite.php

     
    15991599                else
    16001600                        $this->rules = array_merge($this->extra_rules_top, $robots_rewrite, $deprecated_files, $registration_pages, $root_rewrite, $comments_rewrite, $search_rewrite,  $author_rewrite, $date_rewrite, $post_rewrite, $page_rewrite, $this->extra_rules);
    16011601
    1602                 do_action_ref_array('generate_rewrite_rules', array(&$this));
     1602                do_action( 'generate_rewrite_rules', $this );
    16031603                $this->rules = apply_filters('rewrite_rules_array', $this->rules);
    16041604
    16051605                return $this->rules;
  • src/wp-includes/user.php

     
    531531                        $this->query_where .= " AND $wpdb->users.ID NOT IN ($ids)";
    532532                }
    533533
    534                 do_action_ref_array( 'pre_user_query', array( &$this ) );
     534                do_action( 'pre_user_query', $this );
    535535        }
    536536
    537537        /**
  • tests/includes/utils.php

     
    133133                $this->xml = xml_parser_create();
    134134                xml_set_object($this->xml, $this);
    135135                xml_parser_set_option($this->xml,XML_OPTION_CASE_FOLDING, 0);
    136                 xml_set_element_handler($this->xml, array(&$this, 'startHandler'), array(&$this, 'endHandler'));
    137                 xml_set_character_data_handler($this->xml, array(&$this, 'dataHandler'));
     136                xml_set_element_handler($this->xml, array($this, 'startHandler'), array($this, 'endHandler'));
     137                xml_set_character_data_handler($this->xml, array($this, 'dataHandler'));
    138138                $this->parse($in);
    139139        }
    140140
  • tests/includes/wp-profiler.php

     
    3232
    3333                if (!$this->stack) {
    3434                        // log all actions and filters
    35                         add_filter('all', array(&$this, 'log_filter'));
     35                        add_filter('all', array($this, 'log_filter'));
    3636                }
    3737
    3838                // reset the wpdb queries log, storing it on the profile stack if necessary
     
    101101                }
    102102
    103103                if (!$this->stack) {
    104                         remove_filter('all', array(&$this, 'log_filter'));
     104                        remove_filter('all', array($this, 'log_filter'));
    105105                }
    106106        }
    107107
     
    213213        $GLOBALS['wppf']->print_summary();
    214214}
    215215
    216 ?>
    217  No newline at end of file
     216?>
  • tests/tests/admin/includesTheme.php

     
    1010                $this->orig_theme_dir = $GLOBALS['wp_theme_directories'];
    1111                $GLOBALS['wp_theme_directories'] = array( WP_CONTENT_DIR . '/themes', $this->theme_root );
    1212
    13                 add_filter('theme_root', array(&$this, '_theme_root'));
    14                 add_filter( 'stylesheet_root', array(&$this, '_theme_root') );
    15                 add_filter( 'template_root', array(&$this, '_theme_root') );
     13                add_filter('theme_root', array($this, '_theme_root'));
     14                add_filter( 'stylesheet_root', array($this, '_theme_root') );
     15                add_filter( 'template_root', array($this, '_theme_root') );
    1616
    1717                // clear caches
    1818                wp_clean_themes_cache();
     
    2121
    2222        function tearDown() {
    2323                $GLOBALS['wp_theme_directories'] = $this->orig_theme_dir;
    24                 remove_filter('theme_root', array(&$this, '_theme_root'));
    25                 remove_filter( 'stylesheet_root', array(&$this, '_theme_root') );
    26                 remove_filter( 'template_root', array(&$this, '_theme_root') );
     24                remove_filter('theme_root', array($this, '_theme_root'));
     25                remove_filter( 'stylesheet_root', array($this, '_theme_root') );
     26                remove_filter( 'template_root', array($this, '_theme_root') );
    2727
    2828                wp_clean_themes_cache();
    2929                unset( $GLOBALS['wp_themes'] );
  • tests/tests/filters.php

     
    1212                $tag = rand_str();
    1313                $val = rand_str();
    1414
    15                 add_filter($tag, array(&$a, 'filter'));
     15                add_filter($tag, array($a, 'filter'));
    1616                $this->assertEquals($val, apply_filters($tag, $val));
    1717
    1818                // only one event occurred for the hook, with empty args
     
    2929                $tag = rand_str();
    3030                $val = rand_str();
    3131
    32                 add_filter($tag, array(&$a, 'filter'));
     32                add_filter($tag, array($a, 'filter'));
    3333                $this->assertEquals($val, apply_filters($tag, $val));
    3434
    3535                // make sure our hook was called correctly
     
    3737                $this->assertEquals(array($tag), $a->get_tags());
    3838
    3939                // now remove the filter, do it again, and make sure it's not called this time
    40                 remove_filter($tag, array(&$a, 'filter'));
     40                remove_filter($tag, array($a, 'filter'));
    4141                $this->assertEquals($val, apply_filters($tag, $val));
    4242                $this->assertEquals(1, $a->get_call_count());
    4343                $this->assertEquals(array($tag), $a->get_tags());
     
    6666                $val = rand_str();
    6767
    6868                // add both filters to the hook
    69                 add_filter($tag, array(&$a1, 'filter'));
    70                 add_filter($tag, array(&$a2, 'filter'));
     69                add_filter($tag, array($a1, 'filter'));
     70                add_filter($tag, array($a2, 'filter'));
    7171
    7272                $this->assertEquals($val, apply_filters($tag, $val));
    7373
     
    8282                $val = rand_str();
    8383                $arg1 = rand_str();
    8484
    85                 add_filter($tag, array(&$a, 'filter'), 10, 2);
     85                add_filter($tag, array($a, 'filter'), 10, 2);
    8686                // call the filter with a single argument
    8787                $this->assertEquals($val, apply_filters($tag, $val, $arg1));
    8888
     
    9999                $arg2 = rand_str();
    100100
    101101                // a1 accepts two arguments, a2 doesn't
    102                 add_filter($tag, array(&$a1, 'filter'), 10, 3);
    103                 add_filter($tag, array(&$a2, 'filter'));
     102                add_filter($tag, array($a1, 'filter'), 10, 3);
     103                add_filter($tag, array($a2, 'filter'));
    104104                // call the filter with two arguments
    105105                $this->assertEquals($val, apply_filters($tag, $val, $arg1, $arg2));
    106106
     
    119119                $val = rand_str();
    120120
    121121                // make two filters with different priorities
    122                 add_filter($tag, array(&$a, 'filter'), 10);
    123                 add_filter($tag, array(&$a, 'filter2'), 9);
     122                add_filter($tag, array($a, 'filter'), 10);
     123                add_filter($tag, array($a, 'filter2'), 9);
    124124                $this->assertEquals($val, apply_filters($tag, $val));
    125125
    126126                // there should be two events, one per filter
     
    151151                $val = rand_str();
    152152
    153153                // add an 'all' filter
    154                 add_filter('all', array(&$a, 'filterall'));
     154                add_filter('all', array($a, 'filterall'));
    155155                // do some filters
    156156                $this->assertEquals($val, apply_filters($tag1, $val));
    157157                $this->assertEquals($val, apply_filters($tag2, $val));
     
    163163                // the right hooks should have been called in order
    164164                $this->assertEquals(array($tag1, $tag2, $tag1, $tag1), $a->get_tags());
    165165
    166                 remove_filter('all', array(&$a, 'filterall'));
    167                 $this->assertFalse( has_filter('all', array(&$a, 'filterall')) );
     166                remove_filter('all', array($a, 'filterall'));
     167                $this->assertFalse( has_filter('all', array($a, 'filterall')) );
    168168
    169169        }
    170170
     
    173173                $tag = rand_str();
    174174                $val = rand_str();
    175175
    176                 add_filter('all', array(&$a, 'filterall'));
     176                add_filter('all', array($a, 'filterall'));
    177177                $this->assertTrue( has_filter('all') );
    178                 $this->assertEquals( 10, has_filter('all', array(&$a, 'filterall')) );
     178                $this->assertEquals( 10, has_filter('all', array($a, 'filterall')) );
    179179                $this->assertEquals($val, apply_filters($tag, $val));
    180180
    181181                // make sure our hook was called correctly
     
    183183                $this->assertEquals(array($tag), $a->get_tags());
    184184
    185185                // now remove the filter, do it again, and make sure it's not called this time
    186                 remove_filter('all', array(&$a, 'filterall'));
    187                 $this->assertFalse( has_filter('all', array(&$a, 'filterall')) );
     186                remove_filter('all', array($a, 'filterall'));
     187                $this->assertFalse( has_filter('all', array($a, 'filterall')) );
    188188                $this->assertFalse( has_filter('all') );
    189189                $this->assertEquals($val, apply_filters($tag, $val));
    190190                // call cound should remain at 1
     
    200200                $a = new MockAction();
    201201                $tag = rand_str();
    202202
    203                 add_action($tag, array(&$a, 'filter'));
     203                add_action($tag, array($a, 'filter'));
    204204
    205205                apply_filters_ref_array($tag, array(&$obj));
    206206
     
    220220                $b = new MockAction();
    221221                $tag = rand_str();
    222222
    223                 add_action($tag, array(&$a, 'filter_append'), 10, 2);
    224                 add_action($tag, array(&$b, 'filter_append'), 10, 2);
     223                add_action($tag, array($a, 'filter_append'), 10, 2);
     224                add_action($tag, array($b, 'filter_append'), 10, 2);
    225225
    226226                $result = apply_filters_ref_array($tag, array('string', &$obj));
    227227
     
    242242        }
    243243
    244244        function _self_removal($tag) {
    245                 remove_action( $tag, array(&$this, '_self_removal'), 10, 1 );
     245                remove_action( $tag, array($this, '_self_removal'), 10, 1 );
    246246                return $tag;
    247247        }
    248248
     
    254254                $a = new MockAction();
    255255                $b = new MockAction();
    256256
    257                 add_action( $tag, array(&$a, 'filter_append'), 11, 1 );
    258                 add_action( $tag, array(&$b, 'filter_append'), 12, 1 );
    259                 add_action( $tag, array(&$this, '_self_removal'), 10, 1 );
     257                add_action( $tag, array($a, 'filter_append'), 11, 1 );
     258                add_action( $tag, array($b, 'filter_append'), 12, 1 );
     259                add_action( $tag, array($this, '_self_removal'), 10, 1 );
    260260
    261261                $result = apply_filters($tag, $tag);
    262262                $this->assertEquals( 1, $a->get_call_count(), 'priority 11 filters should run after priority 10 empties itself' );
  • tests/tests/meta.php

     
    1919                $meta = sanitize_meta( 'some_meta', 'unsanitized', 'post' );
    2020                $this->assertEquals( 'unsanitized', $meta );
    2121
    22                 register_meta( 'post', 'some_meta', array( &$this, '_meta_sanitize_cb' ) );
     22                register_meta( 'post', 'some_meta', array( $this, '_meta_sanitize_cb' ) );
    2323                $meta = sanitize_meta( 'some_meta', 'unsanitized', 'post' );
    2424                $this->assertEquals( 'sanitized', $meta );
    2525        }
  • tests/tests/theme/WPTheme.php

     
    1010                $this->orig_theme_dir = $GLOBALS['wp_theme_directories'];
    1111                $GLOBALS['wp_theme_directories'] = array( $this->theme_root );
    1212
    13                 add_filter('theme_root', array(&$this, '_theme_root'));
    14                 add_filter( 'stylesheet_root', array(&$this, '_theme_root') );
    15                 add_filter( 'template_root', array(&$this, '_theme_root') );
     13                add_filter('theme_root', array($this, '_theme_root'));
     14                add_filter( 'stylesheet_root', array($this, '_theme_root') );
     15                add_filter( 'template_root', array($this, '_theme_root') );
    1616                // clear caches
    1717                wp_clean_themes_cache();
    1818                unset( $GLOBALS['wp_themes'] );
     
    2020
    2121        function tearDown() {
    2222                $GLOBALS['wp_theme_directories'] = $this->orig_theme_dir;
    23                 remove_filter('theme_root', array(&$this, '_theme_root'));
    24                 remove_filter( 'stylesheet_root', array(&$this, '_theme_root') );
    25                 remove_filter( 'template_root', array(&$this, '_theme_root') );
     23                remove_filter('theme_root', array($this, '_theme_root'));
     24                remove_filter( 'stylesheet_root', array($this, '_theme_root') );
     25                remove_filter( 'template_root', array($this, '_theme_root') );
    2626                wp_clean_themes_cache();
    2727                unset( $GLOBALS['wp_themes'] );
    2828                parent::tearDown();
  • tests/tests/theme/themeDir.php

     
    1515                // /themes is necessary as theme.php functions assume /themes is the root if there is only one root.
    1616                $GLOBALS['wp_theme_directories'] = array( WP_CONTENT_DIR . '/themes', $this->theme_root );
    1717
    18                 add_filter('theme_root', array(&$this, '_theme_root'));
    19                 add_filter( 'stylesheet_root', array(&$this, '_theme_root') );
    20                 add_filter( 'template_root', array(&$this, '_theme_root') );
     18                add_filter('theme_root', array($this, '_theme_root'));
     19                add_filter( 'stylesheet_root', array($this, '_theme_root') );
     20                add_filter( 'template_root', array($this, '_theme_root') );
    2121                // clear caches
    2222                wp_clean_themes_cache();
    2323                unset( $GLOBALS['wp_themes'] );
     
    2525
    2626        function tearDown() {
    2727                $GLOBALS['wp_theme_directories'] = $this->orig_theme_dir;
    28                 remove_filter('theme_root', array(&$this, '_theme_root'));
    29                 remove_filter( 'stylesheet_root', array(&$this, '_theme_root') );
    30                 remove_filter( 'template_root', array(&$this, '_theme_root') );
     28                remove_filter('theme_root', array($this, '_theme_root'));
     29                remove_filter( 'stylesheet_root', array($this, '_theme_root') );
     30                remove_filter( 'template_root', array($this, '_theme_root') );
    3131                wp_clean_themes_cache();
    3232                unset( $GLOBALS['wp_themes'] );
    3333                parent::tearDown();
  • tests/tests/user/capabilities.php

     
    508508                        $this->assertFalse( $admin->has_cap('add_post_meta', $post, '_protected') );
    509509                        $this->assertFalse( $admin->has_cap('delete_post_meta', $post, '_protected') );
    510510
    511                         register_meta( 'post', '_protected', array( &$this, '_meta_filter' ), array( &$this, '_meta_yes_you_can' ) );
     511                        register_meta( 'post', '_protected', array( $this, '_meta_filter' ), array( $this, '_meta_yes_you_can' ) );
    512512                        $this->assertTrue( $admin->has_cap('edit_post_meta',  $post, '_protected') );
    513513                        $this->assertTrue( $admin->has_cap('add_post_meta',  $post, '_protected') );
    514514                        $this->assertTrue( $admin->has_cap('delete_post_meta',  $post, '_protected') );
     
    517517                        $this->assertTrue( $admin->has_cap('add_post_meta', $post, 'not_protected') );
    518518                        $this->assertTrue( $admin->has_cap('delete_post_meta', $post, 'not_protected') );
    519519
    520                         register_meta( 'post', 'not_protected', array( &$this, '_meta_filter' ), array( &$this, '_meta_no_you_cant' ) );
     520                        register_meta( 'post', 'not_protected', array( $this, '_meta_filter' ), array( $this, '_meta_no_you_cant' ) );
    521521                        $this->assertFalse( $admin->has_cap('edit_post_meta',  $post, 'not_protected') );
    522522                        $this->assertFalse( $admin->has_cap('add_post_meta',  $post, 'not_protected') );
    523523                        $this->assertFalse( $admin->has_cap('delete_post_meta',  $post, 'not_protected') );
  • tools/i18n/makepot.php

     
    237237                return $this->wp_generic( $dir, array(
    238238                        'project' => 'wp-core', 'output' => $output,
    239239                        'extract_not_gettexted' => true,
    240                         'not_gettexted_files_filter' => array( &$this, 'is_not_ms_file' ),
     240                        'not_gettexted_files_filter' => array( $this, 'is_not_ms_file' ),
    241241                ) );
    242242        }
    243243
     
    340340                        'includes' => $this->ms_files, 'excludes' => array(),
    341341                        'default_output' => 'wordpress-ms.pot',
    342342                        'extract_not_gettexted' => true,
    343                         'not_gettexted_files_filter' => array( &$this, 'is_ms_file' ),
     343                        'not_gettexted_files_filter' => array( $this, 'is_ms_file' ),
    344344                ) );
    345345                if ( !$ms_result ) {
    346346                        return false;
     
    557557if ($included_files[0] == __FILE__) {
    558558        $makepot = new MakePOT;
    559559        if ((3 == count($argv) || 4 == count($argv)) && in_array($method = str_replace('-', '_', $argv[1]), get_class_methods($makepot))) {
    560                 $res = call_user_func(array(&$makepot, $method), realpath($argv[2]), isset($argv[3])? $argv[3] : null);
     560                $res = call_user_func(array($makepot, $method), realpath($argv[2]), isset($argv[3])? $argv[3] : null);
    561561                if (false === $res) {
    562562                        fwrite(STDERR, "Couldn't generate POT file!\n");
    563563                }
  • tools/i18n/not-gettexted.php

     
    5959                        if ('.' == $item || '..' == $item)
    6060                                continue;
    6161                        if ('.php' == substr($item, -4))
    62                                 $files[] = $full_item; 
     62                                $files[] = $full_item;
    6363                        if (is_dir($full_item))
    6464                                $files += array_merge($files, NotGettexted::list_php_files($full_item, $files));
    6565                }
     
    9999                                                continue;
    100100                                        }
    101101                                        if ($this->STAGE_START_COMMENT <= $stage && $stage <= $this->STAGE_WHITESPACE_AFTER && '/'.$current_comment_id == $matches[1]) {
    102                                                 $stage = $this->STAGE_END_COMMENT; 
     102                                                $stage = $this->STAGE_END_COMMENT;
    103103                                                $this->logmsg('end comment', $current_comment_id);
    104104                                                $result .= call_user_func($other_action, $token);
    105105                                                if (!is_null($register_action)) call_user_func($register_action, $current_string, $current_comment_id, $current_string_line);
     
    152152                foreach($filenames as $filename) {
    153153                        $tokens = token_get_all(file_get_contents($filename));
    154154                        $aggregator = $this->make_string_aggregator($global_name, $filename);
    155                         $this->walk_tokens($tokens, array(&$this, 'ignore_token'), array(&$this, 'ignore_token'), $aggregator);
     155                        $this->walk_tokens($tokens, array($this, 'ignore_token'), array($this, 'ignore_token'), $aggregator);
    156156                }
    157157
    158158                $potf = '-' == $pot_filename? STDOUT : @fopen($pot_filename, 'a');
     
    196196                        $source = file_get_contents($filename);
    197197                        if ( strlen($source) > 150000 ) continue;
    198198                        $tokens = token_get_all($source);
    199                         $new_file = $this->walk_tokens($tokens, $replacer, array(&$this, 'unchanged_token'));
     199                        $new_file = $this->walk_tokens($tokens, $replacer, array($this, 'unchanged_token'));
    200200                        $f = fopen($filename, 'w');
    201201                        fwrite($f, $new_file);
    202202                        fclose($f);
     
    218218                        $this->usage();
    219219                        exit(1);
    220220                }
    221                 call_user_func_array(array(&$this, $this->commands[$argv[1]]), array_slice($argv, 2));
     221                call_user_func_array(array($this, $this->commands[$argv[1]]), array_slice($argv, 2));
    222222        }
    223223}
    224224
  • tools/i18n/pot-ext-meta.php

     
    5151                if ( $headers )
    5252                        $this->headers = (array) $headers;
    5353                if ( is_dir( $ext_filename ) ) {
    54                         $pot = implode('', array_map(array(&$this, 'load_from_file'), glob("$ext_filename/*.php")));
     54                        $pot = implode('', array_map(array($this, 'load_from_file'), glob("$ext_filename/*.php")));
    5555                } else {
    5656                        $pot = $this->load_from_file($ext_filename);
    5757                }
  • tools/i18n/t/NotGettextedTest.php

     
    99require_once dirname( dirname( __FILE__ ) ) . '/not-gettexted.php';
    1010
    1111class NotGettextedTest extends PHPUnit_Framework_TestCase {
    12        
     12
    1313        function __construct() {
    1414                $this->ng = new NotGettexted;
    1515        }
    16        
     16
    1717        function test_make_string_aggregator() {
    1818                global $baba;
    1919                $f = $this->ng->make_string_aggregator( 'baba', 'baba.php' );
     
    2929echo /* WP_I18N_GUGU*/  "yes" /* /WP_I18N_UGU           */;
    3030        if ($x == "18181") { wp_die(sprintf(/*WP_I18N_DIE*/\'We died %d times!\'/*WP_I18N_DIE*/)); }
    3131?>';
    32                 $tokens = token_get_all($code); 
    33                 $this->assertEquals( '', $this->ng->walk_tokens( $tokens, array(&$this->ng, 'ignore_token'), array(&$this->ng, 'ignore_token') ) );
    34                 $this->assertEquals( '"yes"\'We died %d times!\'', $this->ng->walk_tokens( $tokens, array(&$this->ng, 'unchanged_token'), array(&$this->ng, 'ignore_token') ) );
    35                 $this->assertEquals( $code, $this->ng->walk_tokens( $tokens, array(&$this->ng, 'unchanged_token'), array(&$this->ng, 'unchanged_token') ) );
    36                 $this->assertEquals( $code, $this->ng->walk_tokens( $tokens, array(&$this->ng, 'unchanged_token'), array(&$this->ng, 'unchanged_token') ) );
     32                $tokens = token_get_all($code);
     33                $this->assertEquals( '', $this->ng->walk_tokens( $tokens, array($this->ng, 'ignore_token'), array($this->ng, 'ignore_token') ) );
     34                $this->assertEquals( '"yes"\'We died %d times!\'', $this->ng->walk_tokens( $tokens, array($this->ng, 'unchanged_token'), array($this->ng, 'ignore_token') ) );
     35                $this->assertEquals( $code, $this->ng->walk_tokens( $tokens, array($this->ng, 'unchanged_token'), array($this->ng, 'unchanged_token') ) );
     36                $this->assertEquals( $code, $this->ng->walk_tokens( $tokens, array($this->ng, 'unchanged_token'), array($this->ng, 'unchanged_token') ) );
    3737        }
    3838
    3939        function test_replace() {
     
    4343                $this->assertEquals( file_get_contents( 'data/not-gettexted-0-result.php' ), file_get_contents( 'data/not-gettexted-0-work.php' ) );
    4444                unlink( 'data/not-gettexted-0-work.php' );
    4545        }
    46 }
    47  No newline at end of file
     46}