From 81153e6b8bdf3761ebe805ae9622a305d001a786 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 20 Mar 2013 12:15:06 +0400 Subject: fix broken redirects --- include/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/functions.php') diff --git a/include/functions.php b/include/functions.php index 62699e175..a055d1edf 100644 --- a/include/functions.php +++ b/include/functions.php @@ -295,7 +295,7 @@ curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout ? $timeout : 15); curl_setopt($ch, CURLOPT_TIMEOUT, $timeout ? $timeout : 45); - //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, !ini_get("safe_mode")); curl_setopt($ch, CURLOPT_MAXREDIRS, 20); curl_setopt($ch, CURLOPT_BINARYTRANSFER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); -- cgit v1.2.3 From f0540b598a40c03882dc1af6c4b95256bb27cb1a Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 20 Mar 2013 13:17:48 +0400 Subject: add a hack to prevent loading of stuff for hidden content in unexpanded combined mode (refs #602) --- include/functions.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include/functions.php') diff --git a/include/functions.php b/include/functions.php index a055d1edf..66054c23b 100644 --- a/include/functions.php +++ b/include/functions.php @@ -2609,7 +2609,8 @@ } if ($entry->nodeName == 'img') { - if (get_pref($link, "STRIP_IMAGES", $owner) || $force_remove_images) { + if (($owner && get_pref($link, "STRIP_IMAGES", $owner)) || + $force_remove_images) { $p = $doc->createElement('p'); @@ -3633,7 +3634,7 @@ array_push($entries, $entry); } - if (!get_pref($link, "STRIP_IMAGES")) { + if ($_SESSION['uid'] && !get_pref($link, "STRIP_IMAGES")) { if ($always_display_enclosures || !preg_match("/ Date: Wed, 20 Mar 2013 20:33:46 +0400 Subject: optimize loading of external libraries a bit fix bold text in Unread articles --- include/functions.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'include/functions.php') diff --git a/include/functions.php b/include/functions.php index 66054c23b..d9a3a5963 100644 --- a/include/functions.php +++ b/include/functions.php @@ -4070,4 +4070,25 @@ return $rv; } + function stylesheet_tag($filename) { + $timestamp = filemtime($filename); + + echo "\n"; + } + + function javascript_tag($filename) { + $query = ""; + + if (!(strpos($filename, "?") === FALSE)) { + $query = substr($filename, strpos($filename, "?")+1); + $filename = substr($filename, 0, strpos($filename, "?")); + } + + $timestamp = filemtime($filename); + + if ($query) $timestamp .= "&$query"; + + echo "\n"; + } + ?> -- cgit v1.2.3