Project

General

Profile

Actions

Bug #85067

closed

Uncaught Exception in Linkvalidator at 'Too many redirects' link

Added by Loek Hilgersom almost 6 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Must have
Category:
Linkvalidator
Target version:
Start date:
2018-05-23
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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();
            }
Actions #1

Updated by Sybille Peters almost 6 years ago

  • Assignee set to Sybille Peters
Actions #2

Updated by Sybille Peters almost 6 years ago

  • Priority changed from Should have to Must have
Actions #3

Updated by Sybille Peters almost 6 years ago

Should always check for hasResponse() before getReponse(), see also http://docs.guzzlephp.org/en/stable/quickstart.html#exceptions

Actions #4

Updated by Gerrit Code Review almost 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

Actions #5

Updated by Gerrit Code Review almost 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

Actions #6

Updated by Gerrit Code Review almost 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

Actions #7

Updated by Gerrit Code Review almost 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

Actions #8

Updated by Gerrit Code Review almost 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

Actions #9

Updated by Cristian Buja over 5 years ago

This bug is also present in version 8.7

Actions #10

Updated by Sybille Peters over 5 years ago

  • Parent task set to #85006
Actions #11

Updated by Sybille Peters over 5 years ago

  • Target version set to next-patchlevel
Actions #12

Updated by Gerrit Code Review over 5 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

Actions #13

Updated by Gerrit Code Review over 5 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

Actions #14

Updated by Sybille Peters over 5 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #15

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions #16

Updated by Sybille Peters over 4 years ago

  • Parent task deleted (#85006)
Actions

Also available in: Atom PDF