| 1 | Index: wp-admin/includes/media.php |
|---|
| 2 | =================================================================== |
|---|
| 3 | --- wp-admin/includes/media.php (revision 18607) |
|---|
| 4 | +++ wp-admin/includes/media.php (working copy) |
|---|
| 5 | @@ -636,7 +636,7 @@ |
|---|
| 6 | if ( !empty($href) && !strpos($href, '://') ) |
|---|
| 7 | $href = "http://$href"; |
|---|
| 8 | |
|---|
| 9 | - $title = esc_attr($_POST['insertonly']['title']); |
|---|
| 10 | + $title = esc_attr(stripslashes($_POST['insertonly']['title'])); |
|---|
| 11 | if ( empty($title) ) |
|---|
| 12 | $title = esc_attr( basename($href) ); |
|---|
| 13 | |
|---|
| 14 | @@ -695,8 +695,8 @@ |
|---|
| 15 | if ( !empty($href) && !strpos($href, '://') ) |
|---|
| 16 | $href = "http://$href"; |
|---|
| 17 | |
|---|
| 18 | - $title = esc_attr($_POST['insertonly']['title']); |
|---|
| 19 | - if ( empty($title) ) |
|---|
| 20 | + $title = esc_attr(stripslashes($_POST['insertonly']['title'])); |
|---|
| 21 | + if ( empty($title) ) |
|---|
| 22 | $title = esc_attr( basename($href) ); |
|---|
| 23 | |
|---|
| 24 | if ( !empty($title) && !empty($href) ) |
|---|
| 25 | @@ -754,12 +754,15 @@ |
|---|
| 26 | if ( !empty($href) && !strpos($href, '://') ) |
|---|
| 27 | $href = "http://$href"; |
|---|
| 28 | |
|---|
| 29 | - $title = esc_attr($_POST['insertonly']['title']); |
|---|
| 30 | + $title = esc_attr(stripslashes($_POST['insertonly']['title'])); |
|---|
| 31 | if ( empty($title) ) |
|---|
| 32 | $title = basename($href); |
|---|
| 33 | + |
|---|
| 34 | if ( !empty($title) && !empty($href) ) |
|---|
| 35 | $html = "<a href='" . esc_url($href) . "' >$title</a>"; |
|---|
| 36 | + |
|---|
| 37 | $html = apply_filters('file_send_to_editor_url', $html, esc_url_raw($href), $title); |
|---|
| 38 | + |
|---|
| 39 | return media_send_to_editor($html); |
|---|
| 40 | } |
|---|
| 41 | |
|---|