Fix coding standards and save a function call.

This commit is contained in:
mark_story 2013-01-17 20:34:25 -05:00
parent acc6a2645f
commit 773666ddad
2 changed files with 3 additions and 2 deletions

View file

@ -232,7 +232,8 @@ class CakeRequest implements ArrayAccess {
} 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));

View file

@ -141,7 +141,7 @@ class CakeRequestTest extends CakeTestCase {
$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);
}