mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-10 17:08:47 +00:00
fix: a few deprecation notices on php 8.2 (#3917)
* fix: a few deprecation notices on php 8.2 * tweak
This commit is contained in:
parent
4986119f1f
commit
487c692e68
@ -35,10 +35,23 @@ class AllegroBridge extends BridgeAbstract
|
|||||||
|
|
||||||
public function getName()
|
public function getName()
|
||||||
{
|
{
|
||||||
parse_str(parse_url($this->getInput('url'), PHP_URL_QUERY), $fields);
|
$url = $this->getInput('url');
|
||||||
|
if (!$url) {
|
||||||
|
return parent::getName();
|
||||||
|
}
|
||||||
|
$parsedUrl = parse_url($url, PHP_URL_QUERY);
|
||||||
|
if (!$parsedUrl) {
|
||||||
|
return parent::getName();
|
||||||
|
}
|
||||||
|
parse_str($parsedUrl, $fields);
|
||||||
|
|
||||||
if ($query = array_key_exists('string', $fields) ? urldecode($fields['string']) : false) {
|
if (array_key_exists('string', $fields)) {
|
||||||
return $query;
|
$f = urldecode($fields['string']);
|
||||||
|
} else {
|
||||||
|
$f = false;
|
||||||
|
}
|
||||||
|
if ($f) {
|
||||||
|
return $f;
|
||||||
}
|
}
|
||||||
|
|
||||||
return parent::getName();
|
return parent::getName();
|
||||||
|
@ -31,7 +31,11 @@ class EBayBridge extends BridgeAbstract
|
|||||||
|
|
||||||
public function getName()
|
public function getName()
|
||||||
{
|
{
|
||||||
$urlQueries = explode('&', parse_url($this->getInput('url'), PHP_URL_QUERY));
|
$url = $this->getInput('url');
|
||||||
|
if (!$url) {
|
||||||
|
return parent::getName();
|
||||||
|
}
|
||||||
|
$urlQueries = explode('&', parse_url($url, PHP_URL_QUERY));
|
||||||
|
|
||||||
$searchQuery = array_reduce($urlQueries, function ($q, $p) {
|
$searchQuery = array_reduce($urlQueries, function ($q, $p) {
|
||||||
if (preg_match('/^_nkw=(.+)$/i', $p, $matches)) {
|
if (preg_match('/^_nkw=(.+)$/i', $p, $matches)) {
|
||||||
|
@ -98,7 +98,7 @@ class ErowallBridge extends BridgeAbstract
|
|||||||
$ret .= 'dat/';
|
$ret .= 'dat/';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$tag = $this->getInput('tag');
|
$tag = $this->getInput('tag') ?? '';
|
||||||
$ret .= 'teg/' . str_replace(' ', '+', $tag);
|
$ret .= 'teg/' . str_replace(' ', '+', $tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -365,7 +365,11 @@ class NintendoBridge extends XPathAbstract
|
|||||||
public function getURI()
|
public function getURI()
|
||||||
{
|
{
|
||||||
$category = $this->getInput('category');
|
$category = $this->getInput('category');
|
||||||
return 'all' === $category ? self::URI : $this->getSourceUrl();
|
if ('all' === $category) {
|
||||||
|
return self::URI;
|
||||||
|
} else {
|
||||||
|
return $this->getSourceUrl();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function provideFeedTitle(\DOMXPath $xpath)
|
protected function provideFeedTitle(\DOMXPath $xpath)
|
||||||
@ -377,7 +381,7 @@ class NintendoBridge extends XPathAbstract
|
|||||||
|
|
||||||
protected function getSourceUrl()
|
protected function getSourceUrl()
|
||||||
{
|
{
|
||||||
$country = $this->getInput('country');
|
$country = $this->getInput('country') ?? '';
|
||||||
$category = $this->getCurrentCategory();
|
$category = $this->getCurrentCategory();
|
||||||
return str_replace(self::PARAMETERS['']['country']['defaultValue'], $country, self::FEED_SOURCE_URL[$category]);
|
return str_replace(self::PARAMETERS['']['country']['defaultValue'], $country, self::FEED_SOURCE_URL[$category]);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user