[interchange] Remove newline from errormessages to be able to parse locale of it

Gert van der Spoel interchange-cvs at icdevgroup.org
Mon Feb 28 08:19:50 UTC 2011


commit 849b9ca979e21b23b6e73b19596f408cb7a28595
Author: Gert van der Spoel <gert at 3edge.com>
Date:   Mon Feb 28 09:15:15 2011 +0100

    Remove newline from errormessages to be able to parse locale of it
    
    Triggered by RT #306 it was found out that there were some error messages
    containing a new line in the message. These lines would not be easy to
    parse for the translated equivalent.
    
    The newlines are needed for the expected working of the 'die' command
    (see RT #306 for the discussion).

 lib/Vend/UserDB.pm |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/lib/Vend/UserDB.pm b/lib/Vend/UserDB.pm
index 0f5f1f5..f74af93 100644
--- a/lib/Vend/UserDB.pm
+++ b/lib/Vend/UserDB.pm
@@ -1828,7 +1828,7 @@ sub new_account {
 		}
 		# plain error message without user-supplied username
 		# to avoid XSS exploit (RT #306)
-		die errmsg("Username contains illegal characters.\n")
+		die errmsg("Username contains illegal characters.") . "\n"
 			if $self->{USERNAME} !~ m{^$self->{VALIDCHARS}+$};
 		die errmsg("Must have at least %s characters in username.",
 			$self->{USERMINLEN}) . "\n"
@@ -1836,7 +1836,7 @@ sub new_account {
 
 		if($self->{OPTIONS}{captcha}) {
 			my $status = Vend::Tags->captcha( { function => 'check' });
-			die errmsg("Must input captcha code correctly.\n") 
+			die errmsg("Must input captcha code correctly.") . "\n"
 				unless $status;
 		}
 



More information about the interchange-cvs mailing list