Changeset 12108 for trunk/wp-admin/press-this.php
- Timestamp:
- 10/26/2009 09:04:21 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/press-this.php
r12098 r12108 195 195 $uri = preg_replace('/\/#.+?$/','', $uri); 196 196 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) ) . "'"; 198 198 $content = wp_remote_fopen($uri); 199 199 if ( false === $content ) 200 200 return ''; 201 201 $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); 203 204 preg_match_all($pattern, $content, $matches); 204 205 if ( empty($matches[0]) ) … … 213 214 else 214 215 $src = 'http://'.str_replace('//','/', $host['host'].'/'.dirname($host['path']).'/'.$src); 215 $sources[] = esc_ url($src);216 $sources[] = esc_attr($src); 216 217 } 217 218 return "'" . implode("','", $sources) . "'";
Note: See TracChangeset
for help on using the changeset viewer.