Escape photo download title
This commit is contained in:
parent
bef01d775d
commit
5d9e41d2ae
@ -588,9 +588,18 @@ class Photo extends Module {
|
||||
return false;
|
||||
}
|
||||
|
||||
# Illicit chars
|
||||
$badChars = array_merge(
|
||||
array_map('chr', range(0,31)),
|
||||
array("<", ">", ":", '"', "/", "\\", "|", "?", "*")
|
||||
);
|
||||
|
||||
# Parse title
|
||||
if ($photo->title=='') $photo->title = 'Untitled';
|
||||
|
||||
# Escape title
|
||||
$zipTitle = str_replace($badChars, '', $zipTitle);
|
||||
|
||||
# Set headers
|
||||
header("Content-Type: application/octet-stream");
|
||||
header("Content-Disposition: attachment; filename=\"" . $photo->title . $extension . "\"");
|
||||
|
Loading…
Reference in New Issue
Block a user