mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-08 00:52:01 +01:00
Qual: Fix PhanPluginDuplicateIfStatements & remove exceptions (#28749)
# Qual: Fix PhanPluginDuplicateIfStatements & remove exceptions Fix occurences of PhanPluginDuplicateIfStatements which are if statements where the consecutive branches execute the same code, making it useles to test the condition
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2011-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* 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
|
||||
@@ -475,30 +476,21 @@ class RssParser
|
||||
}
|
||||
}
|
||||
} elseif ($rss->_format == 'atom') {
|
||||
if (getDolGlobalString('EXTERNALRSS_USE_SIMPLEXML')) {
|
||||
$itemLink = (isset($item['link']) ? sanitizeVal((string) $item['link']) : '');
|
||||
$itemTitle = sanitizeVal((string) $item['title']);
|
||||
$itemDescription = sanitizeVal($this->getAtomItemDescription($item));
|
||||
$itemPubDate = sanitizeVal((string) $item['created']);
|
||||
$itemId = sanitizeVal((string) $item['id']);
|
||||
$itemAuthor = sanitizeVal((string) ($item['author'] ? $item['author'] : $item['author_name']));
|
||||
} else {
|
||||
$itemLink = (isset($item['link']) ? sanitizeVal((string) $item['link']) : '');
|
||||
$itemTitle = sanitizeVal((string) $item['title']);
|
||||
$itemDescription = sanitizeVal($this->getAtomItemDescription($item));
|
||||
$itemPubDate = sanitizeVal((string) $item['created']);
|
||||
$itemId = sanitizeVal((string) $item['id']);
|
||||
$itemAuthor = sanitizeVal((string) ($item['author'] ? $item['author'] : $item['author_name']));
|
||||
}
|
||||
$itemLink = (isset($item['link']) ? sanitizeVal((string) $item['link']) : '');
|
||||
$itemTitle = sanitizeVal((string) $item['title']);
|
||||
$itemDescription = sanitizeVal($this->getAtomItemDescription($item));
|
||||
$itemPubDate = sanitizeVal((string) $item['created']);
|
||||
$itemId = sanitizeVal((string) $item['id']);
|
||||
$itemAuthor = sanitizeVal((string) ($item['author'] ? $item['author'] : $item['author_name']));
|
||||
$itemCategory = array();
|
||||
} else {
|
||||
$itemCategory = array();
|
||||
$itemLink = '';
|
||||
$itemTitle = '';
|
||||
$itemDescription = '';
|
||||
$itemPubDate = '';
|
||||
$itemId = '';
|
||||
$itemAuthor = '';
|
||||
$itemCategory = array();
|
||||
print 'ErrorBadFeedFormat';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user