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

Debug bar: Uncaught ErrorException: str_repeat(): Second argument has to be greater than or equal to 0 #538

Closed
nowackipawel opened this issue Jun 5, 2017 · 3 comments

Comments

@nowackipawel
Copy link
Contributor

Uncaught ErrorException: str_repeat(): Second argument has to be greater than or equal to 0 in /home/pc/sites/oneway/system/Debug/Exceptions.php:413
screenshot-adm loc 2017-06-05 18-40-21

@lonnieezell
Copy link
Member

Sorry it took so long - I just got back from vacation. Any chance you remember what was causing the issue? I've submitted a fix that might take care of the issue, but no real way to check...

lonnieezell added a commit that referenced this issue Jun 12, 2017
@nowackipawel
Copy link
Contributor Author

nowackipawel commented Jun 12, 2017

Unfortunately I can't remember what caused that exception. Anyway I'm not sure if that your fix is the best solution for: "second argument has to be greater then or equal to 0".
str_repeat('[/span]', -1) caused that exception... even if -1 will be a string then (int)$spans will be still -1

$spans = "-1"; var_dump((int)$spans); prints (int)-1

I think better solution for that is:
if($spans>0) $out .= str_repeat('</span>', $spans);

@lonnieezell
Copy link
Member

Doh! You're correct. I was moving too quickly last night. Thanks.

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

No branches or pull requests

2 participants