Made download.php compatible to gentoo php

This commit is contained in:
2016-11-30 11:13:03 +01:00
parent 57a35096a6
commit 64fa5e3cbd
2 changed files with 43 additions and 30 deletions

View File

@@ -27,6 +27,7 @@ class DownloadHandler
{
/**
* Download the given vcf file.
* @return boolean
*/
public static function doDownload()
{
@@ -43,7 +44,7 @@ class DownloadHandler
}
// validate token
if (!ctype_alnum($token)) { // token is a md5 hash
if (!preg_match('/^[a-zA-Z0-9]+$/', $token)) { // token is a md5 hash
return false;
}
@@ -69,5 +70,7 @@ class DownloadHandler
readfile($file);
ignore_user_abort(true);
unlink($file);
return true;
}
}