diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index 5cee83820af..bc8cf6cf243 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -2,7 +2,8 @@ /* Copyright (C) 2004-2005 Rodolphe Quiedeville * Copyright (C) 2005-2016 Laurent Destailleur * Copyright (C) 2005-2016 Regis Houssin - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -339,7 +340,7 @@ if ($modulepart == 'barcode') { // If $code is virtualcard_xxx_999.vcf, it is a file to read to get code $reg = array(); - if (preg_match('/virtualcard_([^_]+)_(\d+)\.vcf/', $code, $reg)) { + if (preg_match('/^virtualcard_([^_]+)_(\d+)\.vcf$/', $code, $reg)) { $vcffile = ''; if ($reg[1] == 'user') { $vcffile = $conf->user->dir_temp.'/'.$code;