From 19073e8a3e98ec2c4a3e3ccb2135cce700428cb5 Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 16 Aug 2023 14:59:12 +0900 Subject: [PATCH 1/2] docs: improve descriptions --- user_guide_src/source/incoming/filters.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/user_guide_src/source/incoming/filters.rst b/user_guide_src/source/incoming/filters.rst index 69bef38de4d0..77734795f493 100644 --- a/user_guide_src/source/incoming/filters.rst +++ b/user_guide_src/source/incoming/filters.rst @@ -120,14 +120,14 @@ Except for a Few URIs There are times where you want to apply a filter to almost every request, but have a few that should be left alone. One common example is if you need to exclude a few URI's from the CSRF protection filter to allow requests from third-party websites to hit one or two specific URI's, while keeping the rest of them protected. To do this, add -an array with the ``except`` key and a URI to match as the value alongside the alias: +an array with the ``except`` key and a URI path (relative to BaseURL) to match as the value alongside the alias: .. literalinclude:: filters/006.php -Any place you can use a URI in the filter settings, you can use a regular expression or, like in this example, use -an asterisk (``*``) for a wildcard that will match all characters after that. In this example, any URL's starting with ``api/`` +Any place you can use a URI path (relative to BaseURL) in the filter settings, you can use a regular expression or, like in this example, use +an asterisk (``*``) for a wildcard that will match all characters after that. In this example, any URI path starting with ``api/`` would be exempted from CSRF protection, but the site's forms would all be protected. If you need to specify multiple -URI's you can use an array of URI patterns: +URI paths, you can use an array of URI path patterns: .. literalinclude:: filters/007.php @@ -153,7 +153,7 @@ $filters ======== This property is an array of filter aliases. For each alias, you can specify ``before`` and ``after`` arrays that contain -a list of URI patterns that filter should apply to: +a list of URI path (relative to BaseURL) patterns that filter should apply to: .. literalinclude:: filters/009.php From 51d4dfd5d9cdaec1d4485c8bf8360a289795f65c Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 16 Aug 2023 14:59:26 +0900 Subject: [PATCH 2/2] docs: make sample code more realistic --- user_guide_src/source/incoming/filters/008.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_guide_src/source/incoming/filters/008.php b/user_guide_src/source/incoming/filters/008.php index 749da8098c6b..945e9498b4f9 100644 --- a/user_guide_src/source/incoming/filters/008.php +++ b/user_guide_src/source/incoming/filters/008.php @@ -9,8 +9,8 @@ class Filters extends BaseConfig // ... public array $methods = [ - 'post' => ['foo', 'bar'], - 'get' => ['baz'], + 'post' => ['InvalidChars', 'csrf'], + 'get' => ['csrf'], ]; // ...