Plugin Directory

Changeset 736135


Ignore:
Timestamp:
07/04/2013 01:17:44 PM (13 years ago)
Author:
zemanta
Message:

Thumbnailer bugfix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • related-posts/tags/2.8/thumbnailer.php

    r735355 r736135  
    5454    $tmp = download_url($url);
    5555    preg_match( '/[^\?]+\.(jpe?g|jpe|gif|png)\b/i', $url, $matches);
    56     $file_array['name'] = sanitize_file_name(basename($matches[0]));
     56    $file_array['name'] = sanitize_file_name(urldecode(basename($matches[0])));
    5757
    5858    $file_array['tmp_name'] = $tmp;
     
    109109    foreach ($html_tags as $html_tag) {
    110110        if (preg_match('#src=([\'"])(.+?)\1#is', $html_tag, $matches) && !empty($matches)) {
    111             $url = urldecode($matches[2]);
     111            $url = $matches[2];
    112112
    113113            $attachment_id = wp_rp_get_image_from_img_tag($post->ID, $url, $html_tag);
     
    352352    if ( empty( $tag ) )
    353353        return;
    354     return sprintf( '<%1$s[^<]*(?:>[\s\S]*<\/%1$s>|\s*\/>)', tag_escape( $tag ) );
     354    return sprintf( '<%1$s[^<]*(?:>[\s\S]*<\/%1$s>|\s*\/?>)', tag_escape( $tag ) ); // Added the last ?
    355355}
    356356
Note: See TracChangeset for help on using the changeset viewer.