fix(jornaln): Array to string conversion at lib/BridgeAbstract.php li… (#3523)

* fix(jornaln): Array to string conversion at lib/BridgeAbstract.php line 320

* yup
This commit is contained in:
Dag 2023-07-11 16:54:59 +02:00 committed by GitHub
parent c9a861e259
commit 6c0e186d3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -52,7 +52,10 @@ class JornalNBridge extends BridgeAbstract
public function getName()
{
return !is_null($this->getKey('feed')) ? self::NAME . ' | ' . $this->getKey('feed') : self::NAME;
if ($this->getKey('feed')) {
return self::NAME . ' | ' . $this->getKey('feed');
}
return self::NAME;
}
public function getURI()

View File

@ -314,11 +314,10 @@ abstract class BridgeAbstract implements BridgeInterface
if (!isset($context)) {
$context = $this->queriedContext;
}
$needle = $this->inputs[$this->queriedContext][$input]['value'];
foreach (static::PARAMETERS[$context][$input]['values'] as $first_level_key => $first_level_value) {
// todo: this cast emits error if it's an array
$valueString = (string) $first_level_value;
if ($needle === $valueString) {
if (!is_array($first_level_value) && $needle === (string)$first_level_value) {
return $first_level_key;
} elseif (is_array($first_level_value)) {
foreach ($first_level_value as $second_level_key => $second_level_value) {