Permalink
Browse files

Fix coding standards and save a function call.

  • Loading branch information...
1 parent acc6a26 commit 773666ddad93d3eb713b3c1f521a29e0d1a12a32 @markstory markstory committed Jan 18, 2013
Showing with 3 additions and 2 deletions.
  1. +2 −1 lib/Cake/Network/CakeRequest.php
  2. +1 −1 lib/Cake/Test/Case/Network/CakeRequestTest.php
@@ -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));
@@ -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);
}

0 comments on commit 773666d

Please sign in to comment.