summaryrefslogtreecommitdiff
path: root/include/functions.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/functions.php')
-rw-r--r--include/functions.php14
1 files changed, 4 insertions, 10 deletions
diff --git a/include/functions.php b/include/functions.php
index 4d54f7e35..16953a0a1 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -1289,19 +1289,13 @@
}
if ($entry->hasAttribute('srcset')) {
- $tokens = explode(",", $entry->getAttribute('srcset'));
+ $matches = RSSUtils::decode_srcset($entry->getAttribute('srcset'));
- for ($i = 0; $i < count($tokens); $i++) {
- $token = trim($tokens[$i]);
-
- list ($url, $width) = explode(" ", $token, 2);
-
- $url = rewrite_relative_url($rewrite_base_url, $url);
-
- $tokens[$i] = "$url $width";
+ for ($i = 0; $i < count($matches); $i++) {
+ $matches[$i]["url"] = rewrite_relative_url($rewrite_base_url, $matches[$i]["url"]);
}
- $entry->setAttribute("srcset", implode(", ", $tokens));
+ $entry->setAttribute("srcset", RSSUtils::encode_srcset($matches));
}
if ($entry->hasAttribute('src') &&