Skip to content

Commit 6ce2045

Browse files
committed
checks whether temp directory is absolute
1 parent 9ac9cd8 commit 6ce2045

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/RobotLoader/RobotLoader.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,9 @@ public function setAutoRefresh(bool $on = true): static
397397
*/
398398
public function setTempDirectory(string $dir): static
399399
{
400+
if (!FileSystem::isAbsolute($dir)) {
401+
throw new Nette\InvalidArgumentException("Temporary directory must be absolute, '$dir' given.");
402+
}
400403
FileSystem::createDir($dir);
401404
$this->tempDirectory = $dir;
402405
return $this;

0 commit comments

Comments
 (0)