Ticket #10056: 10056.diff
| File 10056.diff, 2.1 KB (added by ryan, 4 years ago) |
|---|
-
wp-admin/includes/media.php
486 486 $src = $_POST['insertonly']['embed-src']; 487 487 if ( !strpos($src, '://') ) 488 488 $src = "http://$src"; 489 $html = '[embed]' . $src. '[/embed]';489 $html = '[embed]' . esc_url($src) . '[/embed]'; 490 490 } else { 491 491 $src = $_POST['insertonly']['src']; 492 492 if ( !empty($src) && !strpos($src, '://') ) … … 497 497 $class = " class='align$align'"; 498 498 } 499 499 if ( !empty($src) ) 500 $html = "<img src=' $src' alt='$alt'$class />";500 $html = "<img src='" . esc_url($src) . "' alt='$alt'$class />"; 501 501 } 502 502 503 $html = apply_filters('image_send_to_editor_url', $html, $src, $alt, $align);503 $html = apply_filters('image_send_to_editor_url', $html, esc_url_raw($src), $alt, $align); 504 504 return media_send_to_editor($html); 505 505 } 506 506 … … 596 596 if ( !empty($href) && !strpos($href, '://') ) 597 597 $href = "http://$href"; 598 598 599 $html = '[embed]' . $href. '[/embed]';600 $html = apply_filters('audio_send_to_editor_url', $html, $href);599 $html = '[embed]' . esc_url($href) . '[/embed]'; 600 $html = apply_filters('audio_send_to_editor_url', $html, esc_url_raw($href)); 601 601 return media_send_to_editor($html); 602 602 } 603 603 … … 647 647 if ( !empty($href) && !strpos($href, '://') ) 648 648 $href = "http://$href"; 649 649 650 $html = '[embed]' . $href. '[/embed]';651 $html = apply_filters('video_send_to_editor_url', $html, $href);650 $html = '[embed]' . esc_url($href) . '[/embed]'; 651 $html = apply_filters('video_send_to_editor_url', $html, esc_url_raw($href)); 652 652 return media_send_to_editor($html); 653 653 } 654 654 … … 702 702 if ( empty($title) ) 703 703 $title = basename($href); 704 704 if ( !empty($title) && !empty($href) ) 705 $html = "<a href=' $href' >$title</a>";706 $html = apply_filters('file_send_to_editor_url', $html, $href, $title);705 $html = "<a href='" . esc_url($href) . "' >$title</a>"; 706 $html = apply_filters('file_send_to_editor_url', $html, esc_url_raw($href), $title); 707 707 return media_send_to_editor($html); 708 708 } 709 709
