aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/metadata.php
diff options
context:
space:
mode:
authorMatt Beckett <beck24@gmail.com>2013-10-10 13:29:50 -0700
committerPaweł Sroka <srokap@gmail.com>2013-10-27 13:07:37 +0100
commit1e884c6abe933468ecfa035780bd3e9ff5e1ad61 (patch)
tree1775be41fe40c8b73c800f0c918e7d49503c2f68 /engine/lib/metadata.php
parent882866430efa4374206fc7289e2a7ab70ac5abf8 (diff)
downloadelgg-1e884c6abe933468ecfa035780bd3e9ff5e1ad61.tar.gz
elgg-1e884c6abe933468ecfa035780bd3e9ff5e1ad61.tar.bz2
#5952 - fix infinite loop when disabling > 50 annotations or metadata
Diffstat (limited to 'engine/lib/metadata.php')
-rw-r--r--engine/lib/metadata.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/engine/lib/metadata.php b/engine/lib/metadata.php
index d2f8d4cd4..fdb1b85f6 100644
--- a/engine/lib/metadata.php
+++ b/engine/lib/metadata.php
@@ -333,9 +333,13 @@ function elgg_disable_metadata(array $options) {
}
elgg_get_metadata_cache()->invalidateByOptions('disable', $options);
+
+ // if we can see hidden (disabled) we need to use the offset
+ // otherwise we risk an infinite loop if there are more than 50
+ $inc_offset = access_get_show_hidden_status();
$options['metastring_type'] = 'metadata';
- return elgg_batch_metastring_based_objects($options, 'elgg_batch_disable_callback', false);
+ return elgg_batch_metastring_based_objects($options, 'elgg_batch_disable_callback', $inc_offset);
}
/**