Skip to content

Commit

Permalink
Fix coding standards and save a function call.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Jan 18, 2013
1 parent acc6a26 commit 773666d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/Cake/Network/CakeRequest.php
Expand Up @@ -232,7 +232,8 @@ protected function _url() {
} elseif (isset($_SERVER['REQUEST_URI']) && strpos($_SERVER['REQUEST_URI'], '://') === false) {
$uri = $_SERVER['REQUEST_URI'];
} elseif (isset($_SERVER['REQUEST_URI'])) {
if (strpos($_SERVER['REQUEST_URI'], '?') !== false && strpos($_SERVER['REQUEST_URI'], '://') > strpos($_SERVER['REQUEST_URI'], '?')) {
$qPosition = strpos($_SERVER['REQUEST_URI'], '?');
if ($qPosition !== false && strpos($_SERVER['REQUEST_URI'], '://') > $qPosition) {
$uri = $_SERVER['REQUEST_URI'];
} else {
$uri = substr($_SERVER['REQUEST_URI'], strlen(FULL_BASE_URL));
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/Network/CakeRequestTest.php
Expand Up @@ -141,7 +141,7 @@ public function testQueryStringAndNamedParams() {
$request = new CakeRequest();
$this->assertEquals('some/path', $request->url);

$_SERVER['REQUEST_URI'] = FULL_BASE_URL.'/other/path?url=http://cakephp.org';
$_SERVER['REQUEST_URI'] = FULL_BASE_URL . '/other/path?url=http://cakephp.org';
$request = new CakeRequest();
$this->assertEquals('other/path', $request->url);
}
Expand Down

0 comments on commit 773666d

Please sign in to comment.