diff options
author | Tim-Hinnerk Heuer <tim@innocraft.com> | 2021-09-28 11:12:50 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-28 11:12:50 +0300 |
commit | 1bc9fdf55352b61c278d298e9935451394230355 (patch) | |
tree | bc2e264fb1bbdf93d6fb9d5c5dd650524afc6b8c /plugins/SEO | |
parent | 6130619db38b901dfb35f6aeeceedbe6b4e1e0c0 (diff) |
A few more PHP8.1 fixes (#17989)
* add return type declartions #17686
should not break anything and gets rid of a warning
* add return type to method signature #17686
* annotate return types to avoid warnings
* add more return types
* upgrade phpmailer/phpmailer to 6.5.1
* add return types, avoid deprecated null to string conversion
* fix some deprecation warnings for php 8.1 #17686
* fix in DbHelper::getInstallVersion() instead #17686
* ensure empty(DbHelper::getInstallVersion()) succeed #17686
* force return "0" string and adjust test
Co-authored-by: Justin Velluppillai <justin@innocraft.com>
Diffstat (limited to 'plugins/SEO')
-rw-r--r-- | plugins/SEO/Metric/Alexa.php | 4 | ||||
-rw-r--r-- | plugins/SEO/Metric/Bing.php | 2 | ||||
-rw-r--r-- | plugins/SEO/Metric/DomainAge.php | 2 | ||||
-rw-r--r-- | plugins/SEO/Metric/Google.php | 2 | ||||
-rw-r--r-- | plugins/SEO/Metric/ProviderCache.php | 2 |
5 files changed, 6 insertions, 6 deletions
diff --git a/plugins/SEO/Metric/Alexa.php b/plugins/SEO/Metric/Alexa.php index b0d3a42c6b..a9a58160e0 100644 --- a/plugins/SEO/Metric/Alexa.php +++ b/plugins/SEO/Metric/Alexa.php @@ -35,7 +35,7 @@ class Alexa implements MetricsProvider { $value = null; try { - $response = Http::sendHttpRequest(self::URL . urlencode($domain), $timeout = 10, @$_SERVER['HTTP_USER_AGENT']); + $response = Http::sendHttpRequest(self::URL . urlencode($domain ?? ''), $timeout = 10, @$_SERVER['HTTP_USER_AGENT']); libxml_use_internal_errors(true); // suppress errors $dom = new \DomDocument(); $dom->loadHTML($response); @@ -54,7 +54,7 @@ class Alexa implements MetricsProvider } $logo = "plugins/Morpheus/icons/dist/SEO/alexa.com.png"; - $link = self::LINK . urlencode($domain); + $link = self::LINK . urlencode($domain ?? ''); return array( new Metric('alexa', 'SEO_AlexaRank', $value, $logo, $link) diff --git a/plugins/SEO/Metric/Bing.php b/plugins/SEO/Metric/Bing.php index ab7b1bce88..1279b77894 100644 --- a/plugins/SEO/Metric/Bing.php +++ b/plugins/SEO/Metric/Bing.php @@ -32,7 +32,7 @@ class Bing implements MetricsProvider public function getMetrics($domain) { - $url = self::URL . urlencode($domain); + $url = self::URL . urlencode($domain ?? ''); try { $response = str_replace(' ', ' ', Http::sendHttpRequest($url, $timeout = 10, @$_SERVER['HTTP_USER_AGENT'])); diff --git a/plugins/SEO/Metric/DomainAge.php b/plugins/SEO/Metric/DomainAge.php index 8d5d4bc4b8..0753e8eb89 100644 --- a/plugins/SEO/Metric/DomainAge.php +++ b/plugins/SEO/Metric/DomainAge.php @@ -35,7 +35,7 @@ class DomainAge implements MetricsProvider public function getMetrics($domain) { - $domain = str_replace('www.', '', $domain); + $domain = str_replace('www.', '', $domain ?? ''); $ages = array(); diff --git a/plugins/SEO/Metric/Google.php b/plugins/SEO/Metric/Google.php index 2edf5afc23..14f6e3d9f2 100644 --- a/plugins/SEO/Metric/Google.php +++ b/plugins/SEO/Metric/Google.php @@ -46,7 +46,7 @@ class Google implements MetricsProvider public function fetchIndexedPagesCount($domain) { - $url = self::SEARCH_URL . urlencode($domain); + $url = self::SEARCH_URL . urlencode($domain ?? ''); try { $response = str_replace(' ', ' ', Http::sendHttpRequest($url, $timeout = 10, @$_SERVER['HTTP_USER_AGENT'])); diff --git a/plugins/SEO/Metric/ProviderCache.php b/plugins/SEO/Metric/ProviderCache.php index 98b4c08fa0..898a19a6fd 100644 --- a/plugins/SEO/Metric/ProviderCache.php +++ b/plugins/SEO/Metric/ProviderCache.php @@ -34,7 +34,7 @@ class ProviderCache implements MetricsProvider public function getMetrics($domain) { - $cacheId = 'SEO_getRank_' . md5($domain); + $cacheId = 'SEO_getRank_' . md5($domain ?? ''); $metrics = $this->cache->fetch($cacheId); |