Skip to content

Instantly share code, notes, and snippets.

@mjc
Created July 20, 2010 05:21
Show Gist options
  • Save mjc/482565 to your computer and use it in GitHub Desktop.
Save mjc/482565 to your computer and use it in GitHub Desktop.
function tep_redirect($url) {
if ( (strstr($url, "\n") != false) || (strstr($url, "\r") != false) ) {
tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false));
}
if ( (ENABLE_SSL == true) && (getenv('HTTPS') == 'on') ) { // We are loading an SSL page
if (substr($url, 0, strlen(HTTP_SERVER)) == HTTP_SERVER) { // NONSSL url
$url = HTTPS_SERVER . substr($url, strlen(HTTP_SERVER)); // Change it to SSL
}
}
try {
throw new Exception("Foo");
} catch(Exception $e) {
echo "<pre>";var_dump($e->getTrace()); echo "</pre>";
}
// header('Location: ' . $url);
tep_exit();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment