git.shiar.nl
/
minimedit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
page: promote news article class to represent all pages
[minimedit.git]
/
contact.php
diff --git
a/contact.php
b/contact.php
index 9d0b1bcae9d16f15968dccf7621dd77237c058e4..b50537517d7b68952f50922a53c244b7763e8e91 100644
(file)
--- a/
contact.php
+++ b/
contact.php
@@
-2,8
+2,8
@@
$error = NULL;
if ($_POST) {
global $User;
$error = NULL;
if ($_POST) {
global $User;
- if (
!empty($User)
) {
- $_REQUEST['login'] = $User
['name']
;
+ if (
$User
) {
+ $_REQUEST['login'] = $User
->login
;
}
$error = mailform($_REQUEST);
if (!empty($error)) {
}
$error = mailform($_REQUEST);
if (!empty($error)) {
@@
-14,7
+14,8
@@
if ($_POST) {
function mailform($input = [])
{
$source = empty($input['subject']) ? 'reactie' : $input['subject'];
function mailform($input = [])
{
$source = empty($input['subject']) ? 'reactie' : $input['subject'];
- $rcpt = 'info@'.$_SERVER['HTTP_HOST'];
+ $domain = preg_replace('/^www\./', '', $_SERVER['HTTP_HOST']);
+ $rcpt = "info@$domain";
$subject = "Formulier {$_SERVER['HTTP_HOST']}: $source";
if (!$input) {
$subject = "Formulier {$_SERVER['HTTP_HOST']}: $source";
if (!$input) {
@@
-46,7
+47,7
@@
switch ($source) {
}
$reply = preg_match('/\A\w+@\w+\.[a-z]+\z/', @$input['email'])
}
$reply = preg_match('/\A\w+@\w+\.[a-z]+\z/', @$input['email'])
- ? $input['email'] :
'noreply@'.$_SERVER['HTTP_HOST']
;
+ ? $input['email'] :
"noreply@$domain"
;
$header = "From: $reply";
foreach (array(
$header = "From: $reply";
foreach (array(