Bug 41060: (QA follow-up) improve ISSN format detection
Two tests have been added: - not only the checksum of the ISSN is checked but also the format. - if the ISSN is left empty, the plugin won't give a warning. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
110f7d8030
commit
c3e8b34e6a
|
|
@ -60,7 +60,13 @@ my $launcher = sub {
|
|||
flagsrequired => { editcatalogue => '*' },
|
||||
}
|
||||
);
|
||||
my $is_valid = is_valid_checksum($issn);
|
||||
my $is_valid = 0;
|
||||
if ( $issn =~ /^\d{4}-\d{3}[\dXx]$/ ) {
|
||||
$is_valid = is_valid_checksum($issn);
|
||||
}
|
||||
if ( $issn eq '' ) {
|
||||
$is_valid = 1;
|
||||
}
|
||||
$template->param( return => $is_valid );
|
||||
output_html_with_http_headers $cgi, $cookie, $template->output;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue