[interchange-cvs] interchange - racke modified 2 files

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Wed Jan 28 07:38:26 UTC 2009


User:      racke
Date:      2009-01-28 07:38:26 GMT
Modified:  .        WHATSNEW-5.7
Modified:  code/OrderCheck email_only.oc
Log:
Allow custom error messages for email_only check.

Revision  Changes    Path
2.25                 interchange/WHATSNEW-5.7


rev 2.25, prev_rev 2.24
Index: WHATSNEW-5.7
===================================================================
RCS file: /var/cvs/interchange/WHATSNEW-5.7,v
retrieving revision 2.24
retrieving revision 2.25
diff -u -r2.24 -r2.25
--- WHATSNEW-5.7	26 Jan 2009 09:49:11 -0000	2.24
+++ WHATSNEW-5.7	28 Jan 2009 07:38:26 -0000	2.25
@@ -37,6 +37,10 @@
 
 * [run-profile] now accepts ref attribute to check an arbitrary hash.
 
+Checks
+------
+
+* Allow custom error messages for email_only check.
 
 ------------------------------------------------------------------------------
 



1.5                  interchange/code/OrderCheck/email_only.oc


rev 1.5, prev_rev 1.4
Index: email_only.oc
===================================================================
RCS file: /var/cvs/interchange/code/OrderCheck/email_only.oc,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- email_only.oc	30 Mar 2007 23:40:48 -0000	1.4
+++ email_only.oc	28 Jan 2009 07:38:26 -0000	1.5
@@ -1,23 +1,23 @@
-# Copyright 2005-2007 Interchange Development Group and others
+# Copyright 2005-2009 Interchange Development Group and others
 # 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.  See the LICENSE file for details.
 # 
-# $Id: email_only.oc,v 1.4 2007-03-30 23:40:48 pajamian Exp $
+# $Id: email_only.oc,v 1.5 2009-01-28 07:38:26 racke Exp $
 
 CodeDef email_only OrderCheck 1
 CodeDef email_only Description Email address
 CodeDef email_only Routine <<EOR
 sub {
-	my($ref, $var, $val) = @_;
+	my($ref, $var, $val, $msg) = @_;
 	if($val and $val =~ /^[\040-\077\101-\176]+\@[-A-Za-z0-9.]+\.[A-Za-z]+$/) {
 		return (1, $var, '');
 	}
 	else {
 		return (undef, $var,
-			errmsg( "'%s' not an email address", $val )
+			$msg || errmsg("'%s' not an email address", $val )
 		);
 	}
 }







More information about the interchange-cvs mailing list