Permalink
Browse files

Fixed performance bug in URL class.

  • Loading branch information...
1 parent f71288b commit 76c0bdf5f04a13e6d131ffc1c21b82a25d8929ef @mvied committed Apr 20, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/WordPressHTTPS/Url.php
@@ -158,7 +158,9 @@ public function getBaseHost() {
$test_url = clone $this;
$host_parts = explode('.', $test_url->getHost());
for ( $i = 0; $i <= sizeof($host_parts); $i++ ) {
- if ( $test_url->setHost( str_replace($host_parts[$i] . '.', '', $test_url->getHost()) )->isValid() ) {
+ $test_url->setHost( str_replace($host_parts[$i] . '.', '', $test_url->getHost()) );
+ $test_url->setPath('');
+ if ( $test_url->isValid() ) {
$return_url = clone $test_url;
} else {
break;

0 comments on commit 76c0bdf

Please sign in to comment.