Welcome Guest, Not a member yet? Register   Sign In
Uncaught ErrorException: strtolower()

I have an application developed with CI 4.1.4 in localhost which is working well there.
Then, I uploaded the application on a web server, Siteground with php 8.1.0, and there, I got an error message such as:

ErrorException #1
Uncaught ErrorException: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in /home/customer/www/simoned113.sg-host.com/app/system/Validation/FormatRules.php:253

The problem is here: SYSTEMPATH/Validation/FormatRules.php at line 253

Here is the code:

PHP Code:
public function valid_ip(?string $ip null, ?string $which null): bool
249        if (empty($ip)) {
250            return false;
251        }
switch (strtolower($which)) {
254            case 'ipv4':
255                $which FILTER_FLAG_IPV4;
256                break;
case 'ipv6':
259                $which FILTER_FLAG_IPV6;
260                break; 

I read in some blog article to replace the null value with '' quotes, but as I am having this error in a system file,
I'm afraid to have in the future some other errors, if I make some changes.

Please any ideas?

Thank yo in advance

Messages In This Thread
Uncaught ErrorException: strtolower() - by gbwebapps - 11-08-2021, 03:14 AM

Theme © iAndrew 2016 - Forum software by © MyBB