From 9fe04aea4c1b245a8f8750729df826b82bdedde4 Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Wed, 13 Jan 2016 14:19:35 +0100 Subject: Anchor regex for my peace of mind --- itjs.class | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'itjs.class') diff --git a/itjs.class b/itjs.class index 45b68de..0a57465 100644 --- a/itjs.class +++ b/itjs.class @@ -133,10 +133,10 @@ static function filenames($filelist) foreach (it::match("[-\w.=?&]+", basename($filelist), array('all' => true)) as $file) # split by comma but ignore illegal chars { - $filenames = $special[$file] ?: (file_exists("$local/" . it::match('[^?]*', $file)) ? "$local/$file" : "$libsearch/itjs/$file"); + $filenames = $special[$file] ?: (file_exists("$local/" . it::match('^[^?]*', $file)) ? "$local/$file" : "$libsearch/itjs/$file"); foreach (explode(",", $filenames) as $filename) - if (!$seen[$filename]++ && file_exists(it::match('[^?]*', $filename))) + if (!$seen[$filename]++ && file_exists(it::match('^[^?]*', $filename))) $result[] = $filename; } -- cgit v1.2.3