Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/trusted host pattern failing #899

Merged
merged 3 commits into from
Feb 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
### Changed

### Fixed
* Crawler could not index frontend because of trustedHostPattern mismatch
* Fatal PHP error is thrown in the backend crawler log

### Deprecated
#### Classes
Expand Down
2 changes: 1 addition & 1 deletion Classes/Backend/RequestForm/LogRequestForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ private function drawLog_addRows(array $logEntriesOfPage, string $titleString):
$rowData['exec_time'] = $execTime;
}
$rowData['result_status'] = GeneralUtility::fixed_lgd_cs($resStatus, 50);
$url = htmlspecialchars($parameters['url'] ?? $parameters['alturl'], ENT_QUOTES | ENT_HTML5);
$url = htmlspecialchars((string) ($parameters['url'] ?? $parameters['alturl']), ENT_QUOTES | ENT_HTML5);
$rowData['url'] = '<a href="' . $url . '" target="_newWIndow">' . $url . '</a>';
$rowData['feUserGroupList'] = $parameters['feUserGroupList'] ?? '';
$rowData['procInstructions'] = is_array($parameters['procInstructions']) ? implode('; ', $parameters['procInstructions']) : '';
Expand Down
12 changes: 7 additions & 5 deletions cli/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,20 @@
$_SERVER['QUERY_STRING'] = (isset($urlParts['query']) ? $urlParts['query'] : '');
$_SERVER['REQUEST_URI'] = $urlParts['path'] . (isset($urlParts['query']) ? '?' . $urlParts['query'] : '');
$_SERVER['REQUEST_METHOD'] = 'GET';
$_SERVER['SERVER_PORT'] = '80';

// Define HTTPS disposal:
if ($urlParts['scheme'] === 'https') {
$_SERVER['HTTPS'] = 'on';
$_SERVER['SERVER_PORT'] = '443';
}

// Define a port if used in the URL:
if (isset($urlParts['port'])) {
$_SERVER['HTTP_HOST'] .= ':' . $urlParts['port'];
$_SERVER['SERVER_PORT'] = (string)$urlParts['port'];
}

// Define HTTPS disposal:
if ($urlParts['scheme'] === 'https') {
$_SERVER['HTTPS'] = 'on';
}

chdir($typo3Root);
include($typo3Root . '/index.php');

Expand Down