From 62f1bb06a21c3b07acf8005c30a5d856199d7424 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 2 Oct 2010 13:46:47 -0700 Subject: Set the User-Agent field to "Gallery3" by default. Fixes #1408. --- modules/gallery/helpers/MY_remote.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/gallery/helpers/MY_remote.php b/modules/gallery/helpers/MY_remote.php index 3e13ba8d..05341330 100644 --- a/modules/gallery/helpers/MY_remote.php +++ b/modules/gallery/helpers/MY_remote.php @@ -63,6 +63,9 @@ class remote extends remote_Core { * WebHelper_simple::_parseLocation logic. */ static function do_request($url, $method='GET', $headers=array(), $body='') { + if (!array_key_exists("User-Agent", $headers)) { + $headers["User-Agent"] = "Gallery3"; + } /* Convert illegal characters */ $url = str_replace(' ', '%20', $url); -- cgit v1.2.3