Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- final class Url {
- public function http($route) {
- if (HTTPS_IS_SHARED_SERVER == 1 && !$this->isSSL())
- return HTTP_SERVER . 'index.php?route=' . str_replace('&', '&', $route);
- else
- return HTTP_SERVER . 'index.php?route=' . str_replace('&', '&', $route) . '&sid=' . session_id();
- }
- public function https($route) {
- if (HTTPS_SERVER != '') {
- if (HTTPS_IS_SHARED_SERVER == 1 && !$this->isSSL())
- $link = HTTPS_SERVER . 'index.php?route=' . str_replace('&', '&', $route) . '&sid=' . session_id();
- else
- $link = HTTPS_SERVER . 'index.php?route=' . str_replace('&', '&', $route);
- } else {
- $link = HTTP_SERVER . 'index.php?route=' . str_replace('&', '&', $route);
- }
- return $link;
- }
- public function isSSL() {
- return (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? true : false;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement