Skip to content

Commit

Permalink
fix(jornaln): Array to string conversion at lib/BridgeAbstract.php li… (
Browse files Browse the repository at this point in the history
#3523)

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

* yup
  • Loading branch information
dvikan authored Jul 11, 2023
1 parent c9a861e commit 6c0e186
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 4 additions & 1 deletion bridges/JornalNBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ public function getIcon()

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()
Expand Down
5 changes: 2 additions & 3 deletions lib/BridgeAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,11 +314,10 @@ public function getKey($input)
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) {
Expand Down

0 comments on commit 6c0e186

Please sign in to comment.