Make WordPress Core


Ignore:
Timestamp:
03/29/2013 08:56:18 PM (14 years ago)
Author:
helen
Message:

Since post format meta for images now takes an attachment ID only, make sure we label it appropriately and don't do things like esc_url() the value. fixes #23900.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/post-formats.php

    r23853 r23874  
    2121        <?php
    2222        $image = false;
    23         if ( isset( $format_meta['image'] ) )
    24                 $image = is_numeric( $format_meta['image'] ) ? wp_get_attachment_url( $format_meta['image'] ) : $format_meta['image'];
     23        if ( ! empty( $format_meta['image'] ) && is_numeric( $format_meta['image'] ) ) {
     24                $format_meta['image'] = absint( $format_meta['image'] );
     25                $image = wp_get_attachment_url( $format_meta['image'] );
     26        }
    2527        ?>
    2628        <div class="field wp-format-image">
    … …  
    3739                        </a>
    3840                </div>
    39                 <label for="_wp_format_image" class="screen-reader-text"><?php _e( 'Image URL' ); ?>:</label>
    40                 <input id="wp_format_image" type="hidden" name="_wp_format_image" value="<?php echo esc_url( $format_meta['image'] ); ?>" placeholder="<?php esc_attr_e( 'Image URL' ); ?>" class="widefat" />
     41                <label for="_wp_format_image" class="screen-reader-text"><?php _e( 'Attachment ID' ); ?>:</label>
     42                <input id="wp_format_image" type="hidden" name="_wp_format_image" value="<?php esc_attr_e( $format_meta['image'] ); ?>" placeholder="<?php esc_attr_e( 'Attachment ID' ); ?>" class="widefat" />
    4143        </div>
    4244
Note: See TracChangeset for help on using the changeset viewer.