No Code Attached Yet
avatar o-joomla-issues
o-joomla-issues
2 May 2024

Steps to reproduce the issue

Do a raw http request on an URL that gets redirected, like / on a multi-language site:
$ openssl s_client -connect some-website.com:443
GET / HTTP/1.1[enter]
Host: some-website.com[enter]
[enter]

Expected result

No error

Actual result

PHP Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /htdocs/libraries/vendor/joomla/application/src/Web/WebClient.php on line 380 (and other lines)

System information

php8.3-fpm 8.3.6-1+020240424.32+debian121.gbp9a7ce5

Additional comments

I don't know which client actually does http request without user agent, but I see these errors in the logs quite often.
Anyway, we should always validate user-supplied variables.

An easy fix should be:
htdocs/libraries/vendor/joomla/application/src/Web/WebClient.php
[...]
public const NONE = 0; // maybe UNKOWN instead?
[...]
protected function detectEngine($userAgent)
{
if(empty(trim($userAgent))) {
$this->engine = self::NONE;
} elseif [...]
}

avatar o-joomla-issues o-joomla-issues - open - 2 May 2024
avatar o-joomla-issues o-joomla-issues - change - 2 May 2024
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 2 May 2024
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 2 May 2024
avatar brianteeman
brianteeman - comment - 2 May 2024

As your fix is in libraries/vendor/joomla/application then it should be reported/fixed there and not in the cms
https://github.com/joomla-framework/application

Can be closed as not a bug in the cms but in the upstream library

avatar alikon
alikon - comment - 2 May 2024
avatar alikon alikon - change - 2 May 2024
Status New Closed
Closed_Date 0000-00-00 00:00:00 2024-05-02 10:41:30
Closed_By alikon
avatar alikon alikon - close - 2 May 2024
avatar o-joomla-issues
o-joomla-issues - comment - 2 May 2024

Sorry, I was mislead by the "Library" option in the categories selection. I didn't appear to me that "Joomla! Issue Tracker - CMS" excludes the Joomla library (although I am certainly aware of the difference between the CMS and the framework).

Add a Comment

Login with GitHub to post a comment