Changeset 8059

Show
Ignore:
Timestamp:
06/06/08 08:49:45 (6 months ago)
Author:
ryan
Message:

Fix url encode/decode issues in Press This. Props noel. fixes #7105

Files:

Legend:

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

    r8048 r8059  
    9090 
    9191// Ajax Requests 
    92 $url = $_REQUEST['url']; 
    93 $selection = $_REQUEST['selection']; 
     92$title = wp_specialchars(stripslashes($_GET['t'])); 
     93$selection = trim(wp_specialchars(str_replace("\n", ' ',stripslashes($_GET['s'])))); 
     94$url = $_GET['u']; 
    9495 
    9596if($_REQUEST['ajax'] == 'video') { ?> 
     
    102103 
    103104if($_REQUEST['ajax'] == 'photo_images') { 
     105$url = urldecode($url); 
     106$url = str_replace(' ', '%20', $url); 
     107 
    104108    function get_images_from_uri($uri) { 
    105109        $content = wp_remote_fopen($uri); 
     
    165169                cache : false, 
    166170                async : false, 
    167                 data: "ajax=photo_images&url=<?php echo $url?>", 
     171                data: "ajax=photo_images&u=<?php echo urlencode($url); ?>", 
    168172            dataType : "script" 
    169173            }).responseText); 
     
    222226<?php die; } 
    223227 
    224 // Clean up the data being passed in 
    225 $title = wp_specialchars(stripslashes($_GET['t'])); 
    226 $selection = trim(wp_specialchars(str_replace("\n", ' ',stripslashes($_GET['s'])))); 
    227 $url = clean_url($_GET['u']); 
    228228?> 
    229229<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
     
    356356             
    357357                 
    358                 jQuery('#extra_fields').load('<?php echo clean_url($_SERVER['PHP_SELF']); ?>', { ajax: 'video', selection: '<?php echo attribute_escape($selection); ?>'}, function() { 
     358                jQuery('#extra_fields').load('<?php echo clean_url($_SERVER['PHP_SELF']); ?>', { ajax: 'video', s: '<?php echo attribute_escape($selection); ?>'}, function() { 
    359359                     
    360360                    <?php  
     
    388388                 
    389389                jQuery('#extra_fields').show(); 
    390                 jQuery('#extra_fields').load('<?php echo clean_url($_SERVER['PHP_SELF']).'/?ajax=photo&url='.attribute_escape($url); ?>'); 
     390                jQuery('#extra_fields').load('<?php echo clean_url($_SERVER['PHP_SELF']).'/?ajax=photo&u='.attribute_escape($url); ?>'); 
    391391                jQuery('#extra_fields').prepend('<h2><img src="images/loading.gif" alt="" /> Loading...</h2>'); 
    392392                jQuery.ajax({ 
     
    394394                    cache : false, 
    395395                    url: "<?php echo clean_url($_SERVER['PHP_SELF']); ?>", 
    396                     data: "ajax=photo_js&url=<?php echo $url?>", 
     396                    data: "ajax=photo_js&u=<?php echo urlencode($url)?>", 
    397397                    dataType : "script", 
    398398                    success : function() {