where to paste php code to apply for all sites?

#1
Hi,
I want to sanitize user input for all my sites.
So, I want to keep this code in openlitespeed lsphp82 somewhere so that it applies to all my websites :

I want to run this php code at the beginning of all my php scripts.

PHP:
foreach ($_GET as $key => $value) {

    $_GET[$key] = filter_var($value, FILTER_SANITIZE_STRING);

}

Instead of editing all the php files of all my websites, is there an easy way?
please suggest.
Thanks
 

Cold-Egg

Administrator
#2
You can try to add the following rule into the web admin> VH > General > php.ini Override
Code:
php_value auto_prepend_file script.php
Or add it to the php.ini so it will apply globally.
 
Top