Permalink
Browse files

Remove separated host parts for simplicity.

  • Loading branch information...
1 parent 417f13a commit 4af828f543005e670f4186669dd00f9f19975f57 @mvied committed Mar 31, 2013
Showing with 6 additions and 6 deletions.
  1. +4 −4 lib/WordPressHTTPS/Module/UrlMapping.php
  2. +2 −2 view/metabox/url_mapping.php
View
8 lib/WordPressHTTPS/Module/UrlMapping.php
@@ -46,8 +46,8 @@ public function map_http_url( $url ) {
if ( !is_array($mapping) || @$mapping[0]['scheme'] != 'https' ) {
continue;
}
- $http_url = 'http://' . @$mapping[1]['host'] . ( isset($mapping[1]['port']) ? ':' . $mapping[1]['port'] : '' ) . @$mapping[1]['path'];
- $https_url = 'https://' . @$mapping[0]['host'] . ( isset($mapping[0]['port']) ? ':' . $mapping[0]['port'] : '' ) . @$mapping[0]['path'];
+ $http_url = 'http://' . @$mapping[1]['host'];
+ $https_url = 'https://' . @$mapping[0]['host'];
preg_match('|' . $https_url . '|', $url, $matches);
if ( sizeof($matches) > 0 ) {
$url = preg_replace('|' . $https_url . '|', $http_url, $url);
@@ -69,8 +69,8 @@ public function map_https_url( $url ) {
if ( !is_array($mapping) || @$mapping[0]['scheme'] != 'http' ) {
continue;
}
- $http_url = 'http://' . @$mapping[0]['host'] . ( isset($mapping[0]['port']) ? ':' . $mapping[0]['port'] : '' ) . @$mapping[0]['path'];
- $https_url = 'https://' . @$mapping[1]['host'] . ( isset($mapping[1]['port']) ? ':' . $mapping[1]['port'] : '' ) . @$mapping[1]['path'];
+ $http_url = 'http://' . @$mapping[0]['host'];
+ $https_url = 'https://' . @$mapping[1]['host'];
preg_match('|' . $http_url . '|', $url, $matches);
if ( sizeof($matches) > 0 ) {
$url = preg_replace('|' . $http_url . '|', $https_url, $url);
View
4 view/metabox/url_mapping.php
@@ -63,7 +63,7 @@
<span class="label">://</span>
</td>
<td class="host">
- <input type="text" name="url_mapping[host][]" value="<?php echo @$mapping[0]['host'] . ( isset($mapping[0]['port']) ? ':' . $mapping[0]['port'] : '' ) . @$mapping[0]['path']; ?>" />
+ <input type="text" name="url_mapping[host][]" value="<?php echo @$mapping[0]['host']; ?>" />
</td>
<td class="sep url-sep">
<span class="label">&gt;</span>
@@ -78,7 +78,7 @@
<span class="label">://</span>
</td>
<td class="host">
- <input type="text" name="url_mapping[host][]" value="<?php echo @$mapping[1]['host'] . ( isset($mapping[1]['port']) ? ':' . $mapping[1]['port'] : '' ) . @$mapping[1]['path']; ?>" />
+ <input type="text" name="url_mapping[host][]" value="<?php echo @$mapping[1]['host']; ?>" />
</td>
<td class="controls">
<a class="remove" href="#" title="<?php _e('Remove URL Mapping','wordpress-https'); ?>"><?php _e('Remove','wordpress-https'); ?></a>

0 comments on commit 4af828f

Please sign in to comment.