"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "modules/files/model/File.php" between
groupoffice-6.3.62-php-71.tar.gz and groupoffice-6.3.63-php-71.tar.gz

About: GroupOffice is a web-based office suit: Calendar, CRM, E-mail, File sharing, Projects, Synchronization (6.3 series for PHP 7.1; community version).

File.php  (groupoffice-6.3.62-php-71):File.php  (groupoffice-6.3.63-php-71)
skipping to change at line 258 skipping to change at line 258
} }
if ($enoughQuota && \GO::config()->quota > 0) { if ($enoughQuota && \GO::config()->quota > 0) {
$currentQuota = \GO::config()->get_setting('file_storage_ usage'); $currentQuota = \GO::config()->get_setting('file_storage_ usage');
$enoughQuota = $currentQuota + $newBytes <= (\GO::config( )->quota * 1024); $enoughQuota = $currentQuota + $newBytes <= (\GO::config( )->quota * 1024);
} }
return $enoughQuota; return $enoughQuota;
} }
public function checkNormalization() { public function checkNormalization() {
if(!\Normalizer::isNormalized($this->name, \Normalizer::FORM_D)) if(!\go\core\util\StringUtil::isNormalized($this->name)) {
{ \GO::debug("Normalizing file $this->id to Unicode Form C"
\GO::debug("Normalizing file $this->id to Unicode Form D" );
);
$name = \Normalizer::normalize($this->name, \Normalizer:: $name = \go\core\util\StringUtil::normalize($this->name);
FORM_D);
$this->getFsFile()->rename($name); if($this->getFsFile()->exists()) {
GO()->getDbConnection()->update('fs_files',['name' => $na $this->getFsFile()->rename($name);
me], ['id' => $this->id])->execute(); }
if(!$this->getIsNew()) {
GO()->getDbConnection()->update('fs_files',['nam
e' => $name], ['id' => $this->id])->execute();
}
$this->name = $name; $this->name = $name;
} }
} }
protected function beforeSave() { protected function beforeSave() {
//Normalize UTF-8. ONly form D works on MacOS webdav! //Normalize UTF-8. ONly form D works on MacOS webdav!
$this->name = \Normalizer::normalize($this->name, \Normalizer::FO RM_D); $this->checkNormalization();
//check permissions on the filesystem //check permissions on the filesystem
if($this->isNew){ if($this->isNew){
if(is_null($this->folder->fsFolder)){ if(is_null($this->folder->fsFolder)){
throw new \Exception("Folder ".$this->folder->pat h." cannot be found on disk, please check this path manually."); throw new \Exception("Folder ".$this->folder->pat h." cannot be found on disk, please check this path manually.");
} }
if(!$this->folder->fsFolder->isWritable()){ if(!$this->folder->fsFolder->isWritable()){
throw new \Exception("Folder ".$this->folder->pat h." is read only on the filesystem. Please check the file system permissions (hi nt: chown -R www-data:www-data /home/groupoffice)"); throw new \Exception("Folder ".$this->folder->pat h." is read only on the filesystem. Please check the file system permissions (hi nt: chown -R www-data:www-data /home/groupoffice)");
 End of changes. 3 change blocks. 
10 lines changed or deleted 14 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)