Sarjuuk / aowow

Database viewer for TrinityCore based on aowow by @LordJZ, based on the JS-Engine of Wowhead
204 stars 217 forks source link

spell.class.php(1019) : eval()'d code #345

Open opiums9 opened 2 years ago

opiums9 commented 2 years ago

In spell = 69420 I get an error: syntax error, unexpected ',', expecting ';' I don't know what the correct value should be in the end, but I added this code to file as a temporary solution, any ideas how to avoid this error in the future?

        ...
        // hm, minor eval-issue. eval doesnt understand two operators without a space between them (eg. spelll: 18126)
        $formula = preg_replace('/(\+|-|\*|\/)(\+|-|\*|\/)/i', '\1 \2', $formula);
        $formula = preg_replace('/,/', '.', $formula);

        // there should not be any letters without a leading $
        return eval('return '.$formula.';');
        ...
Sarjuuk commented 2 years ago

I don't see it. The mentioned spell has the following tooltip for me, which parses fine: Сокращает время восстановления заклинания суккуба "Всплеск боли" на $/1000;s2 с. и время наложения заклинания беса "Огненная стрела" на ${0-$m1/1000}.2 с.

no other eval() errors in my logs so far.

opiums9 commented 2 years ago

I assume that my errors are due to the fact that I have not updated the version of aowow since February 15, 2021