X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=classes%2Fhandler%2Fpublic.php;h=46c74041c85c33a6de6b1036552ce2a8bac5ee80;hb=27f7b59353a076120407d8873ea86f5eea7d1dcf;hp=34d57744151ea20cf8912284ecef46a5b013debb;hpb=d9c042c4c536f1afbf206aeea09b0b127b7b6418;p=tt-rss.git diff --git a/classes/handler/public.php b/classes/handler/public.php index 34d57744..46c74041 100644 --- a/classes/handler/public.php +++ b/classes/handler/public.php @@ -101,8 +101,7 @@ class Handler_Public extends Handler { $tpl->setVariable('ARTICLE_ID', htmlspecialchars($orig_guid ? $line['link'] : - get_self_url_prefix() . - "/public.php?url=" . urlencode($line['link'])), true); + $this->make_article_tag_uri($line['id'], $line['date_entered'])), true); $tpl->setVariable('ARTICLE_LINK', htmlspecialchars($line['link']), true); $tpl->setVariable('ARTICLE_TITLE', htmlspecialchars($line['title']), true); $tpl->setVariable('ARTICLE_EXCERPT', $line["content_preview"], true); @@ -125,7 +124,7 @@ class Handler_Public extends Handler { $tpl->setVariable('ARTICLE_AUTHOR', htmlspecialchars($line['author']), true); - $tpl->setVariable('ARTICLE_SOURCE_LINK', htmlspecialchars($line['site_url']), true); + $tpl->setVariable('ARTICLE_SOURCE_LINK', htmlspecialchars($line['site_url'] ? $line["site_url"] : get_self_url_prefix()), true); $tpl->setVariable('ARTICLE_SOURCE_TITLE', htmlspecialchars($line['feed_title'] ? $line['feed_title'] : $feed_title), true); $tags = get_article_tags($line["id"], $owner_uid); @@ -140,7 +139,7 @@ class Handler_Public extends Handler { foreach ($enclosures as $e) { $type = htmlspecialchars($e['content_type']); $url = htmlspecialchars($e['content_url']); - $length = $e['duration']; + $length = $e['duration'] ? $e['duration'] : 1; $tpl->setVariable('ARTICLE_ENCLOSURE_URL', $url, true); $tpl->setVariable('ARTICLE_ENCLOSURE_TYPE', $type, true); @@ -707,7 +706,7 @@ class Handler_Public extends Handler { function index() { header("Content-Type: text/plain"); - print json_encode(array("error" => array("code" => 7))); + print error_json(13); } function forgotpass() { @@ -1002,5 +1001,42 @@ class Handler_Public extends Handler {