Make WordPress Core

Ticket #32173: 32173.diff

File 32173.diff, 1.3 KB (added by stephdau, 10 years ago)
  • src/wp-admin/includes/class-wp-press-this.php

     
    642642                $data = array();
    643643
    644644                // Only instantiate the keys we want. Sanity check and sanitize each one.
    645                 foreach ( array( 'u', 's', 't', 'v' ) as $key ) {
     645                foreach ( array( 'u', 's', 't', 'v', 'i' ) as $key ) {
    646646                        if ( ! empty( $_POST[ $key ] ) ) {
    647647                                $value = wp_unslash( $_POST[ $key ] );
    648648                        } else if ( ! empty( $_GET[ $key ] ) ) {
     
    651651                                continue;
    652652                        }
    653653
    654                         if ( 'u' === $key ) {
    655                                 $value = $this->_limit_url( $value );
     654                        if ( in_array( $key, array( 'u', 'i' ) ) ) {
     655                                $value = ( 'i' === $key ) ? $this->_limit_img( $value ) : $this->_limit_url( $value );
    656656
    657657                                if ( preg_match( '%^(?:https?:)?//[^/]+%i', $value, $domain_match ) ) {
    658658                                        $this->domain = $domain_match[0];
     
    955955        public function get_images( $data ) {
    956956                $selected_images = array();
    957957
     958                if ( ! empty( $data['i'] ) ) {
     959                        $data['_images'][] = $data['i']; // Already gone through _limit_img() in merge_or_fetch_data()
     960                }
     961
    958962                if ( ! empty( $data['_images'] ) ) {
    959963                        foreach( $data['_images'] as $src ) {
    960964                                if ( false !== strpos( $src, 'gravatar.com' ) ) {