Ticket #7220: press-this-7-2-410am.diff
| File press-this-7-2-410am.diff, 1.1 KB (added by noel, 4 years ago) |
|---|
-
wp-admin/press-this.php
115 115 } 116 116 117 117 // Ajax Requests 118 $title = wp_specialchars( stripslashes($_GET['t']));118 $title = wp_specialchars(aposfix(stripslashes($_GET['t']))); 119 119 120 120 $selection = str_replace("\n", "<br />", aposfix( stripslashes($_GET['s']) ) ); 121 121 $url = clean_url($_GET['u']); … … 178 178 179 179 if($_REQUEST['ajax'] == 'photo_images') { 180 180 function get_images_from_uri($uri) { 181 if(preg_match('/\.(jpg| png|gif)/', $uri) && !strpos($uri,'blogger.com'))181 if(preg_match('/\.(jpg|jpe|jpeg|png|gif)/', $uri) && !strpos($uri,'blogger.com')) 182 182 return "'".$uri."'"; 183 183 184 184 $content = wp_remote_fopen($uri); … … 186 186 187 187 $host = parse_url($uri); 188 188 189 $pattern = '/<img ([^>]*)src=(\"|\')( .+?)(\2)([^>\/]*)\/*>/is';189 $pattern = '/<img ([^>]*)src=(\"|\')([^<>]+?\.(png|jpeg|jpg|jpe|gif))(\2)([^>\/]*)\/*>/is'; 190 190 preg_match_all($pattern, $content, $matches); 191 191 192 192 if ( empty($matches[1]) ) return '';
