From 56e2c8bf3632c20f79805859a205e281c1634a38 Mon Sep 17 00:00:00 2001 From: MDW Date: Sun, 1 Sep 2024 14:37:45 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20=F0=9F=9B=9FDuplicate=20test=20and=20fal?= =?UTF-8?q?se=20positive=20phan=20notice=20(#30822)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Qual: Fix false positive phan notice * Fix: Duplicate condition for vcf location, change 2nd test to contact --- htdocs/variants/class/ProductAttribute.class.php | 1 + htdocs/viewimage.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/variants/class/ProductAttribute.class.php b/htdocs/variants/class/ProductAttribute.class.php index e30c34735ea..1b62f1b60e4 100644 --- a/htdocs/variants/class/ProductAttribute.class.php +++ b/htdocs/variants/class/ProductAttribute.class.php @@ -1253,6 +1253,7 @@ class ProductAttribute extends CommonObject } if (property_exists($this, 'amount')) { $return .= '
'; + // @phan-suppress-next-line PhanUndeclaredProperty $return .= ''.price($this->amount, 0, $langs, 1, -1, -1, $conf->currency).''; } if (method_exists($this, 'getLibStatut')) { diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index aa4c2fe2463..38bdefbd9b4 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -2,6 +2,7 @@ /* Copyright (C) 2004-2005 Rodolphe Quiedeville * Copyright (C) 2005-2016 Laurent Destailleur * Copyright (C) 2005-2016 Regis Houssin + * 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 @@ -322,7 +323,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;