]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Merge pull request #5 from fatihorhan/master
authorNicolas Lœuillet <nicolas@loeuillet.org>
Thu, 4 Apr 2013 16:25:40 +0000 (09:25 -0700)
committerNicolas Lœuillet <nicolas@loeuillet.org>
Thu, 4 Apr 2013 16:25:40 +0000 (09:25 -0700)
Some fixes and improvements

inc/Readability.php
index.php
readityourself.php

index 52a37d505e1aadcc8963dfa0213480956faaeaba..c50bf2efa1911acd3129e69cd1648e4584fd9d4b 100755 (executable)
@@ -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
        
        /**
index 9e6e2256465f5be981d3e6b2b24154f41e1f858a..d89fa41c3bc2ff5d4125797824c326695fc8d12b 100755 (executable)
--- 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'];
 }
 ?>
@@ -80,7 +84,7 @@ function url(){
                                <li><a href="index.php">home</a></li>
                                <li><a href="#">favorites</a></li>
                                <li><a href="#">archive</a></li>
-                <li><a href="javascript:(function(){var%20url%20=%20location.href;var%20title%20=%20document.title%20||%20url;window.open('<? echo url()?>index.php?action=add&url='%20+%20encodeURIComponent(url),'_self');})();">poche it !</a></li>
+                <li><a href="javascript:(function(){var%20url%20=%20location.href;var%20title%20=%20document.title%20||%20url;window.open('<?php echo url()?>?action=add&url='%20+%20encodeURIComponent(url),'_self');})();">poche it !</a></li>
                        </ul>
                <?php
                        $query = $db_handle->prepare("SELECT * FROM entries WHERE read=?");
index 4a4661c26b95adc88df2e3a8afa0697bcdb9508b..c59bb9d1226a03aa5f74670546400f8d9a3c1a92 100755 (executable)
@@ -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'];
 }
 
@@ -92,7 +96,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('#<meta .*charset=.*>#Usi', $data, $meta);