Skip to content

Commit

Permalink
don't allow SEO plugin to make non-HTTPS requests (matomo-org#13575)
Browse files Browse the repository at this point in the history
  • Loading branch information
Findus23 authored and InfinityVoid committed Oct 11, 2018
1 parent 5837a7e commit 31061b7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
4 changes: 2 additions & 2 deletions plugins/SEO/Metric/Alexa.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion plugins/SEO/Metric/Bing.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions plugins/SEO/Metric/DomainAge.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 '';
Expand Down

0 comments on commit 31061b7

Please sign in to comment.