From 31061b7c86223a420c3054a4dcac3efae44a6b7a Mon Sep 17 00:00:00 2001 From: Lukas Winkler Date: Wed, 10 Oct 2018 21:12:07 +0200 Subject: [PATCH] don't allow SEO plugin to make non-HTTPS requests (#13575) --- plugins/SEO/Metric/Alexa.php | 4 ++-- plugins/SEO/Metric/Bing.php | 2 +- plugins/SEO/Metric/DomainAge.php | 6 ------ 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/plugins/SEO/Metric/Alexa.php b/plugins/SEO/Metric/Alexa.php index 71921138863..bf0b9996594 100644 --- a/plugins/SEO/Metric/Alexa.php +++ b/plugins/SEO/Metric/Alexa.php @@ -17,8 +17,8 @@ */ class Alexa implements MetricsProvider { - const URL = 'http://data.alexa.com/data?cli=10&url='; - const LINK = 'http://www.alexa.com/siteinfo/'; + const URL = 'https://data.alexa.com/data?cli=10&url='; + const LINK = 'https://www.alexa.com/siteinfo/'; /** * @var LoggerInterface diff --git a/plugins/SEO/Metric/Bing.php b/plugins/SEO/Metric/Bing.php index 0c2892fb93c..e5ced1ad307 100644 --- a/plugins/SEO/Metric/Bing.php +++ b/plugins/SEO/Metric/Bing.php @@ -17,7 +17,7 @@ */ class Bing implements MetricsProvider { - const URL = 'http://www.bing.com/search?setlang=en-US&rdr=1&q=site%3A'; + const URL = 'https://www.bing.com/search?setlang=en-US&rdr=1&q=site%3A'; /** * @var LoggerInterface diff --git a/plugins/SEO/Metric/DomainAge.php b/plugins/SEO/Metric/DomainAge.php index c11a222011e..855e0ada677 100644 --- a/plugins/SEO/Metric/DomainAge.php +++ b/plugins/SEO/Metric/DomainAge.php @@ -130,12 +130,6 @@ private function getUrl($url) { try { return $this->getHttpResponse($url); - } catch (\Exception $e) { - } - - $httpUrl = str_replace('https://', 'http://', $url); - try { - return $this->getHttpResponse($httpUrl); } catch (\Exception $e) { $this->logger->warning('Error while getting SEO stats (domain age): {message}', array('message' => $e->getMessage())); return '';