diff --git a/framework/base/router.class.php b/framework/base/router.class.php index 5dfb548cc3..612b5ef0b9 100644 --- a/framework/base/router.class.php +++ b/framework/base/router.class.php @@ -3262,19 +3262,15 @@ class ztSessionHandler public function write($id, $sessData) { $sessFile = $this->getSessionFile($id); + if(md5_file($sessFile) == md5($sessData)) return true; + if(file_put_contents($sessFile, $sessData)) { + if(!file_exists($this->rawFile)) touch($this->rawFile); if(strpos($sessData, 'user|') !== false) { - if(file_exists($this->rawFile)) - { - $rawSessContent = (string) file_get_contents($this->rawFile); - if(strpos($rawSessContent, 'user|') === false) copy($sessFile, $this->rawFile); - } - else - { - copy($sessFile, $this->rawFile); - } + $rawSessContent = (string) file_get_contents($this->rawFile); + if(empty($rawSessContent)) file_put_contents($this->rawFile, $sessData); } return true; diff --git a/module/extension/control.php b/module/extension/control.php index 07ca32b9c7..1ff63ffd9e 100644 --- a/module/extension/control.php +++ b/module/extension/control.php @@ -428,7 +428,7 @@ class extension extends control if($_FILES) { - if($_FILES['file']['size'] == 0) return print(js::alert(str_replace("'", "\'", sprintf($this->lang->extension->errorFileNotEmpty, $fileName, $return->error)))); + if($_FILES['file']['error'] == UPLOAD_ERR_NO_FILE) return print(js::alert($this->lang->extension->errorFileNotEmpty)); $tmpName = $_FILES['file']['tmp_name']; $fileName = $_FILES['file']['name'];