marksie1988 Posted September 11, 2008 Author Share Posted September 11, 2008 function strip_clean($strip_clean) { $search="/alert();/"; $search.="/document.title();/"; $search.="/prompt();/"; $search.="/confirm();/"; $replace=""; return preg_replace($search,$replace,$strip_clean); } Link to comment https://forums.phpfreaks.com/topic/122791-please-check-my-new-project/page/2/#findComment-639359 Share on other sites More sharing options...
darkfreaks Posted September 11, 2008 Share Posted September 11, 2008 why do you need to escape everything, there's your most likely problem Link to comment https://forums.phpfreaks.com/topic/122791-please-check-my-new-project/page/2/#findComment-639360 Share on other sites More sharing options...
marksie1988 Posted September 11, 2008 Author Share Posted September 11, 2008 why do you need to escape everything, there's your most likely problem what do yea mean escape everything? the only change i made to the script was the / which everywhere i looked said you need but obv that didnt work Link to comment https://forums.phpfreaks.com/topic/122791-please-check-my-new-project/page/2/#findComment-639415 Share on other sites More sharing options...
darkfreaks Posted September 11, 2008 Share Posted September 11, 2008 why it works fine without escaping it ??? Link to comment https://forums.phpfreaks.com/topic/122791-please-check-my-new-project/page/2/#findComment-639423 Share on other sites More sharing options...
marksie1988 Posted September 12, 2008 Author Share Posted September 12, 2008 i have the code like this now and still get errors function strip_clean($strip_clean) { $search="alert();"; $search.="document.title();"; $search.="prompt();"; $search.="confirm();"; $replace=""; return preg_replace($search,$replace,$strip_clean); } Link to comment https://forums.phpfreaks.com/topic/122791-please-check-my-new-project/page/2/#findComment-639934 Share on other sites More sharing options...
darkfreaks Posted September 12, 2008 Share Posted September 12, 2008 what errors? Link to comment https://forums.phpfreaks.com/topic/122791-please-check-my-new-project/page/2/#findComment-640174 Share on other sites More sharing options...
marksie1988 Posted September 12, 2008 Author Share Posted September 12, 2008 Warning: preg_replace() [function.preg-replace]: Delimiter must not be alphanumeric or backslash in /home/marksie/blconline/mileagedemo/inc/DbConnector.php on line 215 Warning: preg_replace() [function.preg-replace]: Delimiter must not be alphanumeric or backslash in /home/marksie/blconline/mileagedemo/inc/DbConnector.php on line 215 Warning: preg_replace() [function.preg-replace]: Delimiter must not be alphanumeric or backslash in /home/marksie/blconline/mileagedemo/inc/DbConnector.php on line 215 Warning: preg_replace() [function.preg-replace]: Delimiter must not be alphanumeric or backslash in /home/marksie/blconline/mileagedemo/inc/DbConnector.php on line 215 below are lines 209 to 216 function strip_clean($strip_clean) { $search="alert();"; $search.="document.title();"; $search.="prompt();"; $search.="confirm();"; $replace=""; return preg_replace($search,$replace,$strip_clean); } Link to comment https://forums.phpfreaks.com/topic/122791-please-check-my-new-project/page/2/#findComment-640180 Share on other sites More sharing options...
darkfreaks Posted September 13, 2008 Share Posted September 13, 2008 Fix: <?php function strip_clean($strip_clean) { $search="[^A-Za-z0-9]"; //stripping ()/\. $replace=""; return preg_replace($search,$replace,$strip_clean); }?> Link to comment https://forums.phpfreaks.com/topic/122791-please-check-my-new-project/page/2/#findComment-640350 Share on other sites More sharing options...
Recommended Posts