diff --git a/bridges/JornalNBridge.php b/bridges/JornalNBridge.php index 7eadc025681..2a9d6661455 100644 --- a/bridges/JornalNBridge.php +++ b/bridges/JornalNBridge.php @@ -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() diff --git a/lib/BridgeAbstract.php b/lib/BridgeAbstract.php index 3a2c47f2f25..f024393d183 100644 --- a/lib/BridgeAbstract.php +++ b/lib/BridgeAbstract.php @@ -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) {