diff --git a/src/Pluf/HTTP/Response/RedirectToLogin.php b/src/Pluf/HTTP/Response/RedirectToLogin.php index 606a976..12991df 100644 --- a/src/Pluf/HTTP/Response/RedirectToLogin.php +++ b/src/Pluf/HTTP/Response/RedirectToLogin.php @@ -41,7 +41,7 @@ class Pluf_HTTP_Response_RedirectToLogin extends Pluf_HTTP_Response function __construct($request, $loginurl=null) { if ($loginurl !== null) { - $murl = new Pluf_HTTP_URL(Pluf::f('url_format')); + $murl = new Pluf_HTTP_URL(); $url = $murl->generate($loginurl, array('_redirect_after' => $request->uri), false); $encoded = $murl->generate($loginurl, array('_redirect_after' => $request->uri)); } else { diff --git a/src/Pluf/HTTP/URL.php b/src/Pluf/HTTP/URL.php index 7ff9a6d..9bf1da4 100644 --- a/src/Pluf/HTTP/URL.php +++ b/src/Pluf/HTTP/URL.php @@ -135,6 +135,17 @@ function Pluf_HTTP_URL_reverse($view, $params=array()) function Pluf_HTTP_URL_find($views, $vdef, $regbase) { foreach ($views as $dview) { + if (isset($dview['sub'])) { + $regbase2 = $regbase; + if (empty($regbase2[0])) { + $regbase2[0] = $dview['base']; + } + $regbase2[1][] = $dview['regex']; + $res = Pluf_HTTP_URL_find($dview['sub'], $vdef, $regbase2); + if ($res) { + return $res; + } + } if ( (isset($dview['name']) && $dview['name'] == $vdef[2]) or @@ -146,14 +157,6 @@ function Pluf_HTTP_URL_find($views, $vdef, $regbase) } return $regbase; } - if (isset($dview['sub'])) { - $regbase2 = $regbase; - $regbase2[1][] = $dview['regex']; - $res = Pluf_HTTP_URL_find($dview['sub'], $vdef, $regbase2); - if ($res) { - return $res; - } - } } return false; }