chriskacerguis / codeigniter-restserver

A fully RESTful server implementation for CodeIgniter using one library, one config file and one controller.
MIT License
4.89k stars 2.86k forks source link

php 8.1 deprecated calls on /restcontroller.php #1152

Open ideamediaweb opened 6 months ago

ideamediaweb commented 6 months ago

i am getting on php 8.1 environement the following error: ERROR - 2024-03-04 14:23:13 --> Severity: 8192 --> strtolower(): Passing null to parameter #1 ($string) of type string is deprecated /home/ideam3/public_html/gestionale/modules/zapier/vendor/chriskacerguis/codeigniter-restserver/src/RestController.php

So restcontroller.php should be updated

QuintinK commented 3 months ago

Debugging the same thing today, workaround until the project is updated:

Go to application/libraries/RestController.php (your path may differ)

Line 837

Update

$method = strtolower($method);

To

$method = strtolower((!empty($method) ? $method : ''));