aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-04-01 01:25:25 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-04-01 01:25:25 +0000
commit0335cb39c80d394837c2bb302a358027e0db55bb (patch)
tree97666ab65dd5fb08feac870d2eb7a8e95440a2cb
parentd637ae03eae7ef8e1c7a19d822bc58dfe29c171b (diff)
downloadelgg-0335cb39c80d394837c2bb302a358027e0db55bb.tar.gz
elgg-0335cb39c80d394837c2bb302a358027e0db55bb.tar.bz2
Refs #3245 pulling in https://github.com/Elgg/Elgg/pull/11 and thanks also to gprasanth
git-svn-id: http://code.elgg.org/elgg/trunk@8891 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--engine/lib/metastrings.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/engine/lib/metastrings.php b/engine/lib/metastrings.php
index 4218659d9..0d472a18b 100644
--- a/engine/lib/metastrings.php
+++ b/engine/lib/metastrings.php
@@ -75,7 +75,7 @@ function get_metastring_id($string, $case_sensitive = TRUE) {
$ids[] = $metaString->id;
}
return $ids;
- } else {
+ } else if ($metaStrings) {
$row = $metaStrings[0];
}
}
@@ -429,17 +429,19 @@ function elgg_get_metastring_based_objects($options) {
$query .= get_access_sql_suffix('e');
// reverse order by
- if ($options['reverse_order_by']) {
+ if (isset($options['reverse_order_by']) && $options['reverse_order_by']) {
$options['order_by'] = elgg_sql_reverse_order_by_clause($options['order_by'],
$defaults['order_by']);
}
if ($options['metastring_calculation'] === ELGG_ENTITIES_NO_VALUE) {
- if ($options['group_by'] = sanitise_string($options['group_by'])) {
+ if (isset($options['group_by'])) {
+ $options['group_by'] = sanitise_string($options['group_by']);
$query .= " GROUP BY {$options['group_by']}";
}
- if ($options['order_by'] = sanitise_string($options['order_by'])) {
+ if (isset($options['order_by']) && $options['order_by']) {
+ $options['order_by'] = sanitise_string($options['order_by']);
$query .= " ORDER BY {$options['order_by']}, n_table.id";
}