Enable Uploading Files, where a space occures in ADIF-Filename (PHP-Part)

This commit is contained in:
int2001
2024-02-14 05:36:09 +00:00
parent 8a6dd27bd1
commit 15e25719aa
2 changed files with 2 additions and 1 deletions

View File

@@ -193,7 +193,7 @@ class adif extends CI_Controller {
$f_elements=explode(".",$fdata['upload_data']['file_name']);
if (strtolower($f_elements[count($f_elements)-1])=='zip') {
$f_adif = preg_replace('/\\.zip$/', '', $fdata['upload_data']['file_name']);
$p_adif = preg_replace('/^(.*)(_)(\S{2,4})$/', '$1.$3', $f_adif); // Bug in CodeIgniter. Destroys Filename if there is more than one dot.
$p_adif = hash('sha256', $this->session->userdata('user_callsign') ).'.adif';
if (preg_match("/.*\.adi.?$/",strtolower($p_adif))) { // Check if adi? inside zip
$zip = new ZipArchive;
if ($zip->open('./uploads/'.$fdata['upload_data']['file_name'])) {