From c2d88a08b796ca19c8b5ec63bfd34ac32ead4208 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Fri, 8 Jul 2016 15:55:17 +0200 Subject: Remove unneeded checks if it runs on a Windows machine * the setup check is still there --- lib/private/Files/Storage/Common.php | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'lib/private/Files') diff --git a/lib/private/Files/Storage/Common.php b/lib/private/Files/Storage/Common.php index 0c1b69108d4..6c4013d2acb 100644 --- a/lib/private/Files/Storage/Common.php +++ b/lib/private/Files/Storage/Common.php @@ -489,25 +489,7 @@ abstract class Common implements Storage, ILockingStorage { } // NOTE: $path will remain unverified for now - if (\OC_Util::runningOnWindows()) { - $this->verifyWindowsPath($fileName); - } else { - $this->verifyPosixPath($fileName); - } - } - - /** - * https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx - * @param string $fileName - * @throws InvalidPathException - */ - protected function verifyWindowsPath($fileName) { - $fileName = trim($fileName); - $this->scanForInvalidCharacters($fileName, "\\/<>:\"|?*"); - $reservedNames = ['CON', 'PRN', 'AUX', 'NUL', 'COM1', 'COM2', 'COM3', 'COM4', 'COM5', 'COM6', 'COM7', 'COM8', 'COM9', 'LPT1', 'LPT2', 'LPT3', 'LPT4', 'LPT5', 'LPT6', 'LPT7', 'LPT8', 'LPT9']; - if (in_array(strtoupper($fileName), $reservedNames)) { - throw new ReservedWordException(); - } + $this->verifyPosixPath($fileName); } /** -- cgit v1.2.3