"toggle_publ" => __("Toggle published"),
"toggle_unread" => __("Toggle unread"),
"edit_tags" => __("Edit tags"),
- "dismiss_selected" => __("Dismiss selected"),
- "dismiss_read" => __("Dismiss read"),
"open_in_new_window" => __("Open in new window"),
"catchup_below" => __("Mark below as read"),
"catchup_above" => __("Mark above as read"),
"*s" => "toggle_publ",
"u" => "toggle_unread",
"*t" => "edit_tags",
- "*d" => "dismiss_selected",
- "*x" => "dismiss_read",
"o" => "open_in_new_window",
"c p" => "catchup_below",
"c n" => "catchup_above",
function check_for_update() {
if (defined("GIT_VERSION_TIMESTAMP")) {
- $content = @fetch_file_contents("http://tt-rss.org/version.json");
+ $content = @fetch_file_contents(array("url" => "http://tt-rss.org/version.json", "timeout" => 5));
if ($content) {
$content = json_decode($content, true);
return "";
}
- function make_runtime_info() {
+ function make_runtime_info($disable_update_check = false) {
$data = array();
$result = db_query("SELECT MAX(id) AS mid, COUNT(*) AS nf FROM
$data['reload_on_ts_change'] = !defined('_NO_RELOAD_ON_TS_CHANGE');
- if (CHECK_FOR_UPDATES && $_SESSION["last_version_check"] + 86400 + rand(-1000, 1000) < time()) {
+ if (CHECK_FOR_UPDATES && !$disable_update_check && $_SESSION["last_version_check"] + 86400 + rand(-1000, 1000) < time()) {
$update_result = @check_for_update();
$data["update_result"] = $update_result;
if (file_exists($cached_filename)) {
$src = SELF_URL_PATH . '/public.php?op=cached_image&hash=' . sha1($src);
+
+ if ($entry->hasAttribute('srcset')) {
+ $entry->removeAttribute('srcset');
+ }
+
+ if ($entry->hasAttribute('sizes')) {
+ $entry->removeAttribute('sizes');
+ }
}
$entry->setAttribute('src', $src);
* @return string Absolute URL
*/
function rewrite_relative_url($url, $rel_url) {
- if (strpos($rel_url, ":") !== false) {
- return $rel_url;
- } else if (strpos($rel_url, "://") !== false) {
+ if (strpos($rel_url, "://") !== false) {
return $rel_url;
} else if (strpos($rel_url, "//") === 0) {
# protocol-relative URL (rare but they exist)
return $rel_url;
- } else if (strpos($rel_url, "/") === 0)
- {
+ } else if (preg_match("/^[a-z]+:/i", $rel_url)) {
+ # magnet:, feed:, etc
+ return $rel_url;
+ } else if (strpos($rel_url, "/") === 0) {
$parts = parse_url($url);
$parts['path'] = $rel_url;