WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/01/2013 05:58:43 PM (8 years ago)
Author:
nacin
Message:

Ensure the referer functions operate completely on unslashed data: wp_referer_field(), wp_original_referer_field(), wp_get_referer(), wp_get_original_referer().

Use wp_slash() instead of addslashes().

see #21767.

File:
1 edited

Legend:

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

    r23563 r23578  
    468468
    469469        if ( isset($attachment['image_alt']) ) {
    470             $image_alt = get_post_meta($attachment_id, '_wp_attachment_image_alt', true);
    471             if ( $image_alt != wp_unslash($attachment['image_alt']) ) {
    472                 $image_alt = wp_strip_all_tags( wp_unslash($attachment['image_alt']), true );
     470            $image_alt = wp_unslash( $attachment['image_alt'] );
     471            if ( $image_alt != get_post_meta($attachment_id, '_wp_attachment_image_alt', true) ) {
     472                $image_alt = wp_strip_all_tags( $image_alt, true );
    473473                // update_meta expects slashed
    474                 update_post_meta( $attachment_id, '_wp_attachment_image_alt', addslashes($image_alt) );
     474                update_post_meta( $attachment_id, '_wp_attachment_image_alt', wp_slash( $image_alt ) );
    475475            }
    476476        }
Note: See TracChangeset for help on using the changeset viewer.