利用方法によっては、足りないのですが、46行目に次のような
判別を挿入。
dllink.inc.php の
if (!preg_match('/\.(pdf|jpg|png|gif|doc|docx|xls|xlxs|zip)$/i',$filename)) {
return $qm->replace('plg_dlbutton.err_bad_filetype', '');
}
dlexec.phpの70行目に以下の様な判別を挿入
if (!preg_match('/\.(pdf|jpg|png|gif|doc|docx|xls|xlxs|zip)$/i',$filename)) {
header('HTTP/1.1 404 Not Found');
error_msg('Error : bad file type1');
exit;
}
if (preg_match('/^//',$filename)) {
header('HTTP/1.1 404 Not Found');
error_msg('Error : bad file type2');
exit;
}
if (preg_match('/\.\./',$filename)) {
header('HTTP/1.1 404 Not Found');
error_msg('Error : bad file type3');
exit;
}
pdfとzipファイルのみを許可という事なら、
if (!preg_match('/\.(pdf|jpg|png|gif|doc|docx|xls|xlxs|zip)$/i',$filename)) {
の部分を
if (!preg_match('/\.(pdf|zip)$/i',$filename)) {
等をすると、少し良くなると思いますが、まだまだでしょうか。
スキルの高い方、添削お願いします。
dllink.inc.phpからdlexec.phpを呼び出して?使うようなので、
dlexec.phpだけ対応すれば良いのかもしれません。