Skip to content

Commit

Permalink
Fixes #10610
Browse files Browse the repository at this point in the history
  • Loading branch information
andresgutierrez committed Jul 20, 2015
1 parent 102ea24 commit 9abe226
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 13 deletions.
45 changes: 33 additions & 12 deletions ext/phalcon/mvc/url.zep.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion phalcon/mvc/url.zep
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ class Url implements UrlInterface, InjectionAwareInterface

let baseUri = this->_baseUri;
if baseUri === null {

if fetch phpSelf, _SERVER["PHP_SELF"] {
let uri = phalcon_get_uri(phpSelf);
} else {
Expand All @@ -120,6 +121,7 @@ class Url implements UrlInterface, InjectionAwareInterface
} else {
let baseUri = "/" . uri ."/";
}

let this->_baseUri = baseUri;
}
return baseUri;
Expand Down Expand Up @@ -172,6 +174,7 @@ class Url implements UrlInterface, InjectionAwareInterface
*/
public function get(var uri = null, var args = null, var local = null, var baseUri = null) -> string
{
string strUri;
var router, dependencyInjector, routeName, route, queryString;

if local == null {
Expand Down Expand Up @@ -227,7 +230,12 @@ class Url implements UrlInterface, InjectionAwareInterface
}

if local {
let uri = baseUri . uri;
let strUri = (string) uri;
if strlen(strUri) > 2 && strUri[0] == '/' && strUri[1] != '/' {
let uri = baseUri . substr(strUri, 1);
} else {
let uri = baseUri . strUri;
}
}

if args {
Expand Down

0 comments on commit 9abe226

Please sign in to comment.