Anonymous - 2025-11-25

Originally posted by: reputed-artist

This is a PHP 8.1+ deprecation warning. The issue is that CodeIgniter is passing null to filter_var() which is now deprecated. Here are several ways to fix this:

Solution 1: Update CodeIgniter (Recommended)
This is likely because you're using an older version of CodeIgniter 4. Update to the latest version:

bash
composer update
Solution 2: Temporary Fix - Suppress the Warning
If you can't update immediately, you can suppress the deprecation warning:

Option A: In php.ini
ini
error_reporting = E_ALL & ~E_DEPRECATED
Option B: In your CodeIgniter .env file
env
CI_ENVIRONMENT = production
Option C: In your index.php
php
// Before loading CodeIgniter
error_reporting(E_ALL & ~E_DEPRECATED);
Solution 3: Custom Fix for the Specific File
Create a custom override for the RequestTrait:

Create a custom trait in app/Common/CustomRequestTrait.php:

php