Don't set user's url to http://. Props josephscott. fixes #9804

git-svn-id: http://svn.automattic.com/wordpress/trunk@11320 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2009-05-13 22:41:05 +00:00
parent 8457db3774
commit 1a09fcc6ba
1 changed files with 7 additions and 3 deletions

View File

@ -88,8 +88,12 @@ function edit_user( $user_id = 0 ) {
if ( isset( $_POST['email'] )) if ( isset( $_POST['email'] ))
$user->user_email = wp_specialchars( trim( $_POST['email'] )); $user->user_email = wp_specialchars( trim( $_POST['email'] ));
if ( isset( $_POST['url'] ) ) { if ( isset( $_POST['url'] ) ) {
$user->user_url = clean_url( trim( $_POST['url'] )); if ( empty ( $_POST['url'] ) || $_POST['url'] == 'http://' ) {
$user->user_url = preg_match('/^(https?|ftps?|mailto|news|irc|gopher|nntp|feed|telnet):/is', $user->user_url) ? $user->user_url : 'http://'.$user->user_url; $user->user_url = '';
} else {
$user->user_url = clean_url( trim( $_POST['url'] ));
$user->user_url = preg_match('/^(https?|ftps?|mailto|news|irc|gopher|nntp|feed|telnet):/is', $user->user_url) ? $user->user_url : 'http://'.$user->user_url;
}
} }
if ( isset( $_POST['first_name'] )) if ( isset( $_POST['first_name'] ))
$user->first_name = wp_specialchars( trim( $_POST['first_name'] )); $user->first_name = wp_specialchars( trim( $_POST['first_name'] ));