diff options
Diffstat (limited to 'readityourself.php')
-rwxr-xr-x | readityourself.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/readityourself.php b/readityourself.php index 4a4661c2..c59bb9d1 100755 --- a/readityourself.php +++ b/readityourself.php | |||
@@ -26,7 +26,11 @@ require_once dirname(__FILE__).'/inc/rain.tpl.class.php'; | |||
26 | 26 | ||
27 | 27 | ||
28 | function url(){ | 28 | function url(){ |
29 | $protocol = ($_SERVER['HTTPS'] && $_SERVER['HTTPS'] != "off") ? "https" : "http"; | 29 | $protocol = "http"; |
30 | if(isset($_SERVER['HTTPS'])) | ||
31 | if($_SERVER['HTTPS'] != "off") | ||
32 | $protocol = "https"; | ||
33 | |||
30 | return $protocol . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; | 34 | return $protocol . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; |
31 | } | 35 | } |
32 | 36 | ||
@@ -92,7 +96,7 @@ function get_external_file($url, $timeout) { | |||
92 | } | 96 | } |
93 | 97 | ||
94 | // if response is not empty and response is OK | 98 | // if response is not empty and response is OK |
95 | if (isset($data) and isset($httpcodeOK) and httpcodeOK ) { | 99 | if (isset($data) and isset($httpcodeOK) and $httpcodeOK ) { |
96 | 100 | ||
97 | // take charset of page and get it | 101 | // take charset of page and get it |
98 | preg_match('#<meta .*charset=.*>#Usi', $data, $meta); | 102 | preg_match('#<meta .*charset=.*>#Usi', $data, $meta); |