WordPress.org

Make WordPress Core

Changeset 12108


Ignore:
Timestamp:
10/26/2009 09:04:21 AM (9 years ago)
Author:
azaozz
Message:

PressThis fixes from noel, see #11011

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/press-this.php

    r12098 r12108  
    195195            $uri = preg_replace('/\/#.+?$/','', $uri);
    196196            if( preg_match('/\.(jpg|jpe|jpeg|png|gif)$/', $uri) && !strpos($uri,'blogger.com') )
    197                 return "'".html_entity_decode($uri)."'";
     197                return "'" . esc_attr( html_entity_decode($uri) ) . "'";
    198198            $content = wp_remote_fopen($uri);
    199199            if ( false === $content )
    200200                return '';
    201201            $host = parse_url($uri);
    202             $pattern = '/<img ([^>]*)src=(\"|\')([^<>\'\"]+)(\2)([^>]*)\/*>/is';
     202            $pattern = '/<img ([^>]*)src=(\"|\')([^<>\'\"]+)(\2)([^>]*)\/*>/i';
     203            $content = str_replace(array("\n","\t","\r"), '', $content);
    203204            preg_match_all($pattern, $content, $matches);
    204205            if ( empty($matches[0]) )
     
    213214                    else
    214215                        $src = 'http://'.str_replace('//','/', $host['host'].'/'.dirname($host['path']).'/'.$src);
    215                 $sources[] = esc_url($src);
     216                $sources[] = esc_attr($src);
    216217            }
    217218            return "'" . implode("','", $sources) . "'";
Note: See TracChangeset for help on using the changeset viewer.