From 6ce20457cb46ef311a450014f0b873b96e1f1615 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Tue, 5 Dec 2023 22:29:49 +0100 Subject: [PATCH] checks whether temp directory is absolute --- src/RobotLoader/RobotLoader.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/RobotLoader/RobotLoader.php b/src/RobotLoader/RobotLoader.php index d214e07..938760c 100644 --- a/src/RobotLoader/RobotLoader.php +++ b/src/RobotLoader/RobotLoader.php @@ -397,6 +397,9 @@ public function setAutoRefresh(bool $on = true): static */ public function setTempDirectory(string $dir): static { + if (!FileSystem::isAbsolute($dir)) { + throw new Nette\InvalidArgumentException("Temporary directory must be absolute, '$dir' given."); + } FileSystem::createDir($dir); $this->tempDirectory = $dir; return $this;