summaryrefslogtreecommitdiff
path: root/classes/config.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-08-23 10:56:31 +0300
committerAndrew Dolgov <[email protected]>2021-08-23 10:56:31 +0300
commit2c931df77ccba5e76bc1865584e870219596ff69 (patch)
treef902ce89ac849f6fd3c7d250489ccadf228ccbfd /classes/config.php
parent5c6025447416616f47ab7b22d179d2b27a2c3eba (diff)
remove SELF_USER_AGENT custom constant, replaced with configurable Config::HTTP_USER_AGENT / Config::get_user_agent()
Diffstat (limited to 'classes/config.php')
-rw-r--r--classes/config.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/classes/config.php b/classes/config.php
index 4ae4a2407..be4ecde36 100644
--- a/classes/config.php
+++ b/classes/config.php
@@ -170,6 +170,9 @@ class Config {
const AUTH_MIN_INTERVAL = "AUTH_MIN_INTERVAL";
// minimum amount of seconds required between authentication attempts
+ const HTTP_USER_AGENT = "HTTP_USER_AGENT";
+ // http user agent (changing this is not recommended)
+
// default values for all of the above:
private const _DEFAULTS = [
Config::DB_TYPE => [ "pgsql", Config::T_STRING ],
@@ -224,6 +227,8 @@ class Config {
Config::CHECK_FOR_PLUGIN_UPDATES => [ "true", Config::T_BOOL ],
Config::ENABLE_PLUGIN_INSTALLER => [ "true", Config::T_BOOL ],
Config::AUTH_MIN_INTERVAL => [ 5, Config::T_INT ],
+ Config::HTTP_USER_AGENT => [ 'Tiny Tiny RSS/%s (https://tt-rss.org/)',
+ Config::T_STRING ],
];
private static $instance;
@@ -632,4 +637,8 @@ class Config {
return $rv;
}
+
+ static function get_user_agent() {
+ return sprintf(self::get(self::HTTP_USER_AGENT), self::get_version());
+ }
}