Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

replaced unusual SERVER var "HTTPS" call as it was causing NOTICE #1

Merged
merged 1 commit into from

2 participants

@billortell

... {title} -
and replaced it with a preg_match return of the SERVER_PROTOCOL value instead. Hope this helps.

@gilbitron gilbitron merged commit 13d9a05 into picocms:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 18, 2012
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/pico.php
View
8 lib/pico.php
@@ -103,10 +103,16 @@ function base_url()
$script_url = (isset($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : '';
if($request_url != $script_url) $url = trim(preg_replace('/'. str_replace('/', '\/', str_replace('index.php', '', $script_url)) .'/', '', $request_url, 1), '/');
- $protocol = $_SERVER['HTTPS'] ? "https" : "http";
+ $protocol = $this->get_protocol();
return rtrim(str_replace($url, '', $protocol . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']), '/');
}
+ function get_protocol()
+ {
+ preg_match("|^HTTP[S]?|is",$_SERVER['SERVER_PROTOCOL'],$m);
+ return strtolower($m[0]);
+ }
+
}
?>
Something went wrong with that request. Please try again.