Commit 684fae62d68ee449de997785fac267b6bbb84bd2
1 parent
6a0deb87
Make arrayGet return the object by reference, not value. Reduces some
notice-level error messages. git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@6032 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
2 additions
and
2 deletions
lib/util/ktutil.inc
| ... | ... | @@ -95,7 +95,7 @@ class KTUtil { |
| 95 | 95 | return $sString; |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | - function arrayGet($aArray, $sKey, $mDefault = null, $bDefaultIfEmpty = true) { | |
| 98 | + function &arrayGet($aArray, $sKey, $mDefault = null, $bDefaultIfEmpty = true) { | |
| 99 | 99 | if (!is_array($aArray)) { |
| 100 | 100 | $aArray = (array) $aArray; |
| 101 | 101 | } |
| ... | ... | @@ -103,7 +103,7 @@ class KTUtil { |
| 103 | 103 | return $mDefault; |
| 104 | 104 | } |
| 105 | 105 | if (array_key_exists($sKey, $aArray)) { |
| 106 | - $mVal = $aArray[$sKey]; | |
| 106 | + $mVal =& $aArray[$sKey]; | |
| 107 | 107 | if (empty($mVal) && $bDefaultIfEmpty) { |
| 108 | 108 | return $mDefault; |
| 109 | 109 | } | ... | ... |