From c406571bd2a014dac3b4a023f96ec6331eb788b0 Mon Sep 17 00:00:00 2001 From: ben Date: Fri, 18 Jul 2008 11:40:34 +0000 Subject: Improvements to get_context git-svn-id: https://code.elgg.org/elgg/trunk@1466 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/pageowner.php | 3 ++- engine/lib/plugins.php | 9 ++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'engine/lib') diff --git a/engine/lib/pageowner.php b/engine/lib/pageowner.php index 9e04fdb5c..607fb6629 100644 --- a/engine/lib/pageowner.php +++ b/engine/lib/pageowner.php @@ -140,8 +140,9 @@ if (isset($CONFIG->context) && !empty($CONFIG->context)) { return $CONFIG->context; } - if ($context = get_plugin_name(true)) + if ($context = get_plugin_name(true)) { return $context; + } return "main"; } diff --git a/engine/lib/plugins.php b/engine/lib/plugins.php index b92ffd72d..51a47601d 100644 --- a/engine/lib/plugins.php +++ b/engine/lib/plugins.php @@ -98,12 +98,11 @@ } } } else { - $file = $_SERVER["SCRIPT_NAME"]; - if (substr_count($file,'handlers/pagehandler')) { - if (preg_match("/pg\/([a-zA-Z0-9\-\_]*)\//",$_SERVER['REQUEST_URI'],$matches)) { - return $matches[1]; - } + //if (substr_count($file,'handlers/pagehandler')) { + if (preg_match("/pg\/([a-zA-Z0-9\-\_]*)\//",$_SERVER['REQUEST_URI'],$matches)) { + return $matches[1]; } else { + $file = $_SERVER["SCRIPT_NAME"]; $file = str_replace("\\","/",$file); $file = str_replace("//","/",$file); if (preg_match("/mod\/([a-zA-Z0-9\-\_]*)\//",$file,$matches)) { -- cgit v1.2.3