Overview
Comment:Fix typo
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | dev
Files: files | file ages | folders
SHA3-256: b0721cd17bace2ff9583184f3e71452bbed661bef5ef57f5d3124e8b48755a8b
User & Date: bohwaz on 2021-04-05 14:05:44
Other Links: branch diff | manifest | tags
Context
2021-04-05
14:28
Always change modified time when editing a page fix [feec2edb912f0046] check-in: 84780be961 user: bohwaz tags: dev
14:05
Fix typo check-in: b0721cd17b user: bohwaz tags: dev
14:04
Add some protection against malicious uploads check-in: c7e2f12dfb user: bohwaz tags: dev
Changes

Modified src/include/lib/Garradin/Entities/Files/File.php from [2d5f69b0ed] to [e0bd62a4f2].

863
864
865
866
867
868
869
870
871
872
873
874
875
876
877

		if (strpos($name, "\0") !== false) {
			throw new ValidationException('Nom de fichier invalide');
		}

		$extension = strtolower(substr($name, strrpos($name, '.')));

		if (preg_match(self::FORBIDDEN_EXTENSIONS, $extension))
			throw new ValidationException('Extension de fichier non autorisée, merci de renommer le fichier avant envoi.');
		}
	}

	static public function validatePath(string $path): array
	{
		$path = explode('/', $path);







|







863
864
865
866
867
868
869
870
871
872
873
874
875
876
877

		if (strpos($name, "\0") !== false) {
			throw new ValidationException('Nom de fichier invalide');
		}

		$extension = strtolower(substr($name, strrpos($name, '.')));

		if (preg_match(self::FORBIDDEN_EXTENSIONS, $extension)) {
			throw new ValidationException('Extension de fichier non autorisée, merci de renommer le fichier avant envoi.');
		}
	}

	static public function validatePath(string $path): array
	{
		$path = explode('/', $path);