Bug #85067
closedUncaught Exception in Linkvalidator at 'Too many redirects' link
100%
Description
An uncaugt exception occurs when Linkvalidator encounters an external link which doesn't redirect properly (the page is stuck in a redirect loop, browser says 'The page isn’t redirecting properly').
Also, if the exception would be solved, this type of link would not be reported as a broken link!
The exception is thrown because $e->getResponse() returns NULL, therefor getStatusCode() can not be called.
I made a workaround by replacing the lines starting at line 88 in ExternalLinktype->checkLink with this:
} catch (TooManyRedirectsException $e) {
$isValidUrl = false;
$lastRequest = $e->getRequest();
$response = $e->getResponse();
$errorParams['errorType'] = 'loop';
$errorParams['location'] = (string)$lastRequest->getUri();
if ($response === null) {
$errorParams['errorCode'] = '301';
} else {
$errorParams['errorCode'] = $response->getStatusCode();
}
Updated by Sybille Peters over 6 years ago
- Priority changed from Should have to Must have
Updated by Sybille Peters over 6 years ago
Should always check for hasResponse() before getReponse(), see also http://docs.guzzlephp.org/en/stable/quickstart.html#exceptions
Updated by Gerrit Code Review over 6 years ago
- Status changed from New to Under Review
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57011
Updated by Gerrit Code Review over 6 years ago
Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57011
Updated by Gerrit Code Review over 6 years ago
Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57011
Updated by Gerrit Code Review over 6 years ago
Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57011
Updated by Gerrit Code Review over 6 years ago
Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57011
Updated by Cristian Buja over 6 years ago
This bug is also present in version 8.7
Updated by Sybille Peters over 6 years ago
- Target version set to next-patchlevel
Updated by Gerrit Code Review over 6 years ago
Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57011
Updated by Gerrit Code Review over 6 years ago
Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57356
Updated by Sybille Peters over 6 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset b2aa201255487525246603edbe6f1b0a21887650.