summaryrefslogtreecommitdiff
path: root/inc/Mailer.class.php
diff options
context:
space:
mode:
authorChristopher Smith <chris@jalakai.co.uk>2014-03-06 19:55:56 +0000
committerChristopher Smith <chris@jalakai.co.uk>2014-03-06 19:55:56 +0000
commit585bf44e2b756eac2e1cfce7035ef237bc02a788 (patch)
treea9b431951c39bbac03c125fc6a13d3cca15eba9e /inc/Mailer.class.php
parent1418498c406caca058076e3d148e31daee800551 (diff)
downloadrpg-585bf44e2b756eac2e1cfce7035ef237bc02a788.tar.gz
rpg-585bf44e2b756eac2e1cfce7035ef237bc02a788.tar.bz2
amend $_SERVER to $INPUT->server
Diffstat (limited to 'inc/Mailer.class.php')
-rw-r--r--inc/Mailer.class.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/inc/Mailer.class.php b/inc/Mailer.class.php
index e32178bba..e90b45f99 100644
--- a/inc/Mailer.class.php
+++ b/inc/Mailer.class.php
@@ -39,6 +39,8 @@ class Mailer {
*/
public function __construct() {
global $conf;
+ /* @var Input $INPUT */
+ global $INPUT;
$server = parse_url(DOKU_URL, PHP_URL_HOST);
if(strpos($server,'.') === false) $server = $server.'.localhost';
@@ -53,7 +55,7 @@ class Mailer {
// add some default headers for mailfiltering FS#2247
$this->setHeader('X-Mailer', 'DokuWiki');
- $this->setHeader('X-DokuWiki-User', $_SERVER['REMOTE_USER']);
+ $this->setHeader('X-DokuWiki-User', $INPUT->server->str('REMOTE_USER'));
$this->setHeader('X-DokuWiki-Title', $conf['title']);
$this->setHeader('X-DokuWiki-Server', $server);
$this->setHeader('X-Auto-Response-Suppress', 'OOF');
@@ -181,6 +183,9 @@ class Mailer {
public function setBody($text, $textrep = null, $htmlrep = null, $html = null, $wrap = true) {
global $INFO;
global $conf;
+ /* @var Input $INPUT */
+ global $INPUT;
+
$htmlrep = (array)$htmlrep;
$textrep = (array)$textrep;
@@ -218,24 +223,24 @@ class Mailer {
$cip = gethostsbyaddrs($ip);
$trep = array(
'DATE' => dformat(),
- 'BROWSER' => $_SERVER['HTTP_USER_AGENT'],
+ 'BROWSER' => $INPUT->server->str('HTTP_USER_AGENT'),
'IPADDRESS' => $ip,
'HOSTNAME' => $cip,
'TITLE' => $conf['title'],
'DOKUWIKIURL' => DOKU_URL,
- 'USER' => $_SERVER['REMOTE_USER'],
+ 'USER' => $INPUT->server->str('REMOTE_USER'),
'NAME' => $INFO['userinfo']['name'],
'MAIL' => $INFO['userinfo']['mail'],
);
$trep = array_merge($trep, (array)$textrep);
$hrep = array(
'DATE' => '<i>'.hsc(dformat()).'</i>',
- 'BROWSER' => hsc($_SERVER['HTTP_USER_AGENT']),
+ 'BROWSER' => hsc($INPUT->server->str('HTTP_USER_AGENT')),
'IPADDRESS' => '<code>'.hsc($ip).'</code>',
'HOSTNAME' => '<code>'.hsc($cip).'</code>',
'TITLE' => hsc($conf['title']),
'DOKUWIKIURL' => '<a href="'.DOKU_URL.'">'.DOKU_URL.'</a>',
- 'USER' => hsc($_SERVER['REMOTE_USER']),
+ 'USER' => hsc($INPUT->server->str('REMOTE_USER')),
'NAME' => hsc($INFO['userinfo']['name']),
'MAIL' => '<a href="mailto:"'.hsc($INFO['userinfo']['mail']).'">'.
hsc($INFO['userinfo']['mail']).'</a>',