Sat, 08 Jul 2006 Florent Bruneau <florent.bruneau@m4x.org>
* Automatically set fup for crossposts
+ * Full URL redirection
================================================================================
VERSION 1.3
if ($this->nntp->post($msg)) {
$this->spool->delid($id);
$this->nntp->quit();
- header("Location: ?group=$group&first=$id");
+ redirect('group=' . $group . '&first=' . $id);
} else {
return '<p class="error">'._b_('Impossible d\'annuler le message').'</p>';
}
$msg .= $this->custom.$this->profile['customhdr']."\n".$body;
if ($this->nntp->post($msg)) {
- header("Location: ?group=$group".($artid==-1 ? '' : "&first=$artid"));
+ redirect('group=' . $group . ($artid == -1 ? '' : '&first=' . $artid));
} else {
return "<p class=\"error\">"._b_('Impossible de poster le message')."</p>".$this->action_showThread($group, $artid);
}
}
}
+function redirect($params)
+{
+ header('Location: ' . makeLink($params));
+}
+
+function makeLink($params)
+{
+ $proto = empty($_SERVER['HTTPS']) ? 'http://' : 'http://';
+ $host = $_SERVER['HTTP_HOST'];
+ $file = $_SERVER['PHP_SELF'];
+
+ return $proto . $host . $file . '?' . $params;
+}
+
/********************************************************************************
* HTML STUFF
* Taken from php.net