Commit 2eb0786d40427968a09c5e706d84a2b1144fe616

Authored by Kevin Fourie
1 parent 67607904

KTS-2861

"KTUtil::arrayGet see "0" as an empty string"
Fixed. Using isset($aArray{0}) now. Evaluates to false if $aArray is not set or if it has zero length (ie. it's first character is not set).

Committed By: Kevin Fourie
Reviewed By: Conrad Vermeulen

git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@8142 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing 1 changed file with 3 additions and 1 deletions
lib/util/ktutil.inc
@@ -229,7 +229,9 @@ class KTUtil { @@ -229,7 +229,9 @@ class KTUtil {
229 if (!is_array($aArray)) { 229 if (!is_array($aArray)) {
230 $aArray = (array) $aArray; 230 $aArray = (array) $aArray;
231 } 231 }
232 - if (empty($aArray)) { 232 +
  233 + // Evaluates to false if $aArray is not set or if it has zero length (ie. it's first character is not set).
  234 + if (!isset($aArray{0})) {
233 return $mDefault; 235 return $mDefault;
234 } 236 }
235 if (array_key_exists($sKey, $aArray)) { 237 if (array_key_exists($sKey, $aArray)) {