email evaluation
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
tobiasd 2025-04-29 14:37:30 +02:00
parent 8b4dd0dadc
commit 84b165680b
Signed by: tobiasd
GPG Key ID: 25FE376FF17694A1
2 changed files with 9 additions and 0 deletions

View File

@ -4,6 +4,7 @@
import logging
import multiprocessing
import shutil
from pathlib import Path
logger = logging.getLogger(__name__)
@ -18,6 +19,8 @@ def _copy_file(target: Path, source_file: Path) -> None:
logger.debug(f"Copying {source_file} to {target_file}")
target_file.parent.mkdir(parents=True, exist_ok=True)
target_file.write_bytes(source_file.read_bytes())
# preserve file modes
shutil.copymode(source_file, target_file)
def copy_files(pool: multiprocessing.Pool, target: Path) -> None:

View File

@ -92,6 +92,12 @@ if ( !$email ) {
print "<p>Please enter your email address!</p>\n";
exit;
}
if ( !$email =~ /^([a-zA-Z][\w\])\@([a-zA-Z0-9.-]+)\.([a-zA-Z]+)/ ) {
print "Content-type: text/html\n\n";
print "<p>Coult not validate your email address</p>\n";
print "<p>Please check your email address!</p>\n";
exit;
}
my $items_file = $ENV{"DOCUMENT_ROOT"} . "order/data/items.en.xml";
my $items = XML::LibXML->load_xml(location => $items_file);