From 0c019b4436c9ec224b23972a65aaf55aa03d5d57 Mon Sep 17 00:00:00 2001
From: Dave Zaikos
Date: Sun, 22 Jun 2014 01:08:57 -0400
Subject: Added curl CURLOPT_NOBODY option in geturl function to ensure the
HEAD method is used when resolving permanent/temporary URL moves.
---
include/functions2.php | 1 +
1 file changed, 1 insertion(+)
(limited to 'include/functions2.php')
diff --git a/include/functions2.php b/include/functions2.php
index d6a399ffc..3e3367240 100644
--- a/include/functions2.php
+++ b/include/functions2.php
@@ -2220,6 +2220,7 @@
curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0 Firefox/5.0');
curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
curl_setopt($curl, CURLOPT_HEADER, true);
+ curl_setopt($curl, CURLOPT_NOBODY, true);
curl_setopt($curl, CURLOPT_REFERER, $url);
curl_setopt($curl, CURLOPT_ENCODING, 'gzip,deflate');
curl_setopt($curl, CURLOPT_AUTOREFERER, true);
--
cgit v1.2.3-54-g00ecf
From 1e871938153497d46537fc313a79155717d532d0 Mon Sep 17 00:00:00 2001
From: Felix Eckhofer
Date: Tue, 15 Jul 2014 15:44:05 +0200
Subject: Add width/height attribute to image enclosures
---
include/functions2.php | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
(limited to 'include/functions2.php')
diff --git a/include/functions2.php b/include/functions2.php
index 3e3367240..07024d38f 100644
--- a/include/functions2.php
+++ b/include/functions2.php
@@ -1868,6 +1868,8 @@
$url = $line["content_url"];
$ctype = $line["content_type"];
$title = $line["title"];
+ $width = $line["width"];
+ $height = $line["height"];
if (!$ctype) $ctype = __("unknown type");
@@ -1891,6 +1893,8 @@
$entry["filename"] = $filename;
$entry["url"] = $url;
$entry["title"] = $title;
+ $entry["width"] = $width;
+ $entry["height"] = $height;
array_push($entries, $entry);
}
@@ -1905,9 +1909,15 @@
preg_match("/\.(jpg|png|gif|bmp)/i", $entry["filename"])) {
if (!$hide_images) {
+ $encsize = '';
+ if ($entry['height'] > 0)
+ $encsize .= ' height="' . intval($entry['width']) . '"';
+ if ($entry['width'] > 0)
+ $encsize .= ' width="' . intval($entry['height']) . '"';
$rv .= "![\"".htmlspecialchars($entry["filename"])."\"](\"")
";
+ src=\"" .htmlspecialchars($entry["url"]) . "\"
+ " . $encsize . " />
";
} else {
$rv .= "