Support

Admin Tools

#36354 htmlspecialchars(): Argument #1 ($string) must be of type string, array

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by gahanzwart on Tuesday, 04 January 2022 09:18 CST

gahanzwart

Hi,

Would like to pick up where some one else left off this error message in call 35867, that was abandoned by the OP. I got exactly the same problem. Opening options in PHP scanner in Admintools gives:

 

htmlspecialchars(): Argument #1 ($string) must be of type string, array given   After reading your request how to give more info, I got this (enabling error reporting and setting it on development), see attachment.

  Cheers,   Gahan Zwart

nicholas
Akeeba Staff
Manager

This error message comes from Joomla's hidden field and only happens on PHP 8 where strict type matching is enforced. It complains that one of the configuration values contains a PHP array instead of a string.

The thing is, we are only using 5 hidden fields, four of which store a value of 0 or 1. The only one that's supposed to store a comma-separated list (NOT an array) is the list of Super User groups. There was a bug which would save an array instead of a comma separated list but it was fixed on June 5th, 2020.

Is this an old installation of Admin Tools? If so, I have an idea on how to fix this. I just need this bit of information to make sure I don't start heading the wrong direction.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

nicholas
Akeeba Staff
Manager

I had a hunch and a did some digging. I can now tell you exactly what happened.

Having had at some point Admin Tools 5.1.0 to 5.7.2 inclusive would cause the wrong data type to be stored in the component's Options associated with the “User groups to check for well-known passwords” feature. This was fixed in 5.7.3 and the data was moved to the same storage as the Configure WAF data. However, the old data in the component options was never updated. This didn't cause any problems since this data was not used. That is, until PHP 8 started complaining about the wrong data type being stored in the component's Options.

I will be making a new release today which addresses this issue by removing the no longer used data from the component Options storage and also remove the hidden field which was causing the error in the first place.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

gahanzwart

Hi Nicholas,

This is an 'old' site from way back in 2009 which had at some point some older versions of AdminTools installed. So your hunch is right. If you want me to test some things with a release beforehand, let me know. I'm on a holiday, but happy to oblige.

Cheers,

Gahan Zwart

nicholas
Akeeba Staff
Manager

No, it's OK. I managed to reproduce the issue using old versions of Joomla and Admin Tools and I fixed it in today's release :)

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

gahanzwart

Thanks for the new release, I've installed it on that site, and options works now. 6.1.4 resolves this issue. Thanks again.

 

Cheers,

Gahan

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!