Overview
Comment:Use realpath() to make sure file exists
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | dev
Files: files | file ages | folders
SHA3-256: 512b22edcb6d49f73900191d72e01f1bad7eac183e7e8a6e035283d7ca529349
User & Date: bohwaz on 2021-03-15 02:54:36
Other Links: branch diff | manifest | tags
Context
2021-03-15
02:55
Accept more unicode in filenames check-in: 176bbe63cd user: bohwaz tags: dev
02:54
Use realpath() to make sure file exists check-in: 512b22edcb user: bohwaz tags: dev
02:27
In some rare cases the file size is wrong, ignore it for now check-in: 83e4bb26cc user: bohwaz tags: dev
Changes

Modified src/include/lib/Garradin/Files/Storage/FileSystem.php from [c1d7f36387] to [e562d716b9].

81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
	}

	static public function mkdir(File $file): bool
	{
		return Utils::safe_mkdir(self::getFullPath($file));
	}

	static protected function _getRealPath(string $path)
	{
		return self::_getRoot() . DIRECTORY_SEPARATOR . str_replace('/', DIRECTORY_SEPARATOR, $path);
	}

	static public function getFullPath(File $file): ?string
	{
		return self::_getRealPath($file->path);
	}








|

|







81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
	}

	static public function mkdir(File $file): bool
	{
		return Utils::safe_mkdir(self::getFullPath($file));
	}

	static protected function _getRealPath(string $path): ?string
	{
		return realpath(self::_getRoot() . DIRECTORY_SEPARATOR . str_replace('/', DIRECTORY_SEPARATOR, $path)) ?: null;
	}

	static public function getFullPath(File $file): ?string
	{
		return self::_getRealPath($file->path);
	}