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

Merged
merged 1 commit into from Mar 24, 2014

Projects

None yet

4 participants

@Hackwar
Joomla! member

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

@Hackwar Hackwar Fix divison by 0 issue in debug plugin
If you send an empty DB query (thus strlen($query) = 0) you get a division by 0.
d92cd97
@beat

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

@Hackwar
Joomla! member

Please mark your test in the tracker item.

@infograf768 infograf768 merged commit 688c5ca into joomla:staging Mar 24, 2014

1 check passed

Details default The Travis CI build passed
@Hackwar Hackwar changed the title from Fix divison by 0 issue in debug plugin to [#32441] Fix divison by 0 issue in debug plugin Mar 24, 2014
@Hackwar Hackwar deleted the Hackwar:patch-7 branch Jan 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment