summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryoung hahn2008-08-06 15:29:46 (GMT)
committer young hahn2008-08-06 15:29:46 (GMT)
commitb41918ca60f2f240c22b885ffa4bf79d8f427e83 (patch)
tree6e795c6e8c1f73666bd5332cc771f635a70262fb
parente4b696935c3e28017c230d9c0a7f62b8b84f4ab2 (diff)
Fixing unprefixing
-rw-r--r--context_prefix/context_prefix.module8
1 files changed, 5 insertions, 3 deletions
diff --git a/context_prefix/context_prefix.module b/context_prefix/context_prefix.module
index 87e6387..c1f6b4d 100644
--- a/context_prefix/context_prefix.module
+++ b/context_prefix/context_prefix.module
@@ -209,9 +209,11 @@ function context_prefix_parse($method = CONTEXT_PREFIX_PATH, $q) {
*/
function context_prefix_unprefix($q, $providers = array()) {
$parsed = context_prefix_parse(CONTEXT_PREFIX_PATH, $q);
- if (is_array($providers)) {
- foreach ($providers as $provider) {
- unset($parsed[$provider]);
+ if (is_array($providers) && count($providers)) {
+ foreach ($parsed as $prefix => $info) {
+ if (!in_array($info['provider'], $providers)) {
+ unset($parsed[$prefix]);
+ }
}
}
$parsed = array_keys($parsed);