Quote from: sottwell at Mar 25, 2014, 07:07 AMThat is odd. Sounds like something to do with caching somewhere, browser cache or cookie, maybe?
Yeah thats what I thought - ive cleared my browsers caches and ModX's - both via the manager and manually. Nothing changed. I reinstalled everything from scratch and copy pasted all my resources, chunks, templates and snippets from the old DB one by one and found it had something to do with this PHP function I use for email injection on forms:
function isInjected($str) {
$injections = array('(\n+)',
'(\r+)',
'(\t+)',
'(%0A+)',
'(%0D+)',
'(%08+)',
'(%09+)'
);
$inject = join('|', $injections);
$inject = "/$inject/i";
if(preg_match($inject,$str)) {
return true;
}
else {
return false;
}
}
// If email injection is detected, redirect to the error page.
if ( isInjected($email) ) {
header( "Location: $error_page" );
}
// If passed all previous tests, send the email then redirect to the thank you page.
else {
//PHP MAIL FUNCTION
}
I have no idea why ModX doesnt like that function, but there you go.