Make WordPress Core

Ticket #14996: 14996.2.diff

File 14996.2.diff, 1.3 KB (added by kirasong, 14 years ago)

Got rid of the coding standards tabbing fix, since there are a lot more instances. That'll be for a different patch.

  • wp-admin/includes/media.php

     
    636636                if ( !empty($href) && !strpos($href, '://') )
    637637                        $href = "http://$href";
    638638
    639                 $title = esc_attr($_POST['insertonly']['title']);
     639                $title = esc_attr(stripslashes($_POST['insertonly']['title']));
    640640                if ( empty($title) )
    641641            $title = esc_attr( basename($href) );
    642642
     
    695695                if ( !empty($href) && !strpos($href, '://') )
    696696                        $href = "http://$href";
    697697
    698                 $title = esc_attr($_POST['insertonly']['title']);
     698                $title = esc_attr(stripslashes($_POST['insertonly']['title']));
    699699        if ( empty($title) )
    700700            $title = esc_attr( basename($href) );
    701701
     
    754754                if ( !empty($href) && !strpos($href, '://') )
    755755                        $href = "http://$href";
    756756
    757                 $title = esc_attr($_POST['insertonly']['title']);
     757                $title = esc_attr(stripslashes($_POST['insertonly']['title']));
    758758                if ( empty($title) )
    759759                        $title = basename($href);
     760
    760761                if ( !empty($title) && !empty($href) )
    761762                        $html = "<a href='" . esc_url($href) . "' >$title</a>";
     763
    762764                $html = apply_filters('file_send_to_editor_url', $html, esc_url_raw($href), $title);
     765
    763766                return media_send_to_editor($html);
    764767        }
    765768