Support » Plugin: Rating Box » Division by zero

  • At a file wp-content/plugins/rating-box/includes/site.php
    there is an error in 60th line. There is an if:

    if( is_object($row) ){
    	$star_value = round(intval($row->total)/intval($row->count),0);
    }

    When the intval($row->count) equals zero then the “division by zero” error appears in posts where the ratingbox is included. I have changed the code like that:

    if( is_object($row) && intval($row->count) != 0){
    	$star_value = round(intval($row->total)/intval($row->count),0);
    }

    and there is no problem now.

    • This topic was modified 2 years, 8 months ago by  dawidxx7.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Division by zero’ is closed to new replies.