function securepages_baseurl in Secure Pages 7
Same name and namespace in other branches
- 5 securepages.module \securepages_baseurl()
- 6.2 securepages.module \securepages_baseurl()
- 6 securepages.module \securepages_baseurl()
Returns the secure base path.
2 calls to securepages_baseurl()
- securepages_goto in ./
securepages.module - Redirects the current page to the secure or insecure version.
- securepages_redirect in ./
securepages.module - Checks the current page and see if we need to redirect to the secure or insecure version of the page.
File
- ./
securepages.module, line 306 - Allows certain pages to be viewable only via HTTPS.
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);
}