Use clean_url instead of inline preg. Props rob1n. fixes #3983 for 2.1

git-svn-id: http://svn.automattic.com/wordpress/branches/2.1@5069 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2007-03-21 03:59:08 +00:00
parent b53405b8e3
commit bcb9b83494

View File

@ -599,10 +599,10 @@ function edit_link( $link_id = '' ) {
wp_die( __( 'Cheatin’ uh?' ));
$_POST['link_url'] = wp_specialchars( $_POST['link_url'] );
$_POST['link_url'] = preg_match('/^(https?|ftps?|mailto|news|irc|gopher|nntp|feed|telnet):/is', $_POST['link_url']) ? $_POST['link_url'] : 'http://' . $_POST['link_url'];
$_POST['link_url'] = clean_url($_POST['link_url']);
$_POST['link_name'] = wp_specialchars( $_POST['link_name'] );
$_POST['link_image'] = wp_specialchars( $_POST['link_image'] );
$_POST['link_rss'] = wp_specialchars( $_POST['link_rss'] );
$_POST['link_rss'] = clean_url($_POST['link_rss']);
$_POST['link_category'] = $_POST['post_category'];
if ( !empty( $link_id ) ) {