Skip to content

Commit

Permalink
Merge pull request #9 from ccoley/fix/malformed-numerical-index
Browse files Browse the repository at this point in the history
Fix an off-by-one error when parsing the index from the config
  • Loading branch information
dspint authored Nov 3, 2018
2 parents ef1c0da + 9114b0f commit 916d5d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/zc.php
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ public function setConfig($keyChain, $val) {
$indexEnd = strpos($chain[0], "]");

if ($indexStart > -1) {
$index = (substr($chain[0], $indexStart+1, ($indexEnd-$indexStart)+1))*1;
$index = (int) substr($chain[0], $indexStart+1, ($indexEnd-$indexStart)-1);
$parentKey = substr($chain[0], 0, $indexStart);
if (count($chain[1])) {
$this->config[$parentKey][$index][$chain[1]] = $val;
Expand Down

0 comments on commit 916d5d1

Please sign in to comment.