Changeset 12752 for trunk/wp-admin/press-this.php
- Timestamp:
- 01/18/2010 08:34:48 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/press-this.php
r12733 r12752 39 39 40 40 $upload = false; 41 if ( !empty($_POST['photo_src']) && current_user_can('upload_files') ) {41 if ( !empty($_POST['photo_src']) && current_user_can('upload_files') ) { 42 42 foreach( (array) $_POST['photo_src'] as $key => $image) { 43 43 // see if files exist in content - we don't want to upload non-used selected files. … … 47 47 48 48 // Replace the POSTED content <img> with correct uploaded ones. Regex contains fix for Magic Quotes 49 if ( !is_wp_error($upload) )49 if ( !is_wp_error($upload) ) 50 50 $content = preg_replace('/<img ([^>]*)src=\\\?(\"|\')'.preg_quote(htmlspecialchars($image), '/').'\\\?(\2)([^>\/]*)\/*>/is', $upload, $content); 51 51 } … … 185 185 function get_images_from_uri($uri) { 186 186 $uri = preg_replace('/\/#.+?$/','', $uri); 187 if ( preg_match('/\.(jpg|jpe|jpeg|png|gif)$/', $uri) && !strpos($uri,'blogger.com') )187 if ( preg_match('/\.(jpg|jpe|jpeg|png|gif)$/', $uri) && !strpos($uri,'blogger.com') ) 188 188 return "'" . esc_attr( html_entity_decode($uri) ) . "'"; 189 189 $content = wp_remote_fopen($uri); … … 199 199 foreach ($matches[3] as $src) { 200 200 // if no http in url 201 if (strpos($src, 'http') === false)201 if (strpos($src, 'http') === false) 202 202 // if it doesn't have a relative uri 203 if ( strpos($src, '../') === false && strpos($src, './') === false && strpos($src, '/') === 0)203 if ( strpos($src, '../') === false && strpos($src, './') === false && strpos($src, '/') === 0) 204 204 $src = 'http://'.str_replace('//','/', $host['host'].'/'.$src); 205 205 else … … 554 554 <a title="<?php _e('Embed a Video'); ?>" href="#"><img alt="<?php _e('Embed a Video'); ?>" src="images/media-button-video.gif"/></a> 555 555 </li> 556 <?php if ( user_can_richedit() ) { ?>556 <?php if ( user_can_richedit() ) { ?> 557 557 <li id="switcher"> 558 558 <?php wp_print_scripts( 'quicktags' ); ?>
Note: See TracChangeset
for help on using the changeset viewer.