mirror of
https://github.com/gtbu/Typesetter-5.3-p8.git
synced 2025-12-31 07:28:27 +01:00
update finder.php
This commit is contained in:
parent
2e4f2c5c5e
commit
2e43e6c106
1 changed files with 10 additions and 3 deletions
13
include/thirdparty/process/Finder.php
vendored
13
include/thirdparty/process/Finder.php
vendored
|
|
@ -39,12 +39,19 @@ class Finder
|
|||
$this->validateTimeout($timeout);
|
||||
$this->timeout = $timeout;
|
||||
}
|
||||
|
||||
public function setFinder(string $finder): self
|
||||
|
||||
public function setFinder(string $finder): self
|
||||
{
|
||||
// STRICT SECURITY: Only allow 'find' or 'finder'.
|
||||
$allowed = ['find', 'finder'];
|
||||
|
||||
if (!in_array($finder, $allowed)) {
|
||||
throw new \InvalidArgumentException("Security Error: The finder type '$finder' is not allowed.");
|
||||
}
|
||||
|
||||
$this->finder = $finder;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the timeout after instantiation.
|
||||
|
|
|
|||
Loading…
Reference in a new issue