From f9361ef7f5fb17f5f47074df2482ed4bba96416c Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Fri, 5 Feb 2010 12:45:21 +0000 Subject: [PATCH] Simplify https:// conversion in plugins_url()/content_url() functions git-svn-id: https://develop.svn.wordpress.org/trunk@12964 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/link-template.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 2cb8d96ece..6d1ca2842f 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -1838,12 +1838,9 @@ function includes_url($path = '') { * @return string Content url link with optional path appended. */ function content_url($path = '') { - $scheme = ( is_ssl() ? 'https' : 'http' ); $url = WP_CONTENT_URL; - if ( 0 === strpos($url, 'http') ) { - if ( is_ssl() ) - $url = str_replace( 'http://', "{$scheme}://", $url ); - } + if ( 0 === strpos($url, 'http') && is_ssl() ) + $url = str_replace( 'http://', 'https://', $url ); if ( !empty($path) && is_string($path) && strpos($path, '..') === false ) $url .= '/' . ltrim($path, '/'); @@ -1863,7 +1860,6 @@ function content_url($path = '') { * @return string Plugins url link with optional path appended. */ function plugins_url($path = '', $plugin = '') { - $scheme = ( is_ssl() ? 'https' : 'http' ); $mu_plugin_dir = WPMU_PLUGIN_DIR; foreach ( array('path', 'plugin', 'mu_plugin_dir') as $var ) { @@ -1877,7 +1873,7 @@ function plugins_url($path = '', $plugin = '') { $url = WP_PLUGIN_URL; if ( 0 === strpos($url, 'http') && is_ssl() ) - $url = str_replace( 'http://', "{$scheme}://", $url ); + $url = str_replace( 'http://', 'https://', $url ); if ( !empty($plugin) && is_string($plugin) ) { $folder = dirname(plugin_basename($plugin));