WordPress.org

Make WordPress Core

Ticket #14642: support_hphp.diff

File support_hphp.diff, 3.4 KB (added by ChenHui, 8 years ago)

Patch to support HipHop

  • wp-admin/edit.php

    diff --git a/wp-admin/edit.php b/wp-admin/edit.php
    index 9a7e134..5181360 100644
    a b $table = new WP_Posts_Table; 
    1515$table->check_permissions();
    1616
    1717// Back-compat for viewing comments of an entry
    18 if ( $_redirect = intval( max( @$_REQUEST['p'], @$_REQUEST['attachment_id'], @$_REQUEST['page_id'] ) ) ) {
     18if ( isset($_GET['p']) && isset($_GET['attachment_id']) && isset($_GET['page_id']) && $_redirect = intval( max( @$_REQUEST['p'], @$_REQUEST['attachment_id'], @$_REQUEST['page_id'] ) ) ) {
    1919        wp_redirect( admin_url('edit-comments.php?p=' . $_redirect ) );
    2020        exit;
    2121} else {
  • wp-admin/includes/image-edit.php

    diff --git a/wp-admin/includes/image-edit.php b/wp-admin/includes/image-edit.php
    index e871ae5..49cfa5f 100644
    a b function wp_restore_image($post_id) { 
    421421        $file = get_attached_file($post_id);
    422422        $backup_sizes = get_post_meta( $post_id, '_wp_attachment_backup_sizes', true );
    423423        $restored = false;
    424         $msg = '';
    425424
    426425        if ( !is_array($backup_sizes) ) {
    427426                $msg->error = __('Cannot load image metadata.');
    function wp_restore_image($post_id) { 
    492491}
    493492
    494493function wp_save_image($post_id) {
    495         $return = '';
    496494        $success = $delete = $scaled = $nocrop = false;
    497495        $post = get_post($post_id);
    498496        @ini_set('memory_limit', '256M');
  • wp-admin/includes/user.php

    diff --git a/wp-admin/includes/user.php b/wp-admin/includes/user.php
    index aaa20f3..e6a29e3 100644
    a b function add_user() { 
    5555 */
    5656function edit_user( $user_id = 0 ) {
    5757        global $wp_roles, $wpdb;
     58        $user = new WP_User($user_id);
    5859        if ( $user_id != 0 ) {
    5960                $update = true;
    6061                $user->ID = (int) $user_id;
    function edit_user( $user_id = 0 ) { 
    6263                $user->user_login = $wpdb->escape( $userdata->user_login );
    6364        } else {
    6465                $update = false;
    65                 $user = '';
    6666        }
    6767
    6868        if ( !$update && isset( $_POST['user_login'] ) )
  • wp-includes/functions.php

    diff --git a/wp-includes/functions.php b/wp-includes/functions.php
    index 28f501f..0e87875 100644
    a b function add_query_arg() { 
    14101410        $qs = urlencode_deep( $qs ); // this re-URL-encodes things that were already in the query string
    14111411        if ( is_array( func_get_arg( 0 ) ) ) {
    14121412                $kayvees = func_get_arg( 0 );
    1413                 $qs = array_merge( $qs, $kayvees );
     1413                $qs = array_merge( (array)$qs, (array)$kayvees );
    14141414        } else {
    14151415                $qs[func_get_arg( 0 )] = func_get_arg( 1 );
    14161416        }
    function wp_parse_args( $args, $defaults = '' ) { 
    29602960                wp_parse_str( $args, $r );
    29612961
    29622962        if ( is_array( $defaults ) )
    2963                 return array_merge( $defaults, $r );
     2963                return array_merge( $defaults, (array)$r );
    29642964        return $r;
    29652965}
    29662966
    function get_file_data( $file, $default_headers, $context = '' ) { 
    41794179                foreach( $extra_headers as $key=>$value ) {
    41804180                        $extra_headers[$key] = $key;
    41814181                }
    4182                 $all_headers = array_merge($extra_headers, $default_headers);
     4182                $all_headers = array_merge($extra_headers, (array)$default_headers);
    41834183        } else {
    41844184                $all_headers = $default_headers;
    41854185        }
  • wp-includes/registration.php

    diff --git a/wp-includes/registration.php b/wp-includes/registration.php
    index 63f70e2..03876d1 100644
    a b function validate_username( $username ) { 
    103103function wp_insert_user($userdata) {
    104104        global $wpdb;
    105105
    106         extract($userdata, EXTR_SKIP);
     106        extract($userdata);
    107107
    108108        // Are we updating or creating?
    109109        if ( !empty($ID) ) {