From dd4b4a30093c9e3df90f6d92962fbc8e75f15147 Mon Sep 17 00:00:00 2001 From: icewing Date: Thu, 29 May 2008 14:35:19 +0000 Subject: Marcus Povey * Simplified call_gatekeeper() git-svn-id: https://code.elgg.org/elgg/trunk@757 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/elgglib.php | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) (limited to 'engine/lib/elgglib.php') diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 9d0719a5e..3b48610c1 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -1029,18 +1029,8 @@ // If file then check using reflection that this it is being called from this function if ($file) { - $mirror = false; - - if (is_array($function)) - $mirror = new ReflectionMethod($stack_element['class'], $stack_element['function']); - else - $mirror = new ReflectionFunction($stack_element['function']); - - // Sanity check - if (!$mirror) return false; - // Check file against function - if (!strcmp($file, $mirror->getFileName())==0) + if (!strcmp($file, $stack_element['file'])==0) return false; } @@ -1048,8 +1038,27 @@ return true; } - - + /** + * This function checks to see if it is being called at somepoint by a function defined somewhere + * on a given path (optionally including subdirectories). + */ + /*function callpath_gatekeeper($path, $include_subdirs = true) + { + $path = sanitise_string($path); + + if ($path) + { + $callstack = debug_backtrace(); + + foreach ($callstack as $call) + { + if + } + } + + return false; + } +*/ // register privileged code block -- cgit v1.2.3