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

[#32441] Fix divison by 0 issue in debug plugin #3219

Merged
merged 1 commit into from
Mar 24, 2014

Conversation

Hackwar
Copy link
Member

@Hackwar Hackwar commented Mar 2, 2014

If you send an empty DB query (thus strlen($query) = 0) you get a division by 0. With this little change, the string length is always at least 1. Since this is onyl to roughly guess if a query is good or bad, changing the result of this by +1 doesn't have a real impact. This will also mean, that these queries get a high value and show up as bad. And I think we can all agree that an empty query is simply a waste of perfectly good CPU cycles. ;-)

This is a replacement for PR #1539 by @elinw Thank you!

Tracker item is here: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=32441&start=0

If you send an empty DB query (thus strlen($query) = 0) you get a division by 0.
@beat
Copy link
Contributor

beat commented Mar 2, 2014

Easy no brainer. Sounds good to go @Hackwar 👍 Thanks!

@Hackwar
Copy link
Member Author

Hackwar commented Mar 2, 2014

Please mark your test in the tracker item.

infograf768 added a commit that referenced this pull request Mar 24, 2014
Fix divison by 0 issue in debug plugin
@infograf768 infograf768 merged commit 688c5ca into joomla:staging Mar 24, 2014
@Hackwar Hackwar changed the title Fix divison by 0 issue in debug plugin [#32441] Fix divison by 0 issue in debug plugin Mar 24, 2014
Bakual pushed a commit to Bakual/joomla-cms that referenced this pull request May 12, 2014
Fix divison by 0 issue in debug plugin
@Hackwar Hackwar deleted the patch-7 branch January 6, 2016 11:30
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

Successfully merging this pull request may close these issues.

None yet

4 participants