Ticket #7105: press-this-5-6-08-3am.diff
| File press-this-5-6-08-3am.diff, 2.8 KB (added by , 18 years ago) |
|---|
-
wp-admin/press-this.php
89 89 } 90 90 91 91 // 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']; 94 95 95 96 if($_REQUEST['ajax'] == 'video') { ?> 96 97 <h2 id="embededcode"><label for="embed_code"><?php _e('Embed Code') ?></label></h2> … … 101 102 } 102 103 103 104 if($_REQUEST['ajax'] == 'photo_images') { 105 $url = urldecode($url); 106 $url = str_replace(' ', '%20', $url); 107 104 108 function get_images_from_uri($uri) { 105 109 $content = wp_remote_fopen($uri); 106 110 $host = parse_url($uri); … … 164 168 url: "<?php echo clean_url($_SERVER['PHP_SELF']); ?>", 165 169 cache : false, 166 170 async : false, 167 data: "ajax=photo_images&u rl=<?php echo $url?>",171 data: "ajax=photo_images&u=<?php echo urlencode($url); ?>", 168 172 dataType : "script" 169 173 }).responseText); 170 174 … … 221 225 </div> 222 226 <?php die; } 223 227 224 // Clean up the data being passed in225 $title = wp_specialchars(stripslashes($_GET['t']));226 $selection = trim(wp_specialchars(str_replace("\n", ' ',stripslashes($_GET['s']))));227 $url = clean_url($_GET['u']);228 228 ?> 229 229 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 230 230 <html xmlns="http://www.w3.org/1999/xhtml" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>> … … 355 355 jQuery('body').addClass('video_split'); 356 356 357 357 358 jQuery('#extra_fields').load('<?php echo clean_url($_SERVER['PHP_SELF']); ?>', { ajax: 'video', s election: '<?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() { 359 359 360 360 <?php 361 361 if ( preg_match("/youtube\.com\/watch/i", $url) ) { … … 387 387 set_editor('<a href="<?php echo $url; ?>"><?php echo $title; ?></a>'); 388 388 389 389 jQuery('#extra_fields').show(); 390 jQuery('#extra_fields').load('<?php echo clean_url($_SERVER['PHP_SELF']).'/?ajax=photo&u rl='.attribute_escape($url); ?>');390 jQuery('#extra_fields').load('<?php echo clean_url($_SERVER['PHP_SELF']).'/?ajax=photo&u='.attribute_escape($url); ?>'); 391 391 jQuery('#extra_fields').prepend('<h2><img src="images/loading.gif" alt="" /> Loading...</h2>'); 392 392 jQuery.ajax({ 393 393 type: "GET", 394 394 cache : false, 395 395 url: "<?php echo clean_url($_SERVER['PHP_SELF']); ?>", 396 data: "ajax=photo_js&u rl=<?php echo $url?>",396 data: "ajax=photo_js&u=<?php echo urlencode($url)?>", 397 397 dataType : "script", 398 398 success : function() { 399 399 }