From 9338219a68f514d3a755afc180c037d28cbc73ce Mon Sep 17 00:00:00 2001 From: Dustin Wilson Date: Wed, 29 Mar 2017 09:27:54 -0500 Subject: [PATCH] Improved UA String MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Added version constant in bootstrap • Made the user agent string output information in a format similar to a web browser with software version along with OS information and architecture --- bootstrap.php | 1 + lib/Conf.php | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/bootstrap.php b/bootstrap.php index cbe05b7a..9fdf627f 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -4,6 +4,7 @@ namespace JKingWeb\Arsse; const BASE = __DIR__.DIRECTORY_SEPARATOR; const NS_BASE = __NAMESPACE__."\\"; +const VERSION = "0.0.0"; if(!defined(NS_BASE."INSTALL")) define(NS_BASE."INSTALL", false); diff --git a/lib/Conf.php b/lib/Conf.php index 352cc42c..5decf1d7 100644 --- a/lib/Conf.php +++ b/lib/Conf.php @@ -29,9 +29,16 @@ class Conf { public $userComposeNames = true; public $userTempPasswordLength = 20; - public $userAgentString = 'Arsse (https://code.jkingweb.ca/jking/arsse)'; + public $userAgentString; public function __construct(string $import_file = "") { + $this->userAgentString = sprintf('Arsse/%s (%s %s; %s; https://code.jkingweb.ca/jking/arsse) PicoFeed (https://github.com/fguillot/picoFeed)', + VERSION, // Arsse version + php_uname('s'), // OS + php_uname('r'), // OS version + php_uname('m') // platform architecture + ); + if($import_file != "") $this->importFile($import_file); }