Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Request->_url gives wrong url for request_uri like controller/test:1 #562

Merged
merged 1 commit into from

2 participants

@hans-d

Testcase

'REQUEST_URI' => '/test_app/pages/test_app/test:a' should return 'pages/test_app/test:a' [ok]

'REQUEST_URI' => '/test_app/pages/test_app/test:1' should return 'pages/test_app/test:1' [fail: returns '/']

@nateabele
Owner

The indentation in this patch looks way off. Please make sure you're consistently indenting with tabs and not spaces.

@nateabele
Owner

There are still two lines indented with spaces, sorry. (See https://github.com/UnionOfRAD/lithium/pull/562.patch). Can you squash the commits when you're done? Thanks.

@hans-d

In total there where 2 lines with spaces, should now be fixed...

@nateabele
Owner

Perfect!

@nateabele nateabele merged commit 5e48385 into UnionOfRAD:dev
@hans-d

thnx for the fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 10, 2012
  1. @hans-d

    test for REQUEST_URI pages/test_app_test:<something>

    hans-d authored
    fails for numeric argument
This page is out of date. Refresh to see the latest.
Showing with 17 additions and 0 deletions.
  1. +17 −0 tests/cases/action/RequestTest.php
View
17 tests/cases/action/RequestTest.php
@@ -177,6 +177,23 @@ public function testRequestWithoutUrlQueryParam() {
$this->assertEqual('pages/test_app', $request->url);
}
+ public function testRequestWithColon() {
+ unset($_GET['url']);
+ $request = new Request(array('env' => array(
+ 'PHP_SELF' => '/test_app/app/webroot/index.php',
+ 'REQUEST_URI' => '/test_app/pages/test_app/test:a'
+ )));
+ $this->assertEqual('/test_app', $request->env('base'));
+ $this->assertEqual('pages/test_app/test:a', $request->url);
+
+ $request = new Request(array('env' => array(
+ 'PHP_SELF' => '/test_app/app/webroot/index.php',
+ 'REQUEST_URI' => '/test_app/pages/test_app/test:1'
+ )));
+ $this->assertEqual('/test_app', $request->env('base'));
+ $this->assertEqual('pages/test_app/test:1', $request->url);
+ }
+
public function testRequestWithoutUrlQueryParamAndNoApp() {
unset($_GET['url']);
$request = new Request(array('env' => array(
Something went wrong with that request. Please try again.