anvc / scalar

Born-digital, open source, media-rich scholarly publishing that’s as easy as blogging.
Other
231 stars 73 forks source link

PHP Fatal Error #186

Closed mat-k-witts closed 2 years ago

mat-k-witts commented 2 years ago

Followed INSTALL.txt and get:

Fatal error: Uncaught TypeError: filter_var(): Argument #3 ($options) must be of type array|int, string given in /home/user/scalar-latest/system/core/Input.php:392 Stack trace: #0 /home/user/scalar-latest/system/core/Input.php(392): filter_var() #1 /home/user/scalar-latest/system/core/Input.php(355): CI_Input->valid_ip() #2 /home/user/scalar-latest/system/libraries/Session.php(331): CI_Input->ip_address() #3 /home/user/scalar-latest/system/libraries/Session.php(109): CI_Session->sess_create() #4 /home/user/scalar-latest/system/core/Loader.php(1100): CI_Session->__construct() #5 /home/user/scalar-latest/system/core/Loader.php(976): CI_Loader->_ci_init_class() #6 /home/user/scalar-latest/system/core/Loader.php(217): CI_Loader->_ci_load_class() #7 /home/user/scalar-latest/system/application/core/MY_Controller.php(42): CI_Loader->library() #8 /home/user/scalar-latest/system/application/controllers/system.php(33): MY_Controller->__construct() #9 /home/user/scalar-latest/system/core/CodeIgniter.php(309): System->__construct() #10 /home/user/scalar-latest/codeigniter.php(203): require_once('...') #11 {main} thrown in /home/user/scalar-latest/system/core/Input.php on line 392

Can't find exact system requirements in any scalar docs to find the current CI version you use but this seems like a solution .

craigdietrich commented 2 years ago

Hi @localhost1729,

It looks like you found a good fix on Stackexchange, thanks!

I don't have PHP 8 running to be able to test a fix, though. I'll put this on my TODO list though and see what I can do. This would be a biggy, of course, if it impacts all PHP 8 installs.

craigdietrich commented 2 years ago

Following up on this, I have a PHP8 server up and running and have the same error showing, so now I can work on the fix that you found.

More as things materialize....

craigdietrich commented 2 years ago

@mat-k-witts Alrighty, this should do the trick:

https://github.com/anvc/scalar/commit/fb8838f5cfd970edb3538ab86338e7374064af3c

Lemme know if this works for you or if you run into any other problems!