Skip to content

Commit

Permalink
Parse any whitespace between terms
Browse files Browse the repository at this point in the history
instead of only spaces
  • Loading branch information
lL1l1 committed Aug 10, 2024
1 parent eacba9f commit 74a6a35
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion www/res/scripts/luaToPhp.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function trimval($str)
$str = trim($str);

// Evaluated numbers used in fire rates like '10/10'
if (preg_match('/^((?:[0-9\.]+ *[\/+-] *)*[0-9\.]+),?$/', $str, $matches))
if (preg_match('/^((?:[0-9\.]+\w*[\/+-]\w*)*[0-9\.]+),?$/', $str, $matches))
{
eval('$str = ' . $matches[1] . ';');
return (float)$str == (int)$str ? (int)$str : (float)$str;
Expand Down

0 comments on commit 74a6a35

Please sign in to comment.