mirror of
https://codeberg.org/reflect/reflect-rules-plugin.git
synced 2025-09-13 16:33:42 +02:00
Compare commits
2 commits
Author | SHA1 | Date | |
---|---|---|---|
01cc1eea02 | |||
aa7d969350 |
2 changed files with 9 additions and 2 deletions
|
@ -1,3 +1,6 @@
|
|||
> [!IMPORTANT]
|
||||
> This plugin has since [Reflect version 3.8.5](https://codeberg.org/reflect/reflect/releases/tag/2.8.5) been deprecated. Reflect now has built-in request validation which is enabled by default. The built-in validator is based on this plugin.
|
||||
|
||||
# Request validation plugin for the [Reflect API Framework](https://codeberg.org/reflect/reflect)
|
||||
This request pre-processor adds request validation for an API written in the Reflect API Framework.
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@
|
|||
// ----
|
||||
|
||||
// Perform request processing on GET properties (search parameters)
|
||||
public function GET(array $rules): void {
|
||||
public function GET(array $rules): self {
|
||||
// (Re)enable strict mode if property is null
|
||||
if ($this->strict === null) {
|
||||
$this->strict = true;
|
||||
|
@ -133,10 +133,12 @@
|
|||
|
||||
$this->eval_rules($rule, Scope::GET);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
// Perform request processing on POST properties (request body)
|
||||
public function POST(array $rules): void {
|
||||
public function POST(array $rules): self {
|
||||
// (Re)enable strict mode if property is null
|
||||
if ($this->strict === null) {
|
||||
$this->strict = true;
|
||||
|
@ -147,6 +149,8 @@
|
|||
|
||||
$this->eval_rules($rule, Scope::POST);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
// ----
|
||||
|
|
Loading…
Add table
Reference in a new issue