Skip to content
This repository has been archived by the owner on Aug 15, 2023. It is now read-only.

ttrss has removed SELF_USER_AGENT custom constant #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion init.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,16 @@ public function hook_fetch_feed($feed_data, $fetch_url, $owner_uid, $feed, $last
if (!empty($options["user_agent"])) {
curl_setopt($ch, CURLOPT_USERAGENT, $options["user_agent"]);
} else {
curl_setopt($ch, CURLOPT_USERAGENT, SELF_USER_AGENT);

/**
* 2021-8-23, ttrss has removed SELF_USER_AGENT custom constant, replaced with configurable Config::HTTP_USER_AGENT / Config::get_user_agent()
* from https://git.tt-rss.org/fox/tt-rss.git/commit/?id=2c931df77ccba5e76bc1865584e870219596ff69
*/
if (defined('SELF_USER_AGENT')) {
curl_setopt($ch, CURLOPT_USERAGENT, SELF_USER_AGENT);
} else {
curl_setopt($ch, CURLOPT_USERAGENT, Config::get_user_agent());
}
}

if (empty($options["ssl_verify"])) {
Expand Down