Skip to content

Commit

Permalink
Added processing of the "path" parameter in the query string (image.php)
Browse files Browse the repository at this point in the history
Used to display a placeholder image when the frame file is missing.
  • Loading branch information
IgorA100 authored Sep 27, 2024
1 parent 2a90d2b commit d85c854
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion web/views/image.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@

// Calling sequence: ... /zm/index.php?view=image&path=/monid/path/image.jpg&scale=nnn&width=wwww&height=hhhhh
//
// Path is physical path to the image starting at the monitor id
// Path is physical path to the image.
// If "path" starts with "/" - then the link is relative to the root (ZM_PATH_WEB), if there is no slash at the beginning, then it is relative to the skin folder (ZM_SKIN_PATH)
//
// Scale is optional and between 1 and 400 (percent),
// Omitted or 100 = no scaling done, image passed through directly
Expand Down Expand Up @@ -444,6 +445,9 @@ function imagescale($image, $new_width, $new_height = -1, $mode = 0) {
return;
}
} # end if ! file_exists($path)
} else {
$path = (strpos(validHtmlStr($_REQUEST['path']), '/') == 0) ? ZM_PATH_WEB.validHtmlStr($_REQUEST['path']) : ZM_PATH_WEB.'/'.ZM_SKIN_PATH.'/'.validHtmlStr($_REQUEST['path']);
if ( !file_exists($path) ) return;
}

# we now load the actual image to send
Expand Down

0 comments on commit d85c854

Please sign in to comment.