Permalink
Browse files

Allow for mappings to map to the same scheme.

  • Loading branch information...
1 parent 0b729fa commit 86f23661ece2a77ce2e380a066bf303c5a8af2d6 @mvied committed Mar 31, 2013
Showing with 3 additions and 3 deletions.
  1. +2 −2 lib/WordPressHTTPS/Module/UrlMapping.php
  2. +1 −1 view/metabox/url_mapping.php
@@ -43,7 +43,7 @@ public function init() {
public function map_http_url( $url ) {
if ( is_array($this->getPlugin()->getSetting('ssl_host_mapping')) && sizeof($this->getPlugin()->getSetting('ssl_host_mapping')) > 0 ) {
foreach( $this->getPlugin()->getSetting('ssl_host_mapping') as $mapping ) {
- if ( !is_array($mapping) || @$mapping[0]['scheme'] != 'https' ) {
+ if ( !is_array($mapping) || @$mapping[1]['scheme'] != 'http' ) {
continue;
}
$http_url = 'http://' . @$mapping[1]['host'];
@@ -66,7 +66,7 @@ public function map_http_url( $url ) {
public function map_https_url( $url ) {
if ( is_array($this->getPlugin()->getSetting('ssl_host_mapping')) && sizeof($this->getPlugin()->getSetting('ssl_host_mapping')) > 0 ) {
foreach( $this->getPlugin()->getSetting('ssl_host_mapping') as $mapping ) {
- if ( !is_array($mapping) || @$mapping[0]['scheme'] != 'http' ) {
+ if ( !is_array($mapping) || @$mapping[1]['scheme'] != 'https' ) {
continue;
}
$http_url = 'http://' . @$mapping[0]['host'];
@@ -165,7 +165,7 @@
e.preventDefault();
var thisSelect = this;
$(thisSelect).parents('tr').find('select').each(function(i, otherSelect) {
- if ( thisSelect != otherSelect ) {
+ if ( i > 0 && thisSelect != otherSelect ) {
if ( $(thisSelect).val() == 'http' ) {
$(otherSelect).val('https');
} else {

0 comments on commit 86f2366

Please sign in to comment.