Bug #99863
closedPHP 8.1 issues with linkvalidator
100%
Description
We have two issues within the likvalidator when checking https://www.emas.de
`GET https://www.emas.de` resulted in a `403 Forbidden` response:
1. issue
PHP Warning: Undefined array key "exception" in
typo3_src-11.5.21/typo3/sysext/linkvalidator/Classes/Linktype/ExternalLinktype.php
line 316
public function getErrorMessage($errorParams)
default: $message = sprintf($lang->getLL('list.report.otherhttpcode'), $errorType, $errorParams['exception']);
could / should bei changed into:
$errorHint = ''; if(isset($errorParams['message'])){ $errorHint = $errorParams['message']; } $message = sprintf($lang->getLL('list.report.otherhttpcode'), $errorType, $errorHint);
2. issue
PHP Warning: Trying to access array offset on value of type bool in
typo3_src-11.5.21/typo3/sysext/linkvalidator/Classes/Report/LinkValidatorReport.php line 578
protected function renderTableRow($table, array $row)
$response = $row['url_response']; if ($response['valid']) { $linkMessage = '<span class="text-success">' . htmlspecialchars($languageService->getLL('list.msg.ok')) . '</span>'; } else { $linkMessage = '<span class="text-danger">' . nl2br( // Encode for output htmlspecialchars( $hookObj->getErrorMessage($response['errorParams']), ENT_QUOTES, 'UTF-8', false ) ) . '</span>'; }
if ($response && $response['valid']) { $linkMessage = '<span class="text-success">' . htmlspecialchars($languageService->getLL('list.msg.ok')) . '</span>'; } elseif($response && isset($response['errorParams'])) { $linkMessage = '<span class="text-danger">' . nl2br( // Encode for output htmlspecialchars( $hookObj->getErrorMessage($response['errorParams']), ENT_QUOTES, 'UTF-8', false ) ) . '</span>'; }else{ $linkMessage = '<span class="text-danger">Invalid response</span>'; }
Updated by Gerrit Code Review almost 2 years ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/77777
Updated by Gerrit Code Review almost 2 years ago
Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/77778
Updated by Gerrit Code Review over 1 year ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/77777
Updated by Stefan Bürk over 1 year ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset fa7d6a7357745300d7f08b20218ab3468850160b.