Update demo plugin

This commit is contained in:
djmaze 2021-11-30 11:18:52 +01:00
parent a28d8f4e04
commit e4e26d799c
2 changed files with 3 additions and 3 deletions

View file

@ -16,9 +16,9 @@ class DemoStorage extends \RainLoop\Providers\Storage\FileStorage
\MailSo\Base\Utils::RecRmDir("{$this->sDataPath}/demo"); \MailSo\Base\Utils::RecRmDir("{$this->sDataPath}/demo");
} }
$sDataPath .= '/' . static::fixName(\RainLoop\Utils::GetConnectionToken()); $sDataPath .= '/' . \RainLoop\Utils::fixName(\RainLoop\Utils::GetConnectionToken());
\is_dir($sDataPath) || \mkdir($sDataPath, 0700, true); \is_dir($sDataPath) || \mkdir($sDataPath, 0700, true);
return $sDataPath . '/' . ($sKey ? static::fixName($sKey) : ''); return $sDataPath . '/' . ($sKey ? \RainLoop\Utils::fixName($sKey) : '');
} }
} }

View file

@ -245,7 +245,7 @@ class Utils
* Replace control characters, ampersand, spaces and reserved characters (based on Win95 VFAT) * Replace control characters, ampersand, spaces and reserved characters (based on Win95 VFAT)
* en.wikipedia.org/wiki/Filename#Reserved_characters_and_words * en.wikipedia.org/wiki/Filename#Reserved_characters_and_words
*/ */
public static function fixName($filename) public static function fixName(string $filename) : string
{ {
return \preg_replace('#[|\\\\?*<":>+\\[\\]/&\\s\\pC]#su', '-', $filename); return \preg_replace('#[|\\\\?*<":>+\\[\\]/&\\s\\pC]#su', '-', $filename);
} }