update finder.php

This commit is contained in:
gtbu 2025-12-22 15:07:39 +01:00
parent 2e4f2c5c5e
commit 2e43e6c106

View file

@ -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.