Skip to content

Commit

Permalink
addCreateButton() validate $copyCount
Browse files Browse the repository at this point in the history
  • Loading branch information
MartkCz committed Apr 24, 2018
1 parent 8c5161d commit 6c97b58
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Multiplier.php
Expand Up @@ -212,7 +212,7 @@ public function addRemoveButton($caption = null, callable $onCreate = null) {
*/
public function addCreateButton($caption = null, $copyCount = 1, callable $onCreate = null) {
if ($caption !== false) {
$this->createButtons[$copyCount] = [$caption, $copyCount, $onCreate];
$this->createButtons[$copyCount] = [$caption, $copyCount < 1 ? 1 : (int) $copyCount, $onCreate];
} else {
unset($this->createButtons[$copyCount]);
}
Expand Down

0 comments on commit 6c97b58

Please sign in to comment.