Missing feature on Xenat servers causes PHP error messages resulting in
an invalid image. Substitute a user-friendly placeholder instead.
$width= 1000;
$imgpath = preg_replace('{^(?=[0-9]+/)}', 'data/', $imgpath, 1);
+if (!function_exists('popen')) {
+ http_response_code(501);
+ $target = '501.png';
+ header('Content-type: '.mime_content_type($target));
+ readfile($target);
+ exit;
+}
+
if (!file_exists($imgpath)) {
http_response_code(404);
exit;