Commit 25cb7849101b1760affda50d3af4557f64ab4ab8

Authored by nbm
1 parent 16e92152

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.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@3200 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing 1 changed file with 6 additions and 0 deletions
lib/browse/Criteria.inc
... ... @@ -480,6 +480,12 @@ class Criteria {
480 480 global $aBaseCriteria;
481 481 global $default;
482 482 Criteria::initCriteria();
  483 +
  484 + // array_key_exists 4.3.2 (at least, tested on RHEL3) returns
  485 + // false if '-1' (the string) is the key given, and the real key
  486 + // is -1 (the integer).
  487 + $iID = (int)$iID;
  488 +
483 489 if (array_key_exists($iID, $aBaseCriteria)) {
484 490 return $aBaseCriteria[$iID];
485 491 } else {
... ...