Permalink
Browse files

Ensured that replacing HTTP version of HTTPS URL only happens when us…

…ing a different host.
  • Loading branch information...
1 parent 50a17d0 commit c6e56762ba1e86035ba4daa9d74ff754a63c7d43 @mvied committed Apr 22, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 lib/WordPressHTTPS/Module/Parser.php
@@ -200,9 +200,11 @@ public function unsecureElement( $url, $type = '' ) {
*/
public function normalizeElements() {
if ( ! is_admin() && $GLOBALS['pagenow'] != 'wp-login.php' ) {
- $url = clone $this->getPlugin()->getHttpsUrl();
- $url->setScheme('http');
- preg_match_all('/(' . str_replace('/', '\/', preg_quote($url->toString())) . '[^\'"]*)[\'"]?/im', $this->_html, $httpsMatches);
+ if ( $this->getPlugin()->getSetting('ssl_host_diff') ) {
+ $url = clone $this->getPlugin()->getHttpsUrl();
+ $url->setScheme('http');
+ preg_match_all('/(' . str_replace('/', '\/', preg_quote($url->toString())) . '[^\'"]*)[\'"]?/im', $this->_html, $httpsMatches);
+ }
$url = clone $this->getPlugin()->getHttpUrl();
$url->setScheme('https');

0 comments on commit c6e5676

Please sign in to comment.