summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorFelix Eckhofer <[email protected]>2014-07-15 15:44:05 +0200
committerFelix Eckhofer <[email protected]>2014-07-15 16:23:49 +0200
commit1e871938153497d46537fc313a79155717d532d0 (patch)
treef19d0c80cac3b17524dd64cf6e30a988354e1379 /include
parent523bd90bafffee18d9c7652c68f4c08d25be339e (diff)
Add width/height attribute to image enclosures
Diffstat (limited to 'include')
-rw-r--r--include/functions2.php12
1 files changed, 11 insertions, 1 deletions
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 .= "<p><img
alt=\"".htmlspecialchars($entry["filename"])."\"
- src=\"" .htmlspecialchars($entry["url"]) . "\"/></p>";
+ src=\"" .htmlspecialchars($entry["url"]) . "\"
+ " . $encsize . " /></p>";
} else {
$rv .= "<p><a target=\"_blank\"
href=\"".htmlspecialchars($entry["url"])."\"