discard fileType if just '.'

This commit is contained in:
Uwe Steinmann 2019-10-01 14:05:29 +02:00
parent 721aaed1c1
commit ae4a65e8bc
2 changed files with 16 additions and 1 deletions

View File

@ -1470,6 +1470,8 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
$version = $resArr[0]['m']+1;
}
if($fileType == '.')
$fileType = '';
$filesize = SeedDMS_Core_File::fileSize($tmpFile);
$checksum = SeedDMS_Core_File::checksum($tmpFile);
@ -1639,6 +1641,9 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
if(!$content)
return false;
if($fileType == '.')
$fileType = '';
/* Check if $user, $orgFileName, $fileType and $mimetype are the same */
if($user->getID() != $content->getUser()->getID()) {
return false;
@ -2858,7 +2863,16 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
return $this->_user;
} /* }}} */
function getPath() { return $this->_document->getDir() . $this->_version . $this->_fileType; }
/**
* Return path of file on disk relative to the content directory
*
* Since version 5.1.13 a single '.' in the fileType will be skipped.
* On Windows a file named 'name.' will be saved as 'name' but the fileType
* will contain the a single '.'.
*
* @return string path of file on disc
*/
function getPath() { return $this->_document->getDir() . $this->_version . ($this->_fileType != '.' ? $this->_fileType : ''); }
function setDate($date = false) { /* {{{ */
$db = $this->_document->_dms->getDB();

View File

@ -26,6 +26,7 @@
<notes>
- add decorators
- add new methods SeedDMS_Core_Document::isType(), SeedDMS_Core_Folder::isType(), SeedDMS_Core_DocumentContent::isType(). Use them instead of checking the class name.
- skip a fileType with just a '.'
</notes>
<contents>
<dir baseinstalldir="SeedDMS" name="/">