From 4a985af21782335b51a19a790a1eb7cba438cfc0 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 2 Jul 2008 15:26:51 +0000 Subject: [PATCH] Don't match images with tags in them. Props noel. see #7220 git-svn-id: https://develop.svn.wordpress.org/trunk@8237 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/press-this.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-admin/press-this.php b/wp-admin/press-this.php index ece871ac0c..39cc86a0ad 100644 --- a/wp-admin/press-this.php +++ b/wp-admin/press-this.php @@ -115,7 +115,7 @@ function aposfix($text) { } // Ajax Requests -$title = wp_specialchars(stripslashes($_GET['t'])); +$title = wp_specialchars(aposfix(stripslashes($_GET['t']))); $selection = str_replace("\n", "
", aposfix( stripslashes($_GET['s']) ) ); $url = clean_url($_GET['u']); @@ -178,7 +178,7 @@ if($_REQUEST['ajax'] == 'video') { ?> if($_REQUEST['ajax'] == 'photo_images') { function get_images_from_uri($uri) { - if(preg_match('/\.(jpg|png|gif)/', $uri) && !strpos($uri,'blogger.com')) + if(preg_match('/\.(jpg|jpe|jpeg|png|gif)/', $uri) && !strpos($uri,'blogger.com')) return "'".$uri."'"; $content = wp_remote_fopen($uri); @@ -186,7 +186,7 @@ if($_REQUEST['ajax'] == 'photo_images') { $host = parse_url($uri); - $pattern = '/]*)src=(\"|\')(.+?)(\2)([^>\/]*)\/*>/is'; + $pattern = '/]*)src=(\"|\')([^<>]+?\.(png|jpeg|jpg|jpe|gif))(\2)([^>\/]*)\/*>/is'; preg_match_all($pattern, $content, $matches); if ( empty($matches[1]) ) return '';