Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
opiums9 opened this issue Jun 2, 2022 · 2 comments
Open

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

opiums9 opened this issue Jun 2, 2022 · 2 comments
Labels
Bug i broke something

Comments

@opiums9
Copy link
Contributor

opiums9 commented Jun 2, 2022

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
Copy link
Owner

Sarjuuk commented Jun 10, 2022

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.

@Sarjuuk Sarjuuk added the Bug i broke something label Jun 10, 2022
@opiums9
Copy link
Contributor Author

opiums9 commented Jun 10, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug i broke something
Projects
None yet
Development

No branches or pull requests

2 participants