From 168cc20a42eacf3581d8f812dd48cc8d90c70517 Mon Sep 17 00:00:00 2001 From: markjaquith Date: Thu, 28 Jun 2012 20:30:10 +0000 Subject: [PATCH] Allow tel: and fax: protocols. Wrangle the last hardcoded protocol enumeration so that it uses wp_allowed_protocols(). fixes #21081 git-svn-id: http://core.svn.wordpress.org/trunk@21170 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/user.php | 3 ++- wp-includes/functions.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/user.php b/wp-admin/includes/user.php index ff1e91dceb..3c93a69a23 100644 --- a/wp-admin/includes/user.php +++ b/wp-admin/includes/user.php @@ -69,7 +69,8 @@ function edit_user( $user_id = 0 ) { $user->user_url = ''; } else { $user->user_url = esc_url_raw( $_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; + $protocols = implode( '|', array_map( 'preg_quote', wp_allowed_protocols() ) ); + $user->user_url = preg_match('/^(' . $protocols . '):/is', $user->user_url) ? $user->user_url : 'http://'.$user->user_url; } } if ( isset( $_POST['first_name'] ) ) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 60f1fa27a3..ec437da018 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -3508,7 +3508,7 @@ function wp_allowed_protocols() { static $protocols; if ( empty( $protocols ) ) { - $protocols = array( 'http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet', 'mms', 'rtsp', 'svn' ); + $protocols = array( 'http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet', 'mms', 'rtsp', 'svn', 'tel', 'fax' ); $protocols = apply_filters( 'kses_allowed_protocols', $protocols ); }