Skip to content

Commit

Permalink
Merge pull request #10423 from dreamsxin/10421
Browse files Browse the repository at this point in the history
Fix bug #10421
  • Loading branch information
andresgutierrez committed May 28, 2015
2 parents bd291e9 + d9f411f commit 669264d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion phalcon/mvc/url.zep
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ class Url implements UrlInterface, InjectionAwareInterface
if args {
let queryString = http_build_query(args);
if typeof queryString == "string" && strlen(queryString) {
if strpos(queryString, "?") !== false {
if strpos(uri, "?") !== false {
let uri .= "&" . queryString;
} else {
let uri .= "?" . queryString;
Expand Down
4 changes: 4 additions & 0 deletions unit-tests/UrlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,9 @@ public function testGet()
$this->assertEquals('http://www.test.com/', $url->get(''));
$this->assertEquals('http://www.test.com/', $url->get('/'));
$this->assertEquals('http://www.test.com/path', $url->get('/path'));

$url->setBaseUri('http://www.test.com/?_url=/');

$this->assertEquals('http://www.test.com/?_url=/path&params=one', $url->get('/path', array('params' => 'one')));
}
}

0 comments on commit 669264d

Please sign in to comment.