aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-01-24 11:33:02 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-01-24 11:33:02 +0000
commit279d5f7d6f8ee674b024a2cf3069dc4ea9567398 (patch)
tree2f3703ba69965f71d19728cc1d7b7883bd775295 /engine/lib
parentcc779b79322853898a6f4c05830b8a1c7e8b9e1f (diff)
downloadelgg-279d5f7d6f8ee674b024a2cf3069dc4ea9567398.tar.gz
elgg-279d5f7d6f8ee674b024a2cf3069dc4ea9567398.tar.bz2
Fixing access controls on multi-metadata
git-svn-id: https://code.elgg.org/elgg/trunk@2614 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/metadata.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/engine/lib/metadata.php b/engine/lib/metadata.php
index deddf8a14..8a77b69fb 100644
--- a/engine/lib/metadata.php
+++ b/engine/lib/metadata.php
@@ -659,8 +659,13 @@
$query .= " from {$CONFIG->dbprefix}entities e {$join} where";
foreach ($where as $w)
$query .= " $w and ";
- $query .= get_access_sql_suffix("e"); // Add access controls
- $query .= ' and ' . get_access_sql_suffix("m"); // Add access controls
+ $query .= get_access_sql_suffix("e"); // Add access controls
+
+ $mindex = 1;
+ foreach($meta_array as $meta_name => $meta_value) {
+ $query .= ' and ' . get_access_sql_suffix("m{$mindex}"); // Add access controls
+ $mindex++;
+ }
if (!$count) {
$query .= " order by $order_by limit $offset, $limit"; // Add order and limit