Skip to content

Commit

Permalink
Fix an off-by-one error when parsing the index from the config
Browse files Browse the repository at this point in the history
Fixes #7 and #8
  • Loading branch information
ccoley committed Nov 2, 2018
1 parent ef1c0da commit 9114b0f
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 9114b0f

Please sign in to comment.