Skip to content

Commit

Permalink
Account for preg_split() also returning false (#1130)
Browse files Browse the repository at this point in the history
  • Loading branch information
u01jmg3 authored Sep 18, 2024
1 parent 68c6dfa commit 509dc7c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Concerns/InteractsWithElements.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,12 @@ public function append($field, $value)
*/
public function appendSlowly($field, $value, $pause = 100)
{
foreach (preg_split('//u', $value, -1, PREG_SPLIT_NO_EMPTY) as $char) {
$this->append($field, $char)->pause($pause);
$characters = preg_split('//u', $value, -1, PREG_SPLIT_NO_EMPTY);

if (is_array($characters)) {
foreach ($characters as $character) {
$this->append($field, $character)->pause($pause);
}
}

return $this;
Expand Down

0 comments on commit 509dc7c

Please sign in to comment.