From 25cb7849101b1760affda50d3af4557f64ab4ab8 Mon Sep 17 00:00:00 2001 From: nbm Date: Mon, 24 Jan 2005 18:35:27 +0000 Subject: [PATCH] Make sure the id given is an integer. array_key_exists in some versions or configurations of PHP will not consider a string and an integer as equivalent. --- lib/browse/Criteria.inc | 6 ++++++ 1 file changed, 6 insertions(+), 0 deletions(-) diff --git a/lib/browse/Criteria.inc b/lib/browse/Criteria.inc index 2676fd9..4e8765a 100644 --- a/lib/browse/Criteria.inc +++ b/lib/browse/Criteria.inc @@ -480,6 +480,12 @@ class Criteria { global $aBaseCriteria; global $default; Criteria::initCriteria(); + + // array_key_exists 4.3.2 (at least, tested on RHEL3) returns + // false if '-1' (the string) is the key given, and the real key + // is -1 (the integer). + $iID = (int)$iID; + if (array_key_exists($iID, $aBaseCriteria)) { return $aBaseCriteria[$iID]; } else { -- libgit2 0.21.4