]> jfr.im git - uguu.git/commitdiff
Update Upload.php v.1.7.2
authorGo Johansson (neku) <redacted>
Sat, 13 May 2023 01:15:45 +0000 (03:15 +0200)
committerGitHub <redacted>
Sat, 13 May 2023 01:15:45 +0000 (03:15 +0200)
src/Classes/Upload.php

index e28bf891aafccff8a16d79fe9a18784be72029e1..ac4943c8fb9d3b88cd7837df8496bc6398ec922d 100644 (file)
          *
          * @return string The file extension of the file.
          */
-        public function fileExtension(array $file):?string
+        public function fileExtension(array $file):string | bool
         {
             if(str_contains($file['name'], '.')){
             $extension = explode('.', $file['name']);
                 default => end($extension)
             };
             }
-            return "NOEXT";
+            return false;
         }
         
         /**
                     $index = rand(0, strlen($this->Connector->CONFIG['ID_CHARSET']) - 1);
                     $NEW_NAME .= $this->Connector->CONFIG['ID_CHARSET'][$index];
                 }
-                if ($extension != "NOEXT") {
+                if ($extension) {
                     $NEW_NAME .= '.' . $extension;
                 }
             } while ($this->Connector->dbCheckNameExists($NEW_NAME));