From 1fc2307faba7f280e9251de54504122a1dcb187e Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Sun, 8 Feb 2009 02:21:28 +0000 Subject: rollback r20001-r19998, r19995. This may require a reinstall --- core/helpers/MY_url.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'core/helpers/MY_url.php') diff --git a/core/helpers/MY_url.php b/core/helpers/MY_url.php index c5f2d16c..dd3682df 100644 --- a/core/helpers/MY_url.php +++ b/core/helpers/MY_url.php @@ -19,9 +19,9 @@ */ class url extends url_Core { static function site($uri, $protocol=false) { - $parts = explode("/", $uri, 3); - if ($parts[0] == "albums" || $parts[0] == "photos") { - $uri = ORM::factory("item", empty($parts[1]) ? 1 : $parts[1])->relative_path(); + list($controller, $arg1, $args) = explode("/", $uri, 3); + if ($controller == "albums" || $controller == "photos") { + $uri = ORM::factory("item", $arg1)->relative_path(); } return parent::site($uri, $protocol); } @@ -33,7 +33,7 @@ class url extends url_Core { $count = count(Router::$segments); foreach (ORM::factory("item") - ->where("path", Router::$segments[$count - 1]) + ->where("name", Router::$segments[$count - 1]) ->where("level", $count + 1) ->find_all() as $match) { if ($match->relative_path() == Router::$current_uri) { -- cgit v1.2.3