We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40122
    • 330 Posts
    So this is a weird one.

    I've installed a fresh, new version of ModX (2.2.13) and after if I preview a resource any chunk, resource or snippet I click on in Manager opens that preview. Also I cannot save anything in snippets.

    Would anyone know why this is occurring and how to fix?

    Thanks!

    [ed. note: meltingdog last edited this post 12 years, 6 months ago.]
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      That is odd. Sounds like something to do with caching somewhere, browser cache or cookie, maybe?
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 40122
        • 330 Posts
        Quote from: sottwell at Mar 25, 2014, 07:07 AM
        That 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.