From: Thomas Hochstein Date: Wed, 19 Mar 2014 20:46:32 +0000 (+0100) Subject: Correctly find $votename. X-Git-Tag: 4.0.12^2~3 X-Git-Url: https://code.th-h.de/?p=usenet%2Fusevote.git;a=commitdiff_plain;h=3ab56bde53da7d77b3119e6793059aa9689e0d11;hp=f5828d9fad01f6e4ec78b5a6c00db848b0ba2018 Correctly find $votename. Picked from upstream. Signed-off-by: Thomas Hochstein --- diff --git a/CHANGES b/CHANGES index ba7460a..5067501 100644 --- a/CHANGES +++ b/CHANGES @@ -26,6 +26,8 @@ Version 4.12 (19.01.2014): - BDSG-Klausel muss nun standardmaessig zwingend mit JA beantwortet werden, DAFUER wird nicht mehr akzeptiert. Dies kann in usevote.cfg konfiguriert werden +- Regular Expression fuer Pruefung des Abstimmungsnamens weiter + verbessert Version 4.11 (25.09.2012): - Regular Expression fuer Pruefung des Abstimmungsnamens verbessert. diff --git a/UVconfig.pm b/UVconfig.pm index 571ab69..1c64b14 100644 --- a/UVconfig.pm +++ b/UVconfig.pm @@ -121,6 +121,7 @@ sub read_config { tpl_rule_violated => 'rule-violated', begin_divider => 'Alles vor dieser Zeile bitte loeschen', end_divider => 'Alles nach dieser Zeile bitte loeschen', + ballotintro => 'WAHLSCHEIN fuer', nametext => 'Dein Realname, falls nicht im FROM-Header:', nametext2 => 'Waehlername:', addresstext => 'Waehleradresse:', diff --git a/uvvote.pl b/uvvote.pl index a82874a..c101f1f 100644 --- a/uvvote.pl +++ b/uvvote.pl @@ -231,9 +231,9 @@ sub process_vote { } # correct voting? - if ($$body =~ /\Q$config{ballotintro}\E\s+(.+?)[^\S\n]*\n([>:|]*?[\t ]+(\S+.+)\s*$)?/m) { + if ($$body =~ /\Q$config{ballotintro}\E\s+(.+?)\s*\n([>:|]*?[\t ]+(\S+.+)\s*$)?/m) { $voting = $1; - $voting .= " $3" if defined($3); + $voting .= " $3" if (defined($3) and $3 !~ /\Q$config{nametext}\E/); push (@errors, 'WrongVoting') if ($config{votename} !~ /^\s*\Q$voting\E\s*$/); } else { push (@errors, 'NoVoting');