Changeset 18992
- Timestamp:
- 10/18/2011 07:32:40 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/includes/media.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/media.php
r18982 r18992 513 513 514 514 if ( !empty($_POST['insertonlybutton']) ) { 515 $src = $_POST[' insertonly']['src'];515 $src = $_POST['src']; 516 516 if ( !empty($src) && !strpos($src, '://') ) 517 517 $src = "http://$src"; 518 518 519 519 if ( isset( $_POST['media_type'] ) && 'image' != $_POST['media_type'] ) { 520 $title = esc_ attr($_POST['insertonly']['title']);521 if ( empty( $title) )522 $title = esc_ attr( basename($src) );523 524 if ( !empty($title) && !empty($src))520 $title = esc_html( stripslashes( $_POST['title'] ) ); 521 if ( empty( $title ) ) 522 $title = esc_html( basename( $src ) ); 523 524 if ( $title && $src ) 525 525 $html = "<a href='" . esc_url($src) . "' >$title</a>"; 526 526 527 527 $type = 'file'; 528 if ( $ext = preg_replace( '/^.+?\.([^.]+)$/', '$1', $src ) && $ext_type = wp_ext2type( $ext)528 if ( ( $ext = preg_replace( '/^.+?\.([^.]+)$/', '$1', $src ) ) && ( $ext_type = wp_ext2type( $ext ) ) 529 529 && ( 'audio' == $ext_type || 'video' == $ext_type ) ) 530 530 $type = $ext_type; … … 533 533 } else { 534 534 $align = ''; 535 $alt = esc_attr( $_POST['insertonly']['alt']);536 if ( isset($_POST[' insertonly']['align']) ) {537 $align = esc_attr( $_POST['insertonly']['align']);535 $alt = esc_attr( stripslashes( $_POST['alt'] ) ); 536 if ( isset($_POST['align']) ) { 537 $align = esc_attr( stripslashes( $_POST['align'] ) ); 538 538 $class = " class='align$align'"; 539 539 } … … 1518 1518 1519 1519 getImageData : function() { 1520 if ( jQuery('table.describe').hasClass('not-image') ) 1521 return; 1522 1520 1523 var t = addExtImage, src = document.forms[0].src.value; 1521 1524 1522 if ( ! src || jQuery('table.describe').hasClass('not-image')) {1525 if ( ! src ) { 1523 1526 t.resetImageData(); 1524 1527 return false;
Note: See TracChangeset
for help on using the changeset viewer.