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:
Arthur Suzuki 2026-01-06 10:03:52 +00:00 committed by Lucas Gass
parent 110f7d8030
commit c3e8b34e6a
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 7 additions and 1 deletions

View File

@ -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;
};