?
avatar alex-fiftynine
alex-fiftynine
28 May 2018

Steps to reproduce the issue

Install Joomla! 3.8.8 with some sample data
Enable plugin "System - Language Filter"
Set error reporting to maximum

Expected result

No undefined index notice when we have bad or malformed user agent.

Actual result

undefined index notice

System information (as much as possible)

Web Server Apache
PHP Version 7.0.27-0+deb9u1
Database Version 5.5.5-10.1.26-MariaDB-0+deb9u1

Additional comments

When I request home page with the following user agent "Mozilla/5.0 (Windows NT 5.1; U; de) Opera 8.50"
I get the error (in php errors log file)
PHP Notice: Undefined offset: 1 in /home/joomla_root/libraries/vendor/joomla/application/src/Web/WebClient.php on line 424
The same notice can happen with other (fake or old) user agents, see the code above in mentioned source file.

command to check
wget -U "Mozilla/5.0 (Windows NT 5.1; U; de) Opera 8.50" http://my.site/

avatar alex-fiftynine alex-fiftynine - open - 28 May 2018
avatar joomla-cms-bot joomla-cms-bot - labeled - 28 May 2018
avatar mbabker
mbabker - comment - 28 May 2018

Confirmed. Looking at http://www.useragentstring.com/pages/useragentstring.php?all=TRUE&name=Opera&vers=8.50 our library only supports parsing the Opera/8.50 prefixed UA strings, we don't support the UA strings with the Mozilla/ prefix.

avatar franz-wohlkoenig franz-wohlkoenig - change - 28 May 2018
Status New Confirmed
avatar mbabker
mbabker - comment - 28 May 2018

I've got this fixed upstream and incorporated into #20583

avatar mbabker mbabker - change - 28 May 2018
Status Confirmed Closed
Closed_Date 0000-00-00 00:00:00 2018-05-28 15:37:44
Closed_By mbabker
avatar mbabker mbabker - close - 28 May 2018

Add a Comment

Login with GitHub to post a comment