WordPress.org

Make WordPress Core

Changeset 7934


Ignore:
Timestamp:
05/15/2008 12:20:27 AM (13 years ago)
Author:
ryan
Message:

Press This: Fetch offsite images, fix slashing. see #6813

File:
1 edited

Legend:

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

    r7933 r7934  
    8888        return '';
    8989
    90     $pattern = '/img.+?src=[\'"]?([^\'" >]+)[\'" >]/';
     90    $pattern = '/<img[^>]+src=[\'"]([^\'" >]+?)[\'" >]/is';
    9191    preg_match_all($pattern, $content, $matches);
    9292    if ( empty($matches[1]) )
    9393        return '';
    9494
     95    /*
    9596    $from_host = parse_url($uri);
    9697    $from_host = $from_host['host'];
     
    9899    $count = count($from_host);
    99100    $from_host = $from_host[$count - 2] . '.' . $from_host[$count - 1];
     101    */
    100102
    101103    $sources = array();
     
    104106            continue;
    105107
     108        /*
    106109        $img_host = parse_url($src);
    107110        $img_host = $img_host['host'];
    108111        if ( false === strpos($img_host, $from_host) )
    109112            continue;
     113        */
    110114
    111115        $sources[] = $src;
     
    230234    jQuery(document).ready(function() {
    231235    <?php if ( preg_match("/youtube\.com\/watch/i", $_GET['u']) ) { ?>
    232         jQuery('#container > ul').tabs({ selected: 3, fx: { height: 'toggle', opacity: 'toggle', fxSpeed: 'fast' } });
     236        jQuery('#container > ul').tabs({ selected: 3 });
    233237    <?php } elseif ( preg_match("/flickr\.com/i", $_GET['u']) ) { ?>
    234         jQuery('#container > ul').tabs({ selected: 1, fx: { height: 'toggle', opacity: 'toggle', fxSpeed: 'fast' } });
     238        jQuery('#container > ul').tabs({ selected: 1 });
    235239    <?php } else { ?>
    236         jQuery('#container > ul').tabs({ selected: 1, fx: { height: 'toggle', opacity: 'toggle', fxSpeed: 'fast' } });
     240        jQuery('#container > ul').tabs();
    237241    <?php } ?>
    238242    });
     
    255259    <div id="container">
    256260        <ul>
    257             <li><a href="<?php echo clean_url(add_query_arg('tab', 'text')) ?>"><span><?php _e('Text/Link') ?></span></a></li>
    258             <li><a href="<?php echo clean_url(add_query_arg('tab', 'photo')) ?>"><span><?php _e('Photo') ?></span></a></li>
    259             <li><a href="<?php echo clean_url(add_query_arg('tab', 'quote')) ?>"><span><?php _e('Quote') ?></span></a></li>
    260             <li><a href="<?php echo clean_url(add_query_arg('tab', 'video')) ?>"><span><?php _e('Video') ?></span></a></li>
     261            <li><a href="<?php echo clean_url(add_query_arg('tab', 'text', stripslashes($_SERVER['REQUEST_URI']))) ?>"><span><?php _e('Text/Link') ?></span></a></li>
     262            <li><a href="<?php echo clean_url(add_query_arg('tab', 'photo', stripslashes($_SERVER['REQUEST_URI']))) ?>"><span><?php _e('Photo') ?></span></a></li>
     263            <li><a href="<?php echo clean_url(add_query_arg('tab', 'quote', stripslashes($_SERVER['REQUEST_URI']))) ?>"><span><?php _e('Quote') ?></span></a></li>
     264            <li><a href="<?php echo clean_url(add_query_arg('tab', 'video', stripslashes($_SERVER['REQUEST_URI']))) ?>"><span><?php _e('Video') ?></span></a></li>
    261265        </ul>
    262266    </div>
Note: See TracChangeset for help on using the changeset viewer.