From 7d8a08881eba94b52028b5a045465cdfb63c0b34 Mon Sep 17 00:00:00 2001 From: duck_ Date: Sat, 14 Apr 2012 19:14:10 +0000 Subject: [PATCH] Recognise protocols other than "http" in _links_add_base(). Props SergeyBiryukov. Fixes #19665. Previously "https" URLs used in plugin READMEs displayed by install_plugin_information() would have the plugin's extend URL prepended. git-svn-id: http://svn.automattic.com/wordpress/trunk@20466 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/formatting.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 2c8a2b9aa7..a02fd17e1c 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -2981,9 +2981,9 @@ function _links_add_base($m) { global $_links_add_base; //1 = attribute name 2 = quotation mark 3 = URL return $m[1] . '=' . $m[2] . - (strpos($m[3], 'http://') === false ? - path_join($_links_add_base, $m[3]) : - $m[3]) + ( preg_match( '#^(\w{1,20}):#', $m[3], $protocol ) && in_array( $protocol[1], wp_allowed_protocols() ) ? + $m[3] : + path_join( $_links_add_base, $m[3] ) ) . $m[2]; }