# geschrieben wurde.\r
#\r
# Autor: Patrick Canterino <patrick@patshaping.de>\r
-# Letzte Aenderung: 12.12.2011\r
+# Letzte Aenderung: 16.12.2011\r
#\r
# Copyright (C) 2002-2011 Patrick Canterino\r
#\r
if($text_max && strlen($text) > $text_max) show_user_error($err_text_long);\r
\r
# Pruefen, ob eingegebene E-Mail-Adresse gueltig ist\r
-# Danke an "ich" aus dem SELFHTML Forum fuer die Muehe\r
\r
-$mail_regexp = ($no_tld)\r
- ? '/^([a-z0-9]+([\.]?|[-]?|[_]?)?)*([a-z0-9]+([\.]?[_]?)?)@([a-z0-9]+([\.]?|[-]?)?)*[a-z0-9]$/i'\r
- : '/^([a-z0-9]+([\.]?|[-]?|[_]?)?)*([a-z0-9]+([\.]?[_]?)?)@([a-z0-9]+([\.]?|[-]?)?)*[a-z0-9]+\.{1}[a-z]{2,6}$/i';\r
-\r
-if(!preg_match($mail_regexp,$email)) show_user_error($err_invalid_email);\r
+if(!filter_var($email,FILTER_VALIDATE_EMAIL)) show_user_error($err_invalid_email);\r
\r
# Individuelle Felder einlesen\r
\r
if($return_url) {\r
# Per Redirect auf Seite umleiten\r
\r
- if(!preg_match('!://!',$return_url)) {\r
+ if(strpos($return_url,'://') === false) {\r
# URL vervollstaendigen\r
\r
$http_host = ($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME'];\r
$protocol = '';\r
$port = '';\r
+ $path = '';\r
\r
- if($_SERVER['HTTPS']) {\r
+ if(isset($_SERVER['HTTPS'])) {\r
# SSL-verschluesseltes HTTP\r
\r
$protocol = 'https://';\r
if($_SERVER['SERVER_PORT'] != 80) $port = ':'.$_SERVER['SERVER_PORT'];\r
}\r
\r
- if(preg_match('!^/!',$return_url)) {\r
+ if(substr($return_url,0,1) == '/') {\r
$return_url = $protocol.$http_host.$port.$return_url;\r
}\r
else {\r
- if(preg_match('!/$!',$_SERVER['SCRIPT_NAME'])) $path = substr($_SERVER['SCRIPT_NAME'],0,-1);\r
+ if(substr($_SERVER['SCRIPT_NAME'],-1,1) == '/') $path = substr($_SERVER['SCRIPT_NAME'],0,-1);\r
$path = substr($path,0,strrpos($path,'/')+1);\r
- if(!preg_match('!^/!',$path)) $path = '/'.$path;\r
+ if(substr($path,0,1) != '/') $path = '/'.$path;\r
\r
$return_url = $protocol.$http_host.$port.$path.$return_url;\r
}\r