From 3ee8b9406bfc2fea04846393fcc5eabefea608bc Mon Sep 17 00:00:00 2001 From: Pepijn Over Date: Sun, 6 Apr 2014 16:16:10 +0200 Subject: [PATCH] issue #49: set custom user agent so requests can be identified in access logs --- CHANGELOG.md | 9 +++++---- src/includes/functions.inc.php | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 28f801f8..7299ca19 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,22 +2,23 @@ ## Changelog -### v2.2.0 (not yet released, 2014) +### v3.0.0 (released April 6, 2014) * New module structure (not backwards compatible). - * Template directory restructured to correspond with module structure. * Added user login system with 2 user levels (administrator and regular user). * Added warning threshold option (set number of failed checks before server goes offline). * Added SMTP support. * Adding Bulgarian language file (thanks to Plamen Vasilev). - * Added user profile page. * Added history tracking of server uptime. * Added history graphs of server uptime and latency (thanks to Jérôme Cabanis). + * Added user profile page. * Status page is now default homepage. - * Updated French translation. + * Updated translations. * Date and time formats are taken from language file and localized per language (thanks to Jérôme Cabanis). * When checking a website, the updater will now follow 302 Location headers. * String/pattern search on websites did not work for websites with compression turned on. + * The monitor now uses a custom user agent so it can be identified in access logs (Mozilla/5.0 (compatible; phpservermon/version; +http://www.phpservermonitor.org)). + * Template directory restructured to correspond with module structure. * Switched from mysql_* to PDO. * Updated PHPMailer package to v5.2.6. * Fixed several XSS vulnerabilities. diff --git a/src/includes/functions.inc.php b/src/includes/functions.inc.php index 5d713ee0..7da63612 100644 --- a/src/includes/functions.inc.php +++ b/src/includes/functions.inc.php @@ -263,7 +263,7 @@ function psm_curl_get($href, $header = false, $body = true, $timeout = 10, $add_ curl_setopt($ch, CURLOPT_ENCODING, ''); curl_setopt($ch, CURLOPT_URL, $href); if($add_agent) { - curl_setopt ($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11'); + curl_setopt ($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; phpservermon/'.PSM_VERSION.'; +http://www.phpservermonitor.org)'); } $result = curl_exec($ch);