From 370bd44782258ca90e45672243da5808f362aab6 Mon Sep 17 00:00:00 2001 From: ben Date: Thu, 10 Jul 2008 09:15:56 +0000 Subject: Fixed issue with get_plugin_name and pagehandlers. git-svn-id: https://code.elgg.org/elgg/trunk@1383 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/plugins.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'engine/lib') diff --git a/engine/lib/plugins.php b/engine/lib/plugins.php index 4955c97c3..b92ffd72d 100644 --- a/engine/lib/plugins.php +++ b/engine/lib/plugins.php @@ -99,10 +99,16 @@ } } else { $file = $_SERVER["SCRIPT_NAME"]; - $file = str_replace("\\","/",$file); - $file = str_replace("//","/",$file); - if (preg_match("/mod\/([a-zA-Z0-9\-\_]*)\//",$file,$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 = str_replace("\\","/",$file); + $file = str_replace("//","/",$file); + if (preg_match("/mod\/([a-zA-Z0-9\-\_]*)\//",$file,$matches)) { + return $matches[1]; + } } } return false; -- cgit v1.2.3