[kde-services-devel] r485 - trunk/commitfilter/web
josef at new.kstuff.org
josef at new.kstuff.org
Sun Oct 12 20:34:39 CEST 2008
Author: josef
Date: 2008-10-12 20:34:38 +0200 (Sun, 12 Oct 2008)
New Revision: 485
Modified:
trunk/commitfilter/web/func.my.inc
Log:
- ensure that only fully-qualified mail addresses can be registered
Modified: trunk/commitfilter/web/func.my.inc
===================================================================
--- trunk/commitfilter/web/func.my.inc 2008-10-12 17:38:56 UTC (rev 484)
+++ trunk/commitfilter/web/func.my.inc 2008-10-12 18:34:38 UTC (rev 485)
@@ -80,7 +80,7 @@
$submitregex = $_POST['submitregex'];
$regexadd_regex = $_POST['regexadd_regex'];
-$conf_email= $_POST['conf_email'];
+$conf_email = $_POST['conf_email'];
$conf_news = $_POST['conf_news'];
$submit = $_POST['submit'];
@@ -169,9 +169,15 @@
else :
$news = 0;
endif;
- pg_exec($id, "UPDATE users SET email = '$conf_email', news = '$news' " .
- "WHERE username = '$username'");
- $email = $conf_email;
+ if(preg_match("/^[^@]+@[^@]+$/", $conf_email)) :
+ pg_exec($id, "UPDATE users SET email = '$conf_email', news = '$news' " .
+ "WHERE username = '$username'");
+ $email = $conf_email;
+ else :
+ table_start();
+ echo "Error: '$conf_email' is not a valid email address.";
+ table_stop();
+ endif;
endif;
if ($submit) :
More information about the kde-services-devel
mailing list