Skip to content

Commit

Permalink
Merge pull request #14 from dennisinteractive/DD-1423
Browse files Browse the repository at this point in the history
Dd 1423
  • Loading branch information
guardiola86 authored Jun 26, 2019
2 parents b0b992c + ba35dd2 commit e2db472
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Dennis/Link/Checker/Analyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ public function getInfo($url) {
* @throws ResourceFailException
*/
protected function doInfoRequest($url) {
// If url is protocol neutral, force it to use https.
if (substr( $url, 0, 2 ) === "//") {
$url = ltrim($url, '//');
$url = 'https://' . $url;
}
// Only redirect 301's so cannot use CURLOPT_FOLLOWLOCATION
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
Expand Down
3 changes: 3 additions & 0 deletions src/Dennis/Link/Checker/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ public function critical($message, array $context = array()) {
*/
public function error($message, array $context = array()) {
$this->addRecord(self::ERROR, (string) $message, $context);
watchdog('dennis_link_checker_seo', $message);
}

/**
Expand All @@ -161,13 +162,15 @@ public function warning($message, array $context = array()) {
*/
public function notice($message, array $context = array()) {
$this->addRecord(self::NOTICE, (string) $message, $context);
watchdog('dennis_link_checker_seo', $message);
}

/**
* @inheritDoc
*/
public function info($message, array $context = array()) {
$this->addRecord(self::INFO, (string) $message, $context);
watchdog('dennis_link_checker_seo', $message);
}

/**
Expand Down

0 comments on commit e2db472

Please sign in to comment.