Skip to content

Commit

Permalink
Fix divison by 0 issue in debug plugin
Browse files Browse the repository at this point in the history
If you send an empty DB query (thus strlen($query) = 0) you get a division by 0.
  • Loading branch information
Hackwar authored and Bakual committed May 12, 2014
1 parent b290c19 commit ae6e144
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/system/debug/debug.php
Expand Up @@ -747,7 +747,7 @@ protected function displayQueries()

// How heavy should the string length count: 0 - 1.
$ratio = 0.5;
$timeScore = $queryTime / (strlen($query) * $ratio) * 200;
$timeScore = $queryTime / ((strlen($query) + 1) * $ratio) * 200;

// Determine color of bargraph depending on query speed and presence of warnings in EXPLAIN.
if ($timeScore > 10)
Expand Down

0 comments on commit ae6e144

Please sign in to comment.