Make WordPress Core

Changeset 8237


Ignore:
Timestamp:
07/02/2008 03:26:51 PM (17 years ago)
Author:
ryan
Message:

Don't match images with tags in them. Props noel. see #7220

File:
1 edited

Legend:

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

    r8235 r8237  
    116116
    117117// Ajax Requests
    118 $title = wp_specialchars(stripslashes($_GET['t']));
     118$title = wp_specialchars(aposfix(stripslashes($_GET['t'])));
    119119
    120120$selection = str_replace("\n", "<br />", aposfix( stripslashes($_GET['s']) ) );
     
    179179if($_REQUEST['ajax'] == 'photo_images') {
    180180    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'))
    182182            return "'".$uri."'";
    183183
     
    187187        $host = parse_url($uri);
    188188       
    189         $pattern = '/<img ([^>]*)src=(\"|\')(.+?)(\2)([^>\/]*)\/*>/is';
     189        $pattern = '/<img ([^>]*)src=(\"|\')([^<>]+?\.(png|jpeg|jpg|jpe|gif))(\2)([^>\/]*)\/*>/is';
    190190        preg_match_all($pattern, $content, $matches);
    191191       
Note: See TracChangeset for help on using the changeset viewer.