mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-01-24 19:19:34 +00:00
Skip empty values
This commit is contained in:
parent
77b28327c8
commit
a2cb829d27
1 changed files with 4 additions and 1 deletions
|
|
@ -270,8 +270,11 @@ class LCSCProvider implements InfoProviderInterface
|
||||||
|
|
||||||
foreach ($attributes as $attribute) {
|
foreach ($attributes as $attribute) {
|
||||||
|
|
||||||
|
//Skip this attribute if it's empty
|
||||||
|
if (in_array(trim($attribute['paramValueEn']), array('', '-'))) {
|
||||||
|
continue;
|
||||||
//If the attribute contains a tilde we assume it is a range
|
//If the attribute contains a tilde we assume it is a range
|
||||||
if (str_contains($attribute['paramValueEn'], '~')) {
|
} elseif (str_contains($attribute['paramValueEn'], '~')) {
|
||||||
$parts = explode('~', $attribute['paramValueEn']);
|
$parts = explode('~', $attribute['paramValueEn']);
|
||||||
if (count($parts) === 2) {
|
if (count($parts) === 2) {
|
||||||
//Try to extract number and unit from value (allow leading +)
|
//Try to extract number and unit from value (allow leading +)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue