diff --git a/app/Config/Filters.php b/app/Config/Filters.php index a6c8a2143a..11359e7c9d 100644 --- a/app/Config/Filters.php +++ b/app/Config/Filters.php @@ -7,9 +7,9 @@ class Filters extends BaseConfig // Makes reading things below nicer, // and simpler to change out script that's used. public $aliases = [ - 'csrf' => \App\Filters\CSRF::class, - 'toolbar' => \App\Filters\DebugToolbar::class, - 'honeypot' => \App\Filters\Honeypot::class, + 'csrf' => \CodeIgniter\Filters\CSRF::class, + 'toolbar' => \CodeIgniter\Filters\DebugToolbar::class, + 'honeypot' => \CodeIgniter\Filters\Honeypot::class, ]; // Always applied before every request diff --git a/app/Filters/CSRF.php b/system/Filters/CSRF.php similarity index 97% rename from app/Filters/CSRF.php rename to system/Filters/CSRF.php index a5355556ca..1319122b04 100644 --- a/app/Filters/CSRF.php +++ b/system/Filters/CSRF.php @@ -1,4 +1,4 @@ -locator->listFiles('Filters/'); - $expectedWin = APPPATH . 'Filters\DebugToolbar.php'; - $expectedLin = APPPATH . 'Filters/DebugToolbar.php'; + $expectedWin = SYSTEMPATH . 'Filters\DebugToolbar.php'; + $expectedLin = SYSTEMPATH . 'Filters/DebugToolbar.php'; $this->assertTrue(in_array($expectedWin, $files) || in_array($expectedLin, $files)); $expectedWin = SYSTEMPATH . 'Filters\Filters.php'; diff --git a/user_guide_src/source/libraries/honeypot.rst b/user_guide_src/source/libraries/honeypot.rst index 0e40bde777..dc85f7a1bb 100644 --- a/user_guide_src/source/libraries/honeypot.rst +++ b/user_guide_src/source/libraries/honeypot.rst @@ -28,7 +28,9 @@ from the ``$globals`` array, like...:: ] ]; -A sample Honeypot filter is bundled, as ``app/Filters/Honeypot.php``. +A sample Honeypot filter is bundled, as ``system/Filters/Honeypot.php``. +If it is not suitable, make your own at ``app/Filters/Honeypot.php``, +and modify the ``$aliases`` in the configuration appropriately. Customizing Honeypot ===================== diff --git a/user_guide_src/source/libraries/security.rst b/user_guide_src/source/libraries/security.rst index d7dab3680f..05ed86683f 100644 --- a/user_guide_src/source/libraries/security.rst +++ b/user_guide_src/source/libraries/security.rst @@ -28,6 +28,7 @@ and enabling the `csrf` filter globally:: public $globals = [ 'before' => [ + //'honeypot' 'csrf' ] ];