77777[BUGFIX] Avoid invalid array key accesses in ext:linkvalidator
Commit message
Review
-
Code review CR +2 Done
- Benni Mack +2
- Sybille Peters +1
-
Verified V +2 Done
- Benni Mack +2
- Sybille Peters +1
- core-ci +1 CI
Issues 1
Files 2
Review log 1012
-
Stefan Bürk uploaded patch set 1 02/07/23, 18:33
-
core-ci voted on patch set 1 V +1 02/07/23, 18:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37308
-
Stefan Bürk commented on patch set 1 02/07/23, 18:41
Backport prepared, needs dedicated voting - does a little more than main. -
Oliver Klee voted on patch set 1 CR +1 02/07/23, 18:47
-
Christian Kuhn commented on patch set 1 02/08/23, 10:41
ExternalLinktype.php:264there is no key 'list.report.error.httpstatuscode.0' in locallang. -
Sybille Peters commented on patch set 1 02/25/23, 11:17
ExternalLinktype.php:264ReplyTheoretically if errno is empty or 0 there is no error so if that is the case something else is already wrong here. Might make sense to check that because this should not happen. (Still good idea to check for missing array entries unless sure). On a side not: I already wrote that in another patch (I think): Might improve to use a class instead of the errorParams. It is a bit flaky in some places. For brofix, I separated the error type (string with fixed set of types) and error code (number) and used a class, see https://github.com/sypets/brofix/blob/main/Classes/Linktype/ErrorParams.php The code could still use improvement but it's about the general idea. -
Sybille Peters commented on patch set 1 CR -1 02/25/23, 11:47
See comment. Also, errorParams might benefit from converting to a class and using and initializing the values in a more clean and safe way but I understand this may not be the best time right now.ExternalLinktype.php:189I think this should get fixed here. It should be: $this->errorParams['errorType'] = $response->getStatusCode(); In other places, errno is used. This statement is in the try block. In most (or all cases of error) an exception is thrown but should still make sure to set correctly. Also, the values could be initialized to a sane value at the beginning (then you don't need all the null coalesce later). -
Sybille Peters uploaded patch set 2
CR +1V +102/26/23, 18:57 -
Sybille Peters commented on patch set 2 V +1 CR +1 02/26/23, 19:00
ExternalLinktype.php:189ReplyDoneExternalLinktype.php:264ReplyI change the switch case so that all cases use an explicit language label. I also fixed the language label list.report.error.httpstatuscode.305 (before, 300 was listed twice) and use a generic one in the default. -
core-ci voted on patch set 2 V +1 02/26/23, 19:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38129
-
Benni Mack voted on patch set 2 V +2 CR +2 04/11/23, 11:03
-
Benni Mack merged patch set 3 04/11/23, 11:03