diff options
author | Andrew Dolgov <[email protected]> | 2020-02-27 10:24:12 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2020-02-27 10:24:12 +0300 |
commit | 3b62150abde4d36e5be622fb0fd1f2266291d79a (patch) | |
tree | 79e1c4b9eb55d1c877bcdfce19fab32a27f472f3 /plugins/af_comics/init.php | |
parent | db8a1f76c71e360976cec9921022f31410f384a3 (diff) |
use canonical fetch url for Far Side
Diffstat (limited to 'plugins/af_comics/init.php')
-rwxr-xr-x | plugins/af_comics/init.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/af_comics/init.php b/plugins/af_comics/init.php index 214482d43..3a8203428 100755 --- a/plugins/af_comics/init.php +++ b/plugins/af_comics/init.php @@ -157,6 +157,8 @@ class Af_Comics extends Plugin { } else if (preg_match("#^https?://www\.thefarside\.com#", $fetch_url)) { require_once 'lib/MiniTemplator.class.php'; + $article_link = htmlspecialchars("https://www.thefarside.com" . date('/Y/m/d')); + $tpl = new MiniTemplator(); $tpl->readTemplateFromFile('templates/generated_feed.txt'); @@ -166,7 +168,7 @@ class Af_Comics extends Plugin { $tpl->setVariable('FEED_URL', htmlspecialchars($fetch_url), true); $tpl->setVariable('SELF_URL', htmlspecialchars($fetch_url), true); - $body = fetch_file_contents(['url' => $fetch_url, 'type' => 'text/html', 'followlocation' => false]); + $body = fetch_file_contents(['url' => $article_link, 'type' => 'text/html', 'followlocation' => false]); if ($body) { $doc = new DOMDocument(); @@ -196,10 +198,8 @@ class Af_Comics extends Plugin { $title = date('l, F d, Y'); } - $article_link = htmlspecialchars($fetch_url . "?" . date('/Y/m/d')); - - $tpl->setVariable('ARTICLE_ID', $article_link, true); - $tpl->setVariable('ARTICLE_LINK', $article_link, true); + $tpl->setVariable('ARTICLE_ID', htmlspecialchars($article_link), true); + $tpl->setVariable('ARTICLE_LINK', htmlspecialchars($article_link), true); $tpl->setVariable('ARTICLE_UPDATED_ATOM', date('c', mktime(11, 0, 0)), true); $tpl->setVariable('ARTICLE_TITLE', htmlspecialchars($title), true); $tpl->setVariable('ARTICLE_EXCERPT', '', true); |