From c44908ddd02eb5fd63c292bb7e0fa99a52f73222 Mon Sep 17 00:00:00 2001 From: Fatih Orhan Date: Thu, 4 Apr 2013 11:05:58 +0300 Subject: [PATCH 1/5] Correct the php opening tag --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index 9e6e22564..e32996fab 100755 --- a/index.php +++ b/index.php @@ -80,7 +80,7 @@ function url(){
  • home
  • favorites
  • archive
  • -
  • poche it !
  • +
  • poche it !
  • prepare("SELECT * FROM entries WHERE read=?"); From aa8e0a27e21c88dcaaf99af602219f1e79188a88 Mon Sep 17 00:00:00 2001 From: Fatih Orhan Date: Thu, 4 Apr 2013 11:10:31 +0300 Subject: [PATCH 2/5] Prevent "undefined index 'HTTPS'" Notice In servers where notice error_level is enabled, php prints this notice which mixed in to url. --- index.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index e32996fab..167c4401c 100755 --- a/index.php +++ b/index.php @@ -53,7 +53,11 @@ switch ($action) { } function url(){ - $protocol = ($_SERVER['HTTPS'] && $_SERVER['HTTPS'] != "off") ? "https" : "http"; + $protocol = "http"; + if(isset($_SERVER['HTTPS'])) + if($_SERVER['HTTPS'] != "off") + $protocol = "https"; + return $protocol . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; } ?> From bf1be2bf4971688dfe925699c3797dac319cd4b8 Mon Sep 17 00:00:00 2001 From: Fatih Orhan Date: Thu, 4 Apr 2013 11:14:33 +0300 Subject: [PATCH 3/5] Don't add 'index.php' to url, REQUEST_URI has it See http://php.net/manual/en/reserved.variables.server.php --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index 167c4401c..d89fa41c3 100755 --- a/index.php +++ b/index.php @@ -84,7 +84,7 @@ function url(){
  • home
  • favorites
  • archive
  • -
  • poche it !
  • +
  • poche it !
  • prepare("SELECT * FROM entries WHERE read=?"); From 69fc326c9880c281f8a5c9c5b71100a414971912 Mon Sep 17 00:00:00 2001 From: Fatih Orhan Date: Thu, 4 Apr 2013 11:20:23 +0300 Subject: [PATCH 4/5] Add forgotten $ sign Php was defaulting httpcodeOK to 'httpcodeOK' which always evaluates to true (which is incorrect) --- readityourself.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readityourself.php b/readityourself.php index 4a4661c26..2071b4175 100755 --- a/readityourself.php +++ b/readityourself.php @@ -92,7 +92,7 @@ function get_external_file($url, $timeout) { } // if response is not empty and response is OK - if (isset($data) and isset($httpcodeOK) and httpcodeOK ) { + if (isset($data) and isset($httpcodeOK) and $httpcodeOK ) { // take charset of page and get it preg_match('##Usi', $data, $meta); From 1f1a6157aa480553afba0e1ed2537fff94dc7a6b Mon Sep 17 00:00:00 2001 From: Fatih Orhan Date: Thu, 4 Apr 2013 11:26:50 +0300 Subject: [PATCH 5/5] Fix undefined index and constant problems --- inc/Readability.php | 2 +- readityourself.php | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/inc/Readability.php b/inc/Readability.php index 52a37d505..c50bf2efa 100755 --- a/inc/Readability.php +++ b/inc/Readability.php @@ -80,7 +80,7 @@ class Readability public $debug = false; protected $body = null; // protected $bodyCache = null; // Cache the body HTML in case we need to re-use it later - protected $flags = FLAG_CLEAN_CONDITIONALLY; // 1 | 2 | 4; // Start with all flags set. + protected $flags = self::FLAG_CLEAN_CONDITIONALLY; // 1 | 2 | 4; // Start with all flags set. protected $success = false; // indicates whether we were able to extract or not /** diff --git a/readityourself.php b/readityourself.php index 2071b4175..c59bb9d12 100755 --- a/readityourself.php +++ b/readityourself.php @@ -26,7 +26,11 @@ require_once dirname(__FILE__).'/inc/rain.tpl.class.php'; function url(){ - $protocol = ($_SERVER['HTTPS'] && $_SERVER['HTTPS'] != "off") ? "https" : "http"; + $protocol = "http"; + if(isset($_SERVER['HTTPS'])) + if($_SERVER['HTTPS'] != "off") + $protocol = "https"; + return $protocol . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; }