*/
private $ttl = 43200;
+ /**
+ * Run page.
+ *
+ * @throws \Exception
+ */
public function run() {
if (!preg_match('/^[^\/]+\.(jpg|jpeg|png|gif)$/i', $_GET['photo'])) {
CRM_Core_Error::fatal('Malformed photo name');
1 => array("%" . $_GET['photo'], 'String'),
);
$dao = CRM_Core_DAO::executeQuery($sql, $params);
+ $cid = NULL;
while ($dao->fetch()) {
$cid = $dao->id;
}
}
/**
+ * Download image.
+ *
* @param string $file
* Local file path.
* @param string $mimeType
if (!file_exists($file)) {
header("HTTP/1.0 404 Not Found");
return;
- } elseif (!is_readable($file)) {
+ }
+ elseif (!is_readable($file)) {
header('HTTP/1.0 403 Forbidden');
return;
}