Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Is The Redirect Function Correct?


trier

Recommended Posts

Hi,

 

The tep_redirect function -

 

function tep_redirect($url) {

 

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

}

}

 

header('Location: ' . $url);

 

tep_exit();

}

 

if I understand it correctly (?), seems to check if the current page is HTTPS (getenv('HTTPS') == 'on'), and if so, forces the redirect to an HTTPS page?

 

This doesn't normally cause too much of a problem because most redirects seem to be to the same type of page.

 

I am trying to make a change such that if going to login from a product list page, I want to be able to return to the product list page. It fails because it tries to go to an HTTPS (shared SSL) product list page.

 

There are ways around it which are not too difficult, but - am I missing anything? I don't see why the page check is there at all, the call to the function always seems to include the tep_href_link which correctly sets the HTTPS/HTTP,SSL/NONSSL.

 

Thanks

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...