site_url filter

git-svn-id: http://svn.automattic.com/wordpress/trunk@8672 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-08-19 19:41:11 +00:00
parent 3911137835
commit 0348a10d49
1 changed files with 2 additions and 1 deletions

View File

@ -789,6 +789,7 @@ function get_shortcut_link() {
*/ */
function site_url($path = '', $scheme = null) { function site_url($path = '', $scheme = null) {
// should the list of allowed schemes be maintained elsewhere? // should the list of allowed schemes be maintained elsewhere?
$orig_scheme = $scheme;
if ( !in_array($scheme, array('http', 'https')) ) { if ( !in_array($scheme, array('http', 'https')) ) {
if ( ('login_post' == $scheme) && ( force_ssl_login() || force_ssl_admin() ) ) if ( ('login_post' == $scheme) && ( force_ssl_login() || force_ssl_admin() ) )
$scheme = 'https'; $scheme = 'https';
@ -805,7 +806,7 @@ function site_url($path = '', $scheme = null) {
if ( !empty($path) && is_string($path) && strpos($path, '..') === false ) if ( !empty($path) && is_string($path) && strpos($path, '..') === false )
$url .= '/' . ltrim($path, '/'); $url .= '/' . ltrim($path, '/');
return $url; return apply_filters('site_url', $url, $path, $orig_scheme);
} }
/** Return the admin url /** Return the admin url