Project

General

Profile

Actions

Bug #40486

closed

HTTP Redirecs mark links as defect

Added by Benjamin Albrecht over 11 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Linkvalidator
Target version:
-
Start date:
2012-08-31
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
5.3
Tags:
Complexity:
no-brainer
Is Regression:
Sprint Focus:

Description

The following code (ExternalLinktype.php) marks all redirected links as defect or "not valid".

IMO only HTTP status 400 and above should mark links as defect.
Many websites response with a HTTP redirect at the startpage (http://www.example.org > http://www.example.org/de-DE/)
I think, this is ok and shouldn't mark the link as corrupt.

A backwards compatible solution could be to implement a TypoScript configure option...

if (isset($response) && $response->getStatus() >= 300) {
    $isValidUrl = FALSE;
    $errorParams['errorType'] = $response->getStatus();
    $errorParams['message'] = $response->getReasonPhrase();
}
if (!$isValidUrl) {
    $this->setErrorParams($errorParams);
}
Actions

Also available in: Atom PDF