aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/entities.php
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2011-12-08 18:24:29 -0500
committercash <cash.costello@gmail.com>2011-12-08 18:24:29 -0500
commitc6f8f70f0fd86edf35f6efdef08ff44cb0429778 (patch)
treeae97b0d2a4577c21f169f46735742dcb59fed569 /engine/lib/entities.php
parent19a8af878b74dd9e840fb45c1be4c3a61e93cd64 (diff)
parent57e3793a560b9b376b037d5bfe3f1aafaa90c78d (diff)
downloadelgg-c6f8f70f0fd86edf35f6efdef08ff44cb0429778.tar.gz
elgg-c6f8f70f0fd86edf35f6efdef08ff44cb0429778.tar.bz2
Merge branch '1.8'
Diffstat (limited to 'engine/lib/entities.php')
-rw-r--r--engine/lib/entities.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php
index dbb5ee695..daced6740 100644
--- a/engine/lib/entities.php
+++ b/engine/lib/entities.php
@@ -669,7 +669,10 @@ function get_entity($guid) {
static $newentity_cache;
$new_entity = false;
- if (!is_numeric($guid)) {
+ // We could also use: if (!(int) $guid) { return FALSE },
+ // but that evaluates to a false positive for $guid = TRUE.
+ // This is a bit slower, but more thorough.
+ if (!is_numeric($guid) || $guid === 0 || $guid === '0') {
return FALSE;
}