Fix: 🛟Duplicate test and false positive phan notice (#30822)

* Qual: Fix false positive phan notice

* Fix: Duplicate condition for vcf location, change 2nd test to contact
This commit is contained in:
MDW 2024-09-01 14:37:45 +02:00 committed by GitHub
parent 3f9b2d9d57
commit 56e2c8bf36
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View File

@ -1253,6 +1253,7 @@ class ProductAttribute extends CommonObject
}
if (property_exists($this, 'amount')) {
$return .= '<br>';
// @phan-suppress-next-line PhanUndeclaredProperty
$return .= '<span class="info-box-label amount">'.price($this->amount, 0, $langs, 1, -1, -1, $conf->currency).'</span>';
}
if (method_exists($this, 'getLibStatut')) {

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2016 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* 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;