Make WordPress Core

Changeset 25254


Ignore:
Timestamp:
09/05/2013 04:33:50 PM (11 years ago)
Author:
wonderboymusic
Message:

Remove lingering instances of call time pass-by-reference, limited to instances of callable - use $this instead of &$this.

Props jdgrimes.
See #25160.

Location:
trunk
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/custom-background.php

    r24630 r25254  
    6868            return;
    6969
    70         $this->page = $page = add_theme_page(__('Background'), __('Background'), 'edit_theme_options', 'custom-background', array(&$this, 'admin_page'));
    71 
    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);
     70        $this->page = $page = add_theme_page(__('Background'), __('Background'), 'edit_theme_options', 'custom-background', array($this, 'admin_page'));
     71
     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 )
  • trunk/src/wp-admin/custom-header.php

    r25135 r25254  
    8585            return;
    8686
    87         $this->page = $page = add_theme_page(__('Header'), __('Header'), 'edit_theme_options', 'custom-header', array(&$this, 'admin_page'));
    88 
    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);
     87        $this->page = $page = add_theme_page(__('Header'), __('Header'), 'edit_theme_options', 'custom-header', array($this, 'admin_page'));
     88
     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);
  • trunk/src/wp-admin/includes/class-wp-importer.php

    r24917 r25254  
    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();
  • trunk/src/wp-admin/includes/class-wp-list-table.php

    r24123 r25254  
    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'] )
     
    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    }
     
    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            }
  • trunk/src/wp-admin/includes/class-wp-ms-themes-list-table.php

    r25032 r25254  
    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
     
    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        }
  • trunk/src/wp-admin/includes/class-wp-plugins-list-table.php

    r24583 r25254  
    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
     
    122122            $order = strtoupper( $order );
    123123
    124             uasort( $this->items, array( &$this, '_order_callback' ) );
     124            uasort( $this->items, array( $this, '_order_callback' ) );
    125125        }
    126126
  • trunk/src/wp-admin/includes/class-wp-upgrader.php

    r25227 r25254  
    404404        $this->install_strings();
    405405
    406         add_filter('upgrader_source_selection', array(&$this, 'check_package') );
     406        add_filter('upgrader_source_selection', array($this, 'check_package') );
    407407
    408408        $this->run(array(
     
    414414                    ));
    415415
    416         remove_filter('upgrader_source_selection', array(&$this, 'check_package') );
     416        remove_filter('upgrader_source_selection', array($this, 'check_package') );
    417417
    418418        if ( ! $this->result || is_wp_error($this->result) )
     
    444444        $r = $current->response[ $plugin ];
    445445
    446         add_filter('upgrader_pre_install', array(&$this, 'deactivate_plugin_before_upgrade'), 10, 2);
    447         add_filter('upgrader_clear_destination', array(&$this, 'delete_old_plugin'), 10, 4);
    448         //'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.
     446        add_filter('upgrader_pre_install', array($this, 'deactivate_plugin_before_upgrade'), 10, 2);
     447        add_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'), 10, 4);
     448        //'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.
    449449
    450450        $this->run(array(
     
    459459
    460460        // Cleanup our hooks, in case something else does a upgrade on this connection.
    461         remove_filter('upgrader_pre_install', array(&$this, 'deactivate_plugin_before_upgrade'));
    462         remove_filter('upgrader_clear_destination', array(&$this, 'delete_old_plugin'));
     461        remove_filter('upgrader_pre_install', array($this, 'deactivate_plugin_before_upgrade'));
     462        remove_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'));
    463463
    464464        if ( ! $this->result || is_wp_error($this->result) )
     
    481481        $current = get_site_transient( 'update_plugins' );
    482482
    483         add_filter('upgrader_clear_destination', array(&$this, 'delete_old_plugin'), 10, 4);
     483        add_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'), 10, 4);
    484484
    485485        $this->skin->header();
     
    551551
    552552        // Cleanup our hooks, in case something else does a upgrade on this connection.
    553         remove_filter('upgrader_clear_destination', array(&$this, 'delete_old_plugin'));
     553        remove_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'));
    554554
    555555        // Force refresh of plugin update information
     
    713713            $this->skin->feedback( 'parent_theme_not_found', $theme_info->get('Template') );
    714714            // Don't show activate or preview actions after install
    715             add_filter('install_theme_complete_actions', array(&$this, 'hide_activate_preview_actions') );
     715            add_filter('install_theme_complete_actions', array($this, 'hide_activate_preview_actions') );
    716716            return $install_result;
    717717        }
     
    738738
    739739        if ( is_wp_error($parent_result) )
    740             add_filter('install_theme_complete_actions', array(&$this, 'hide_activate_preview_actions') );
     740            add_filter('install_theme_complete_actions', array($this, 'hide_activate_preview_actions') );
    741741
    742742        // Start cleaning up after the parents installation
     
    761761        $this->install_strings();
    762762
    763         add_filter('upgrader_source_selection', array(&$this, 'check_package') );
    764         add_filter('upgrader_post_install', array(&$this, 'check_parent_theme_filter'), 10, 3);
     763        add_filter('upgrader_source_selection', array($this, 'check_package') );
     764        add_filter('upgrader_post_install', array($this, 'check_parent_theme_filter'), 10, 3);
    765765
    766766        $options = array(
     
    773773        $this->run($options);
    774774
    775         remove_filter('upgrader_source_selection', array(&$this, 'check_package') );
    776         remove_filter('upgrader_post_install', array(&$this, 'check_parent_theme_filter'));
     775        remove_filter('upgrader_source_selection', array($this, 'check_package') );
     776        remove_filter('upgrader_post_install', array($this, 'check_parent_theme_filter'));
    777777
    778778        if ( ! $this->result || is_wp_error($this->result) )
     
    803803        $r = $current->response[ $theme ];
    804804
    805         add_filter('upgrader_pre_install', array(&$this, 'current_before'), 10, 2);
    806         add_filter('upgrader_post_install', array(&$this, 'current_after'), 10, 2);
    807         add_filter('upgrader_clear_destination', array(&$this, 'delete_old_theme'), 10, 4);
     805        add_filter('upgrader_pre_install', array($this, 'current_before'), 10, 2);
     806        add_filter('upgrader_post_install', array($this, 'current_after'), 10, 2);
     807        add_filter('upgrader_clear_destination', array($this, 'delete_old_theme'), 10, 4);
    808808
    809809        $options = array(
     
    819819        $this->run($options);
    820820
    821         remove_filter('upgrader_pre_install', array(&$this, 'current_before'));
    822         remove_filter('upgrader_post_install', array(&$this, 'current_after'));
    823         remove_filter('upgrader_clear_destination', array(&$this, 'delete_old_theme'));
     821        remove_filter('upgrader_pre_install', array($this, 'current_before'));
     822        remove_filter('upgrader_post_install', array($this, 'current_after'));
     823        remove_filter('upgrader_clear_destination', array($this, 'delete_old_theme'));
    824824
    825825        if ( ! $this->result || is_wp_error($this->result) )
     
    841841        $current = get_site_transient( 'update_themes' );
    842842
    843         add_filter('upgrader_pre_install', array(&$this, 'current_before'), 10, 2);
    844         add_filter('upgrader_post_install', array(&$this, 'current_after'), 10, 2);
    845         add_filter('upgrader_clear_destination', array(&$this, 'delete_old_theme'), 10, 4);
     843        add_filter('upgrader_pre_install', array($this, 'current_before'), 10, 2);
     844        add_filter('upgrader_post_install', array($this, 'current_after'), 10, 2);
     845        add_filter('upgrader_clear_destination', array($this, 'delete_old_theme'), 10, 4);
    846846
    847847        $this->skin->header();
     
    913913
    914914        // Cleanup our hooks, in case something else does a upgrade on this connection.
    915         remove_filter('upgrader_pre_install', array(&$this, 'current_before'));
    916         remove_filter('upgrader_post_install', array(&$this, 'current_after'));
    917         remove_filter('upgrader_clear_destination', array(&$this, 'delete_old_theme'));
     915        remove_filter('upgrader_pre_install', array($this, 'current_before'));
     916        remove_filter('upgrader_post_install', array($this, 'current_after'));
     917        remove_filter('upgrader_clear_destination', array($this, 'delete_old_theme'));
    918918
    919919        // Force refresh of theme update information
  • trunk/src/wp-admin/includes/list-table.php

    r22838 r25254  
    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    }
  • trunk/tests/phpunit/includes/utils.php

    r25002 r25254  
    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    }
  • trunk/tests/phpunit/includes/wp-profiler.php

    r25002 r25254  
    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
     
    102102
    103103        if (!$this->stack) {
    104             remove_filter('all', array(&$this, 'log_filter'));
     104            remove_filter('all', array($this, 'log_filter'));
    105105        }
    106106    }
  • trunk/tests/phpunit/tests/admin/includesTheme.php

    r25002 r25254  
    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
     
    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();
  • trunk/tests/phpunit/tests/filters.php

    r25002 r25254  
    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
     
    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
     
    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());
     
    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));
     
    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));
     
    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));
     
    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
     
    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));
     
    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    }
     
    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
     
    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));
     
    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));
     
    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));
     
    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    }
     
    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);
  • trunk/tests/phpunit/tests/meta.php

    r25002 r25254  
    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 );
  • trunk/tests/phpunit/tests/theme/WPTheme.php

    r25002 r25254  
    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();
     
    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'] );
  • trunk/tests/phpunit/tests/theme/themeDir.php

    r25002 r25254  
    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();
     
    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'] );
  • trunk/tests/phpunit/tests/user/capabilities.php

    r25002 r25254  
    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') );
     
    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') );
  • trunk/tools/i18n/makepot.php

    r25096 r25254  
    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    }
     
    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 ) {
     
    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");
  • trunk/tools/i18n/not-gettexted.php

    r25003 r25254  
    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));
     
    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);
     
    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
     
    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);
     
    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}
  • trunk/tools/i18n/pot-ext-meta.php

    r25003 r25254  
    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);
  • trunk/tools/i18n/t/NotGettextedTest.php

    r25003 r25254  
    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;
     
    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
Note: See TracChangeset for help on using the changeset viewer.