uhhh, safety_functions.php is from another site, completely custom. So, sorry bout that!
The file is init_includes/overrides/init_sanitize.php. This is where I have the preg_replace...
Now. Ok, so load up the site. hit the price range filter (not sure why i called it loHi) anyways, changing the data in the url parameter to something like jpricelohi=96_1%89 or jpricelohi=96_1#89 after the preg_replace has run on $_GET['jpricelohi'] will either whitescreen with warning: refresh... or the hashtag makes it through but stops the functionality of the module and an echo of $_GET['jpricelohi'] then says: 96_1 .
If I do an all in php test like
$dirty = '99_434%34';
$dirty = preg_replace('/[^_0-9]/', '', $dirty);
echo $dirty;
I get ( 99_43434 )
if I do the exact same preg_replace on the url parameter $_GET['jpricelohi'] I can't tell if it works or not because if I put an % symbol into the url like ( 99_434%34 ) , I get a "page isn't redirecting properly". Replace the % with the $ symbol and I get "WARNING: An Error occurred, please refresh the page and try again."
But any of these funky characters in the $_GET['sort'] seem to be cleaned right up and the system moves along.
I have moved the preg_replace's to where the code is being executed on (as suggested). Still the same though when entering unwanted chars into the URL.