From 1ff620a1142c8b708ad03d03cdbc380aedff761e Mon Sep 17 00:00:00 2001 From: Seth Phillips Date: Mon, 23 Jul 2018 09:34:02 -0500 Subject: [PATCH] strict comparison for getting array value by key When getting errors, loose equality sometimes matches the 0 index of the array of errors and not the nested 'Errors' key. This results in an index 'Number' not found exception on `$this->setErrorCode($errorInfo['Number']);` --- src/USPSBase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/USPSBase.php b/src/USPSBase.php index 83653ba..517ea8f 100644 --- a/src/USPSBase.php +++ b/src/USPSBase.php @@ -431,7 +431,7 @@ public function getErrorMessage() protected function getValueByKey($array, $key) { foreach ($array as $k => $each) { - if ($k == $key) { + if ($k === $key) { return $each; }