diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2013-04-04 09:25:40 -0700 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2013-04-04 09:25:40 -0700 |
commit | 56dacad5074a21ae65fbf4fd6a625f259cc6d1f9 (patch) | |
tree | 6a0e4391026e62254ecda9b9b59ee651e93ec943 /readityourself.php | |
parent | 634cf566f5d6aa92ca2c409932181a76bcfb91d0 (diff) | |
parent | 1f1a6157aa480553afba0e1ed2537fff94dc7a6b (diff) | |
download | wallabag-56dacad5074a21ae65fbf4fd6a625f259cc6d1f9.tar.gz wallabag-56dacad5074a21ae65fbf4fd6a625f259cc6d1f9.tar.zst wallabag-56dacad5074a21ae65fbf4fd6a625f259cc6d1f9.zip |
Merge pull request #5 from fatihorhan/master
Some fixes and improvements
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); |