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
/**
}
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'];
}
?>
<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=?");
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'];
}
}
// 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);