diff options
author | Cash Costello <cash.costello@gmail.com> | 2011-12-07 07:30:41 -0500 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2011-12-07 07:30:41 -0500 |
commit | f495e126face142bb1d09eb3fcd20ecddd050c64 (patch) | |
tree | 75570afb190dbb9cbf46fc9ede328b5da3a12fbe /engine/lib | |
parent | f0b45d1f1982cd716b9a536cfca16157bafa86c3 (diff) | |
parent | 7591e47ca63159e6324090bde7063ba53af8bfe6 (diff) | |
download | elgg-f495e126face142bb1d09eb3fcd20ecddd050c64.tar.gz elgg-f495e126face142bb1d09eb3fcd20ecddd050c64.tar.bz2 |
Merge pull request #104 from janeklb/t4187
Diffstat (limited to 'engine/lib')
-rw-r--r-- | engine/lib/entities.php | 5 |
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; } |