From 8f68e824a85ed4f8848e8b9c73cd52e7daf8eaa0 Mon Sep 17 00:00:00 2001 From: Daniel Henrique Lelis de Almeida Date: Sun, 8 Sep 2024 18:02:07 -0300 Subject: [PATCH] fix ext extraction on submit --- src/app/Model/Archive.php | 2 +- src/app/Model/User.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/Model/Archive.php b/src/app/Model/Archive.php index 3753067..15e728a 100644 --- a/src/app/Model/Archive.php +++ b/src/app/Model/Archive.php @@ -633,7 +633,7 @@ public function getAwsFileContent($key, $bucket = null) // This is not the ideal solution, but it is not worth to change the whole // behaviour of the commits upload for now. (Will be rewritten soon). private function extractExtension($fileName) { - $split = explode(".", $upload['name'][$index]); + $split = explode(".", $fileName); if (count($split) == 1) { return $split[0]; diff --git a/src/app/Model/User.php b/src/app/Model/User.php index bdba736..4d74321 100644 --- a/src/app/Model/User.php +++ b/src/app/Model/User.php @@ -145,7 +145,9 @@ public function beforeSave($options = array()) if (isset($this->data[$this->alias]['password'])) { $this->data[$this->alias]['password'] = AuthComponent::password($this->data[$this->alias]['password']); } - $this->data[$this->alias]['email'] = strtolower($this->data[$this->alias]['email']); + if (array_key_exists('email', $this->data[$this->alias])) { + $this->data[$this->alias]['email'] = strtolower($this->data[$this->alias]['email']); + } return true; } public function afterFind($results, $primary = false)