Make WordPress Core

Ticket #24248: 24248-raw-context.diff

File 24248-raw-context.diff, 1.2 KB (added by meloniq, 9 years ago)

adds 'raw' context to get_post_field() calls

  • post.php

     
    30963096                        return 0;
    30973097                }
    30983098
    3099                 $guid = get_post_field( 'guid', $post_ID );
    3100                 $previous_status = get_post_field('post_status', $post_ID );
     3099                $guid = get_post_field( 'guid', $post_ID, 'raw' );
     3100                $previous_status = get_post_field( 'post_status', $post_ID, 'raw' );
    31013101        } else {
    31023102                $previous_status = 'new';
    31033103        }
     
    31793179        } else {
    31803180                // On updates, we need to check to see if it's using the old, fixed sanitization context.
    31813181                $check_name = sanitize_title( $post_name, '', 'old-save' );
    3182                 if ( $update && strtolower( urlencode( $post_name ) ) == $check_name && get_post_field( 'post_name', $post_ID ) == $check_name ) {
     3182                if ( $update && strtolower( urlencode( $post_name ) ) == $check_name && get_post_field( 'post_name', $post_ID, 'raw' ) == $check_name ) {
    31833183                        $post_name = $check_name;
    31843184                } else { // new post, or slug has changed.
    31853185                        $post_name = sanitize_title($post_name);
     
    33893389                }
    33903390        }
    33913391
    3392         $current_guid = get_post_field( 'guid', $post_ID );
     3392        $current_guid = get_post_field( 'guid', $post_ID, 'raw' );
    33933393
    33943394        // Set GUID.
    33953395        if ( ! $update && '' == $current_guid ) {