Skip to content
This repository
Browse code

Remove separated host parts for simplicity.

  • Loading branch information...
commit 4af828f543005e670f4186669dd00f9f19975f57 1 parent 417f13a
Mike Ems authored March 31, 2013
8  lib/WordPressHTTPS/Module/UrlMapping.php
@@ -46,8 +46,8 @@ public function map_http_url( $url ) {
46 46
 				if ( !is_array($mapping) || @$mapping[0]['scheme'] != 'https' ) {
47 47
 					continue;
48 48
 				}
49  
-				$http_url = 'http://' . @$mapping[1]['host'] . ( isset($mapping[1]['port']) ? ':' . $mapping[1]['port'] : '' ) . @$mapping[1]['path'];
50  
-				$https_url = 'https://' . @$mapping[0]['host'] . ( isset($mapping[0]['port']) ? ':' . $mapping[0]['port'] : '' ) . @$mapping[0]['path'];
  49
+				$http_url = 'http://' . @$mapping[1]['host'];
  50
+				$https_url = 'https://' . @$mapping[0]['host'];
51 51
 				preg_match('|' . $https_url . '|', $url, $matches);
52 52
 				if ( sizeof($matches) > 0 ) {
53 53
 					$url = preg_replace('|' . $https_url . '|', $http_url, $url);
@@ -69,8 +69,8 @@ public function map_https_url( $url ) {
69 69
 				if ( !is_array($mapping) || @$mapping[0]['scheme'] != 'http' ) {
70 70
 					continue;
71 71
 				}
72  
-				$http_url = 'http://' . @$mapping[0]['host'] . ( isset($mapping[0]['port']) ? ':' . $mapping[0]['port'] : '' ) . @$mapping[0]['path'];
73  
-				$https_url = 'https://' . @$mapping[1]['host'] . ( isset($mapping[1]['port']) ? ':' . $mapping[1]['port'] : '' ) . @$mapping[1]['path'];
  72
+				$http_url = 'http://' . @$mapping[0]['host'];
  73
+				$https_url = 'https://' . @$mapping[1]['host'];
74 74
 				preg_match('|' . $http_url . '|', $url, $matches);
75 75
 				if ( sizeof($matches) > 0 ) {
76 76
 					$url = preg_replace('|' . $http_url . '|', $https_url, $url);
4  view/metabox/url_mapping.php
@@ -63,7 +63,7 @@
63 63
 			<span class="label">://</span>
64 64
 		</td>
65 65
 		<td class="host">
66  
-			<input type="text" name="url_mapping[host][]" value="<?php echo @$mapping[0]['host'] . ( isset($mapping[0]['port']) ? ':' . $mapping[0]['port'] : '' ) . @$mapping[0]['path']; ?>" />
  66
+			<input type="text" name="url_mapping[host][]" value="<?php echo @$mapping[0]['host']; ?>" />
67 67
 		</td>
68 68
 		<td class="sep url-sep">
69 69
 			<span class="label">&gt;</span>
@@ -78,7 +78,7 @@
78 78
 			<span class="label">://</span>
79 79
 		</td>
80 80
 		<td class="host">
81  
-			<input type="text" name="url_mapping[host][]" value="<?php echo @$mapping[1]['host'] . ( isset($mapping[1]['port']) ? ':' . $mapping[1]['port'] : '' ) . @$mapping[1]['path']; ?>" />
  81
+			<input type="text" name="url_mapping[host][]" value="<?php echo @$mapping[1]['host']; ?>" />
82 82
 		</td>
83 83
 		<td class="controls">
84 84
 			<a class="remove" href="#" title="<?php _e('Remove URL Mapping','wordpress-https'); ?>"><?php _e('Remove','wordpress-https'); ?></a>

0 notes on commit 4af828f

Please sign in to comment.
Something went wrong with that request. Please try again.