I have this function I use to simplify things.
function search_string( $needle, $haystack ) {
if ( preg_match_all( "/$needle/im", $haystack ) || strpos( $haystack, $needle ) ) {
return TRUE;
}
return FALSE;
}
I keep getting this error in my PHP logs, and it comes in a sequence:
[07-Nov-2020 05:34:14 America/Los_Angeles] PHP Warning: preg_match_all(): Unknown modifier 'G' in /home/baser-b/public_html/include/functions.php on line 791
[07-Nov-2020 05:34:14 America/Los_Angeles] PHP Warning: preg_match_all(): Unknown modifier 'g' in /home/baser-b/public_html/include/functions.php on line 791
Meaning, it will come with one with the small g, then three with the big G, then one with the small g, then five with the big G, and so on....
My question is, how can I stop getting this error. It won't show me the functions being called to arrive at this answer, as this is likely an error generated by another function calling this one. I was wondering if anyone knew what to change in the search_string function to stop getting this error, why this error is happening, or why the strange repetitive sequence. Is it someone trying to do a hack? The only variable that would be changeable by a visitor would be the $needle variable, so what could they type that has something to do with 'g' to get this?
Anyway, thanks.