summaryrefslogtreecommitdiff
path: root/core/helpers/MY_url.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/helpers/MY_url.php')
-rw-r--r--core/helpers/MY_url.php8
1 files changed, 4 insertions, 4 deletions
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) {