From 16e69de3989e8b4a6e36df6241640853e099a962 Mon Sep 17 00:00:00 2001 From: Ian Walls Date: Fri, 24 Jul 2026 08:03:39 -0400 Subject: [PATCH] Fix regex for print file name validation Updated regex pattern to match print file names correctly. Anchored to end of the string, and made sure we match at least one character before the pattern match --- lib/Libki/Controller/API/Client/v1_0.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Libki/Controller/API/Client/v1_0.pm b/lib/Libki/Controller/API/Client/v1_0.pm index 267dcd9e..21e52d41 100644 --- a/lib/Libki/Controller/API/Client/v1_0.pm +++ b/lib/Libki/Controller/API/Client/v1_0.pm @@ -666,7 +666,8 @@ sub print : Path('print') : Args(0) { if ( $client && $user ) { my $print_file = $c->req->upload('print_file'); - $print_file->filename =~ m/[a-zA-z]*(\d+)_(\d+)\.[a-zA-Z]+/; + # expected pattern is _. + $print_file->filename =~ m/[a-zA-z]+(\d+)_(\d+)\.[a-zA-Z]+$/; my $copies = $1 || 1; Libki::Utils::Printing::create_print_job_and_file(