Project

General

Profile

Actions

Bug #102409

closed

Console Commands - rtrim() expects parameter 1 to be string, boolean given

Added by Fabian Martin about 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
CLI
Target version:
-
Start date:
2023-11-17
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.4
Tags:
Complexity:
no-brainer
Is Regression:
Sprint Focus:

Description

Since the last security patch, when starting a console command from the cli, which in some way uses the new getNormalizedParams() method in AbstractUserAuthentication we get the following error:

Uncaught TYPO3 Exception rtrim() expects parameter 1 to be string, boolean given
thrown in file typo3/sysext/core/Classes/Http/NormalizedParams.php
in line 790

The problem seems to be either, that in "determineSiteUrl()" the $requestDir param ist filled with "http://localhost/" because of the line:
"$serverParams = Environment::isCli() ? ['HTTP_HOST' => 'localhost'] : $_SERVER;"
or that "TYPO3_PATH_WEB" is not defined, when it should be.

If we add another condition in determineSiteUrl(), something like:

if ($siteUrl === false && Environment::isCli() && strpos($requestDir, 'localhost') !== false) {
$siteUrl = $requestDir;
}

the bug seems to be fixed.

This bug seems to be present in v9/10 haven't checked for v8, v11 or v12.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #94624: Cast $siteUrl to stringClosed2021-07-23

Actions
Actions #1

Updated by Benjamin Franzke about 1 year ago

  • PHP Version set to 7.4

Thank you for the report. Will be fixed in ELTS releases.
Applies to PHP <= 7.x only, as substr() returned false instead of an empty string in <= PHP 7.x

Actions #2

Updated by Benjamin Franzke about 1 year ago

  • Status changed from New to Closed
Actions #3

Updated by Benjamin Franzke about 1 year ago

  • Related to Bug #94624: Cast $siteUrl to string added
Actions

Also available in: Atom PDF