Skip to content

Commit

Permalink
Recognise protocols other than "http" in _links_add_base(). Props Ser…
Browse files Browse the repository at this point in the history
…geyBiryukov. 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://core.svn.wordpress.org/trunk@20466 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
duck_ committed Apr 14, 2012
1 parent 96709b8 commit 05844f4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions wp-includes/formatting.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}

Expand Down

0 comments on commit 05844f4

Please sign in to comment.