Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove warnings about undefined variable on report page

Notice: Undefined variable: ratings in /var/www/devphoto/htdocs/photo.inc.php on line 1732

Notice: Undefined variable: value_array in /var/www/photo/htdocs/photo.inc.php on line 1751

Notice: Undefined variable: html in /var/www/photo/htdocs/photo.inc.php on line 1754

Issue #30
  • Loading branch information...
commit 85e53eb21ac1437da3f9b37ca1bdc735c9478218 1 parent e210261
@jeroenrnl authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 php/photo.inc.php
View
7 php/photo.inc.php
@@ -1702,6 +1702,9 @@ function get_filesize($photos, $human=false) {
}
}
function create_rating_graph($user) {
+ $ratings=array();
+ $value_array=array();
+ $html="";
if ($user && !$user->is_admin()) {
$query =
@@ -1729,7 +1732,7 @@ function create_rating_graph($user) {
while ($row = fetch_array($result)) {
$ratings[($row[0] ? $row[0] : translate("Not rated"))]=$row[1];
}
- if(is_array($ratings)) {
+ if(!empty($ratings)) {
$html="<h3>" . translate("photo ratings") . "</h3>";
$legend=array(translate("rating"),translate("count"));
while (list($range, $count) = each($ratings)) {
@@ -1748,7 +1751,7 @@ function create_rating_graph($user) {
$value_array[]=$row;
}
}
- if($value_array) {
+ if(!empty($value_array)) {
$html.=create_bar_graph($legend, $value_array, 150);
} else {
$html.=translate("No photo was found.") . "\n";
Please sign in to comment.
Something went wrong with that request. Please try again.