aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-07-18 11:40:34 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-07-18 11:40:34 +0000
commitc406571bd2a014dac3b4a023f96ec6331eb788b0 (patch)
treed617e30b4062fabcb8dc81c3ba5bd5108affdc07
parentaafccab48912790f191465b60371f9ab4259d8bd (diff)
downloadelgg-c406571bd2a014dac3b4a023f96ec6331eb788b0.tar.gz
elgg-c406571bd2a014dac3b4a023f96ec6331eb788b0.tar.bz2
Improvements to get_context
git-svn-id: https://code.elgg.org/elgg/trunk@1466 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--engine/lib/pageowner.php3
-rw-r--r--engine/lib/plugins.php9
2 files changed, 6 insertions, 6 deletions
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)) {