Bug #40486
closed
HTTP Redirecs mark links as defect
Added by Benjamin Albrecht about 12 years ago.
Updated about 6 years ago.
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);
}
- Status changed from New to Needs Feedback
The redirect handling is completely done by HttpRequest (follow_redirects set to TRUE in the config array). HttpRequest relies on PEAR's HTTP_Request2, which is delivered with Typo3. But do you have an older (<0.5.0) PEAR installed locally? Check the phpinfo output.
Oh, sorry!
My reported TYPO3 Version was wrong :-/
The TYPO3 Version of my Testcase is 4.5.19
The posted sourcecode comes from 6.0beta1 an of course the redirect handling of HttpRequest works fine.
It seems, that the "redirect check behavior" was changed with 4.6
One more reason to upgrade my 4.5 installation :-)
- Status changed from Needs Feedback to Under Review
- Assignee set to Daniel Minder
- % Done changed from 0 to 100
- TYPO3 Version changed from 6.0 to 4.5
- Complexity set to no-brainer
The redirect handling is done manually in 4.5.19. But I checked the http://get.adobe.com/de/reader link and figured out that the server responds with a "location:" line - note the lower-case "l". According to RFC 2616 the field names are case insensitive but this was not observed by linkvalidator. With a small patch the link is not marked as defect any more.
BTW: If the server responds with a 301/302/303/307 but the header does not contain a location line linkvalidator keeps querying the server until the retry count is reached. I'm not sure if we should break sooner in this case. However, I guess that this does not happen very often.
- Status changed from Under Review to Resolved
Applied in changeset commit:203bad7b1b9171ff68085906fa79584d15b61fed.
- Category set to Linkvalidator
- Project changed from 1510 to TYPO3 Core
- Category changed from Linkvalidator to Linkvalidator
- Status changed from Resolved to Closed
Also available in: Atom
PDF