Commit b3b4fd86 authored by Sybille Peters's avatar Sybille Peters 🙋 Committed by Christian Kuhn
Browse files

[BUGFIX] Better handling of "too many redirects" in linkvalidator

Previously, if there were too many redirects, an error message
"A redirect loop occurred" was displayed. This was misleading.

A redirect loop is different from "too many redirects". "Too
many redirects simply means that the maximum number of redirects
used by the underlying HTTP request library (Guzzle) is reached
before reaching the destination. This happens by default after
5 redirects.

Therefore, the "too many redirects" error is now being displayed
with its own message.

Resolves: #92741
Releases: master
Change-Id: I69e191e1f2c771eb83b8c82b2be12dd58730d8e3
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/66363


Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: default avatarGuido Schmechel <guido.schmechel@brandung.de>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 7e057100
......@@ -181,7 +181,7 @@ class ExternalLinktype extends AbstractLinktype
} catch (TooManyRedirectsException $e) {
// redirect loop or too many redirects
// todo: change errorType to 'redirect' (breaking change)
$this->errorParams['errorType'] = 'loop';
$this->errorParams['errorType'] = 'tooManyRedirects';
$this->errorParams['exception'] = $e->getMessage();
$this->errorParams['message'] = $this->getErrorMessage($this->errorParams);
} catch (ClientException $e) {
......@@ -235,6 +235,9 @@ class ExternalLinktype extends AbstractLinktype
''
);
break;
case 'tooManyRedirects':
$message = $lang->getLL('list.report.tooManyRedirects');
break;
case 'exception':
$message = sprintf($lang->getLL('list.report.httpexception'), $errorParams['exception']);
break;
......
......@@ -153,6 +153,9 @@
<trans-unit id="list.report.redirectloop" resname="list.report.redirectloop">
<source>A redirect loop occurred. (%s: %s)</source>
</trans-unit>
<trans-unit id="list.report.tooManyRedirects" resname="list.report.tooManyRedirects">
<source>Too many redirects.</source>
</trans-unit>
<trans-unit id="list.report.pageforbidden403" resname="list.report.pageforbidden403">
<source>Accessing this address is not allowed (403).</source>
</trans-unit>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment