Skip to content

Commit e81afd9

Browse files
Return an empty string if there's no string
If `$str` is empty, an exception will appear.
1 parent 3d26005 commit e81afd9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Smartsupp/ChatGenerator.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,10 @@ public function hideWidget()
377377
*/
378378
public function javascriptEscape($str)
379379
{
380+
if (!$str) {
381+
return '';
382+
}
383+
380384
$new_str = '';
381385

382386
for ($i = 0; $i < mb_strlen($str); $i++) {

0 commit comments

Comments
 (0)