function securepages_baseurl in Secure Pages 6
Same name and namespace in other branches
- 5 securepages.module \securepages_baseurl()
- 6.2 securepages.module \securepages_baseurl()
- 7 securepages.module \securepages_baseurl()
Return the secure base path
2 calls to securepages_baseurl()
- securepages_redirect in ./
securepages.module - Check the current page and see if we need to redirect to the secure or insecure version of the page.
- securepages_url in ./
securepages.module - Generate a URL from a Drupal menu path. Will also pass-through existing URLs.
File
- ./
securepages.module, line 390 - Provide method of creating allowing certain pages to only viewable from https pages
Code
function securepages_baseurl($secure = TRUE) {
global $base_url;
if ($secure) {
$url = variable_get('securepages_basepath_ssl', NULL);
}
else {
$url = variable_get('securepages_basepath', NULL);
}
if (!empty($url)) {
return $url;
}
// No url has been set, so convert the base_url from 1 to the other
return preg_replace('/http[s]?:\\/\\//i', $secure ? 'https://' : 'http://', $base_url, 1);
}