添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Advertisement

PHP 8 error: htmlspecialchars(): Argument #1 ($string) must be of type string, array given

General questions relating to Joomla! 3.x.
Moderator: General Support Moderators Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10 I'm using Joomla 3.10.10.
I changed the PHP version from 7.4 to 8.0. Now I just noticed that System -> System Information thwows an Error:
Error: htmlspecialchars(): Argument #1 ($string) must be of type string, array given
The problem is reproducible (at least on my test site), if I change back to PHP 7.4 it works correctly.
Any help/idea?
Thank you very much!
Alexander Last edited by imanickam on Wed Jul 20, 2022 1:19 pm, edited 1 time in total.
Reason: Improved the Subject by providing the actual error message
Best suggestion is to enable Joomla debug mode with error reporting level = maximum.
Look at your error log.
Another good suggestion is to use the Forum Post Assistant tool; details appear in the pink area above your first post.
My guess is the error is generated by third-party extension that you've installed that's not PHP 8-compliant: uninstall the faulty extension or revert to PHP 7.4 and live with it. 8)
Hi sozzled
Thank you for the ideas. I Installed the FPA (FPA info at the end of message) and activated max error reporting. The problem seems to be in:
/home/haistift/www/haistiftung.ch/htdocs/administrator/components/com_admin/views/sysinfo/tmpl/default_config.php:37
Forum Post Assistant (v1.6.5) : 20-Jul-2022 wrote:
Basic Environment :: wrote: Joomla! Instance :: Joomla! 3.10.10 -Stable (Daraja) 18-June-2022
Joomla! Platform :: Joomla Platform 13.1.0 -Stable (Curiosity) 24-Apr-2013
Joomla! Configured :: Yes | Read-Only ( 444 ) |
Configuration Options :: Offline: | SEF: | SEF Suffix: | SEF ReWrite: | .htaccess/web.config: Yes | GZip: | Cache: | CacheTime: | CacheHandler: | CachePlatformPrefix: | FTP Layer: | Proxy: | LiveSite: | Session lifetime: | Session handler: | Shared sessions: | SSL: | Error Reporting: | Site Debug: | Language Debug: | Default Access: | Unicode Slugs: | dbConnection Type: | PHP Supports J! 3.10.10: Yes | Database Supports J! 3.10.10: Unknown | Database Credentials Present: No |
Host Configuration :: OS: FreeBSD | OS Version: 12.3-RELEASE-p1 | Technology: amd64 | Web Server: Apache | Encoding: gzip, deflate, br | System TMP Writable: Yes | Free Disk Space : 7033.20 GiB |
PHP Configuration :: Version: 8.0.20 | PHP API: cgi-fcgi | Session Path Writable: Yes | Display Errors: 0 | Error Reporting: 22519 | Log Errors To: | Last Known Error: | Register Globals: | Magic Quotes: | Safe Mode: | Allow url fopen: 1 | Open Base: | Uploads: 1 | Max. Upload Size: 64M | Max. POST Size: 64M | Max. Input Time: 60 | Max. Execution Time: 30 | Memory Limit: 256M
Database Configuration :: Database Credentials incomplete or not available Nothing to display.
Missing credentials detected: Connection Type missing | Database Name missing | MySQL Host missing | Table Prefix missing | Database Username missing | Database Password missing | User Privileges : Unknown
Detailed Environment :: wrote: PHP Extensions :: Core (8.0.20) | date (8.0.20) | libxml (8.0.20) | openssl (8.0.20) | pcre (8.0.20) | hash (8.0.20) | json (8.0.20) | Reflection (8.0.20) | SPL (8.0.20) | session (8.0.20) | standard (8.0.20) | cgi-fcgi (8.0.20) | mysqlnd (mysqlnd 8.0.20) | apcu (5.1.21) | bcmath (8.0.20) | bz2 (8.0.20) | calendar (8.0.20) | ctype (8.0.20) | curl (8.0.20) | dba (8.0.20) | dom (20031129) | mbstring (8.0.20) | fileinfo (8.0.20) | filter (8.0.20) | ftp (8.0.20) | gd (8.0.20) | gettext (8.0.20) | gmp (8.0.20) | gnupg (1.5.0) | iconv (8.0.20) | imagick (3.5.1) | intl (8.0.20) | ldap (8.0.20) | exif (8.0.20) | mcrypt (1.0.4) | mysqli (8.0.20) | odbc (8.0.20) | pcntl (8.0.20) | PDO (8.0.20) | pgsql (8.0.20) | zlib (8.0.20) | posix (8.0.20) | pspell (8.0.20) | readline (8.0.20) | SimpleXML (8.0.20) | snmp (8.0.20) | soap (8.0.20) | sockets (8.0.20) | sodium (8.0.20) | sqlite3 (8.0.20) | ssh2 (1.3.1) | sysvmsg (8.0.20) | sysvsem (8.0.20) | sysvshm (8.0.20) | tidy (8.0.20) | tokenizer (8.0.20) | xml (8.0.20) | xmlwriter (8.0.20) | yaml (2.2.2) | zip (1.19.5) | Phar (8.0.20) | imap (8.0.20) | mailparse (3.1.2) | mongodb (1.12.0) | pdo_dblib (8.0.20) | pdo_mysql (8.0.20) | pdo_pgsql (8.0.20) | pdo_sqlite (8.0.20) | xmlreader (8.0.20) | xmlrpc (1.0.0RC2) | xsl (8.0.20) | Zend OPcache (8.0.20) | Zend Engine (4.0.20) |
Potential Missing Extensions ::
Switch User Environment :: PHP CGI: Yes | Server SU: Yes | PHP SU: Yes | Potential Ownership Issues: No
Folder Permissions :: wrote: Core Folders :: images/ (755) | components/ (755) | modules/ (755) | plugins/ (755) | language/ (755) | templates/ (755) | cache/ (755) | logs/ (755) | tmp/ ( 775 ) | administrator/components/ (755) | administrator/modules/ (755) | administrator/language/ (755) | administrator/templates/ (755) | administrator/logs/ (755) |
Elevated Permissions (First 10) :: cache/com_jchoptimize/jchoptimizecache-04/ ( 775 ) | cache/com_jchoptimize/jchoptimizecache-04/jchoptimizecache-4b/ ( 775 ) | cache/com_jchoptimize/jchoptimizecache-04/jchoptimizecache-87/ ( 775 ) | cache/com_jchoptimize/jchoptimizecache-05/ ( 775 ) | cache/com_jchoptimize/jchoptimizecache-05/jchoptimizecache-0c/ ( 775 ) | cache/com_jchoptimize/jchoptimizecache-7c/ ( 775 ) | cache/com_jchoptimize/jchoptimizecache-c5/ ( 775 ) | cache/com_jchoptimize/jchoptimizecache-c5/jchoptimizecache-ff/ ( 775 ) | components/com_jdonation/tcpdf/cache/ ( 777 ) | tmp/ ( 775 ) |
Extensions Discovered :: wrote: Components :: Site ::
Core :: com_wrapper (3.0.0) ? | com_mailto (3.0.0) ? |
3rd Party:: os_authnet (4.2) ? | os_moneybooker (4.2) ? | os_offline (4.2) ? | os_paypal (4.2) ? | os_worldpay (4.2) ? | os_stripe (4.0) ? | WF_REFERENCE_TITLE (2.9.11) ? | WF_ATTRIBUTES_TITLE (2.9.11) ? | JCE - Noneditable (1.0.0) ? | WF_XHTMLXTRAS_TITLE (2.9.28) ? | WF_WORDCOUNT_TITLE (2.9.28) ? | WF_VISUALCHARS_TITLE (2.9.28) ? | WF_VISUALBLOCKS_TITLE (2.9.28) ? | WF_TEXTCASE_TITLE (2.9.28) ? | WF_TABLE_TITLE (2.9.28) ? | WF_STYLESELECT_TITLE (2.9.28) ? | WF_STYLE_TITLE (2.9.28) ? | WF_SPELLCHECKER_TITLE (2.9.28) ? | WF_SOURCE_TITLE (2.9.28) ? | WF_SEARCHREPLACE_TITLE (2.9.28) ? | WF_PRINT_TITLE (2.9.28) ? | WF_PREVIEW_TITLE (2.9.28) ? | WF_NONBREAKING_TITLE (2.9.28) ? | WF_MEDIA_TITLE (2.9.28) ? | WF_LISTS_TITLE (2.9.28) ? | WF_LINK_TITLE (2.9.28) ? | WF_LAYER_TITLE (2.8.3) ? | WF_KITCHENSINK_TITLE (2.9.28) ? | WF_HELP_TITLE (2.9.28) ? | WF_IMGMANAGER_TITLE (2.9.28) ? | WF_HR_TITLE (2.9.28) ? | WF_FULLSCREEN_TITLE (2.9.28) ? | WF_FORMATSELECT_TITLE (2.9.28) ? | WF_FONTSIZESELECT_TITLE (2.9.28) ? | WF_FONTSELECT_TITLE (2.9.28) ? | WF_FONTCOLOR_TITLE (2.9.28) ? | WF_EMOTIONS_TITLE (2.9.28) ? | WF_DIRECTIONALITY_TITLE (2.9.28) ? | WF_CONTEXTMENU_TITLE (2.9.28) ? | WF_CLIPBOARD_TITLE (2.9.28) ? | WF_CLEANUP_TITLE (2.9.28) ? | WF_CHARMAP_TITLE (2.9.28) ? | WF_BROWSER_TITLE (2.9.28) ? | WF_AUTOSAVE_TITLE (2.9.28) ? | WF_ARTICLE_TITLE (2.9.28) ? | WF_ANCHOR_TITLE (2.9.28) ? | WF_LINK_SEARCH_TITLE (2.9.28) ? | WF_POPUPS_JCEMEDIABOX_TITLE (2.9.28) ? | WF_LINKS_JOOMLALINKS_TITLE (2.9.28) ? | WF_FILESYSTEM_JOOMLA_TITLE (2.9.28) ? | WF_AGGREGATOR_DAILYMOTION_TITLE (2.9.28) ? | WF_AGGREGATOR_VIMEO_TITLE (2.9.28) ? | WF_AGGREGATOR_AUDIO_TITLE (2.9.28) ? | WF_AGGREGATOR_[youtube]_TITLE (2.9.28) ? | WF_AGGREGATOR_VIDEO_TITLE (2.9.28) ? |
Components :: Admin ::
Core :: com_users (3.0.0) ? | com_templates (3.0.0) ? | com_tags (3.1.0) ? | com_search (3.0.0) ? | com_redirect (3.0.0) ? | com_privacy (3.9.0) ? | com_postinstall (3.2.0) ? | com_plugins (3.0.0) ? | com_newsfeeds (3.0.0) ? | com_modules (3.0.0) ? | com_messages (3.0.0) ? | com_menus (3.0.0) ? | com_media (3.0.0) ? | com_login (3.0.0) ? | com_languages (3.0.0) ? | com_joomlaupdate (3.10.1) ? | com_installer (3.0.0) ? | com_finder (3.0.0) ? | com_fields (3.7.0) ? | com_cpanel (3.0.0) ? | com_contenthistory (3.2.0) ? | com_content (3.0.0) ? | com_config (3.0.0) ? | com_checkin (3.0.0) ? | com_categories (3.0.0) ? | com_cache (3.0.0) ? | com_banners (3.0.0) ? | com_associations (3.7.0) ? | com_ajax (3.2.0) ? | com_admin (3.0.0) ? | com_actionlogs (3.9.0) ? |
3rd Party:: COM_JCHOPTIMIZE_PRO (7.2.4) ? | MightySites (4.4.0) ? | com_profiles (1.5.0) ? | com_phocapdf (3.0.12) ? | Helvetica (-) ? | Free Mono (-) ? | com_phocainstall (3.1.0) ? | com_phocacart (3.5.6) ? | Akeeba (8.1.8) ? | Smart Slider 3 (3.5.1.7) ? | JDonation (5.9.7) ? | com_aimysitemap (31.0) ? | COM_JCE (2.9.28) ? | RokSprocket (2.1.28) ? | com_gantry5 (5.5.14) ? |
Modules :: Site ::
Core :: mod_wrapper (3.0.0) ? | mod_whosonline (3.0.0) ? | mod_users_latest (3.0.0) ? | mod_tags_similar (3.1.0) ? | mod_tags_popular (3.1.0) ? | mod_syndicate (3.0.0) ? | mod_stats (3.0.0) ? | mod_search (3.0.0) ? | mod_related_items (3.0.0) ? | mod_random_image (3.0.0) ? | mod_menu (3.0.0) ? | mod_login (3.0.0) ? | mod_languages (3.5.0) ? | mod_footer (3.0.0) ? | mod_finder (3.0.0) ? | mod_feed (3.0.0) ? | mod_custom (3.0.0) ? | mod_breadcrumbs (3.0.0) ? | mod_banners (3.0.0) ? | mod_articles_popular (3.0.0) ? | mod_articles_news (3.0.0) ? | mod_articles_latest (3.0.0) ? | mod_articles_category (3.0.0) ? | mod_articles_categories (3.0.0) ? | mod_articles_archive (3.0.0) ? |
3rd Party:: JD Search (5.9.1) ? | Donation module (5.9.6) ? | Donation Thermometer (5.9.1) ? | Jdonation Donors (5.9.1) ? | Donation Form Module (4.2) ? | Donation Campaigns (5.9.1) ? | DB Systematics Orders Page (0.0.1) ? | DB Systematics Families Page (0.0.1) ? | DB Publications (0.0.1) ? | DB Systematics Page (0.0.1) ? | DB Identification Page (0.0.1) ? | DB Species Page (0.0.1) ? | DB Names Search Results (0.0.2) ? | DB Names Search Page (0.0.1) ? | DB Distribution List Species (0.0.2) ? | DB Distribution Main (0.0.1) ? | DB Red List Species (0.0.1) ? | DB Red List Database (0.0.1) ? | DB Red List Categories (0.0.1) ? | DB Intro Page (0.0.1) ? | mod_phocacart_currency_mobile (3.4.0) ? | mod_phocacart_wishlist (3.5.5) ? | mod_phocacart_search (3.5.5) ? | mod_phocacart_product (3.5.5) ? | mod_phocacart_product_scroller (3.5.5) ? | mod_phocacart_filter (3.5.5) ? | mod_phocacart_currency (3.5.5) ? | mod_phocacart_compare (3.5.5) ? | mod_phocacart_category (3.5.5) ? | mod_phocacart_cart (3.5.5) ? | mod_phocacart_brands (3.5.5) ? | Smart Slider 3 Module (3.5.1.7) ? | RokSprocket Module (2.1.28) ? | News Show SP2 (2.9) ? | mod_gantry5_particle (5.5.14) ? |
Modules :: Admin ::
Core :: mod_version (3.0.0) ? | mod_toolbar (3.0.0) ? | mod_title (3.0.0) ? | mod_submenu (3.0.0) ? | mod_status (3.0.0) ? | mod_stats_admin (3.0.0) ? | mod_sampledata (3.8.0) ? | mod_quickicon (3.0.0) ? | mod_privacy_dashboard (3.9.0) ? | mod_popular (3.0.0) ? | mod_multilangstatus (3.0.0) ? | mod_menu (3.0.0) ? | mod_login (3.0.0) ? | mod_logged (3.0.0) ? | mod_latestactions (3.9.0) ? | mod_latest (3.0.0) ? | mod_feed (3.0.0) ? | mod_custom (3.0.0) ? |
3rd Party:: MOD_JCHMODESWITCHER (7.2.4) ? |
Libraries ::
Core ::
3rd Party:: file_fof40 (4.1.3) ? | file_fof30 (3.6.2) ? | Regular Labs Library (22.6.8549) ? |
Plugins ::
Core :: plg_user_terms (3.9.0) ? | plg_user_profile (3.0.0) ? | plg_user_joomla (3.0.0) ? | plg_user_contactcreator (3.0.0) ? | plg_twofactorauth_yubikey (3.2.0) ? | plg_twofactorauth_totp (3.2.0) ? | plg_system_updatenotification (3.5.0) ? | plg_system_stats (3.5.0) ? | plg_system_sessiongc (3.8.6) ? | plg_system_sef (3.0.0) ? | plg_system_remember (3.0.0) ? | plg_system_redirect (3.0.0) ? | plg_system_privacyconsent (3.9.0) ? | plg_system_p3p (3.0.0) ? | plg_system_logrotation (3.9.0) ? | plg_system_logout (3.0.0) ? | plg_system_log (3.0.0) ? | plg_system_languagefilter (3.0.0) ? | plg_system_languagecode (3.0.0) ? | plg_system_highlight (3.0.0) ? | plg_system_fields (3.7.0) ? | plg_system_debug (3.0.0) ? | plg_system_cache (3.0.0) ? | PLG_SYSTEM_ACTIONLOGS (3.9.0) ? | plg_search_tags (3.0.0) ? | plg_search_newsfeeds (3.0.0) ? | plg_search_content (3.0.0) ? | plg_search_contacts (3.0.0) ? | plg_search_categories (3.0.0) ? | plg_quickicon_eos310 (3.10.0) ? | plg_quickicon_privacycheck (3.9.0) ? | plg_quickicon_phpversioncheck (3.7.0) ? | plg_quickicon_joomlaupdate (3.0.0) ? | plg_quickicon_extensionupdate (3.0.0) ? | plg_privacy_user (3.9.0) ? | plg_privacy_message (3.9.0) ? | plg_privacy_content (3.9.0) ? | plg_privacy_consents (3.9.0) ? | plg_privacy_actionlogs (3.9.0) ? | PLG_INSTALLER_URLINSTALLER (3.6.0) ? | plg_installer_packageinstaller (3.6.0) ? | PLG_INSTALLER_FOLDERINSTALLER (3.6.0) ? | plg_finder_tags (3.0.0) ? | plg_finder_newsfeeds (3.0.0) ? | plg_finder_content (3.0.0) ? | plg_finder_contacts (3.0.0) ? | plg_finder_categories (3.0.0) ? | plg_fields_usergrouplist (3.7.0) ? | plg_fields_user (3.7.0) ? | plg_fields_url (3.7.0) ? | plg_fields_textarea (3.7.0) ? | plg_fields_text (3.7.0) ? | plg_fields_sql (3.7.0) ? | plg_fields_repeatable (3.9.0) ? | plg_fields_radio (3.7.0) ? | plg_fields_media (3.7.0) ? | plg_fields_list (3.7.0) ? | plg_fields_integer (3.7.0) ? | plg_fields_imagelist (3.7.0) ? | plg_fields_editor (3.7.0) ? | plg_fields_color (3.7.0) ? | plg_fields_checkboxes (3.7.0) ? | plg_fields_calendar (3.7.0) ? | plg_extension_joomla (3.0.0) ? | plg_editors-xtd_readmore (3.0.0) ? | plg_editors-xtd_pagebreak (3.0.0) ? | plg_editors-xtd_module (3.5.0) ? | plg_editors-xtd_menu (3.7.0) ? | plg_editors-xtd_image (3.0.0) ? | plg_editors-xtd_fields (3.7.0) ? | plg_editors-xtd_article (3.0.0) ? | plg_content_vote (3.0.0) ? | plg_content_pagenavigation (3.0.0) ? | plg_content_pagebreak (3.0.0) ? | plg_content_loadmodule (3.0.0) ? | plg_content_joomla (3.0.0) ? | plg_content_finder (3.0.0) ? | plg_content_fields (3.7.0) ? | plg_content_emailcloak (3.0.0) ? | plg_content_confirmconsent (3.9.0) ? | plg_captcha_recaptcha_invisible (3.8) ? | plg_captcha_recaptcha (3.4.0) ? | plg_authentication_ldap (3.0.0) ? | plg_authentication_joomla (3.0.0) ? | plg_authentication_gmail (3.0.0) ? | plg_authentication_cookie (3.0.0) ? | PLG_ACTIONLOG_JOOMLA (3.9.0) ? |
3rd Party:: plg_ajax_ukey (1.0.1) ? | Jdonation - Mailchimp newsletter Pl (5.4.5) ? | Jdonation - ACYM newsletter Plugin (5.4.6) ? | Jdonation - ACYMailing newsletter P (5.4.5) ? | Joom Donation - Spam detect (5.1) ? | plg_phocapdf_content (3.0.12) ? | plg_phocapdf_phocacart (3.0.12) ? | plg_pcs_shipping_standard (3.5.6) ? | plg_pcp_stripe (2.0.1) ? | plg_pcp_pos_cash (3.5.6) ? | plg_pcp_paypal_standard (3.5.6) ? | plg_pcp_cash_on_delivery (3.5.6) ? | PLG_USER_JCHOPTIMIZEUSERSTATE (7.2.4) ? | CookieHint and Consent (1.4.1) ? | PLG_SYSTEM_BACKUPONUPDATE (8.1.8) ? | Smart Slider 3 System Plugin (3.5.1.7) ? | PLG_SYSTEM_JCHOPTIMIZE (7.2.4) ? | PLG_SYSTEM_TABS (8.2.0) ? | PLG_SYSTEM_SOURCERER (9.2.3) ? | PLG_SYSTEM_REGULARLABS (22.6.8549) ? | PLG_MULTILANGUAGESCK_XML_NAME (4.0.1) ? | System - Add Print Stylesheet (1.3) ? | plg_system_phocapdf (3.0.12) ? | plg_system_jce (2.9.28) ? | System - RokSprocket (2.1.28) ? | System - RokCommon (3.2.9) ? | plg_system_gantry5 (5.5.14) ? | PLG_SYSTEM_JCHOPTIMIZEPAGECACHE (7.2.4) ? | plg_quickicon_akeebabackup (8.1.8) ? | plg_quickicon_jce (2.9.28) ? | plg_quickicon_gantry5 (5.5.14) ? | Joom Donation Update Package (4.4) ? | Smart Slider 3 Updater Plugin (3.5.1.7) ? | plg_installer_jce (2.9.28) ? | plg_gantry5_preset (5.5.14) ? | plg_fields_mediajce (2.9.28) ? | plg_extension_jce (2.9.28) ? | PLG_EDITORS-XTD_TABS (8.2.0) ? | PLG_EDITORS-XTD_SOURCERER (9.2.3) ? | plg_editors_jce (2.9.28) ? | plg_editors_tinymce (4.5.12) ? | plg_editors_codemirror (5.60.0) ? | Joom Donation Form Plugin (4.2) ? | PLG_CONTENT_CURRENTYEAR (1.0.0) ? | plg_content_jce (2.9.28) ? | Content - RokInjectModule (2.1.28) ? | PLG_ACTIONLOG_AKEEBABACKUP (8.1.8) ? |
Templates Discovered :: wrote: Templates :: Site :: protostar (1.0) ? | it_milano (1.13.0) ? | beez3 (3.1.0) ? |
Templates :: Admin :: isis (1.0) ? | hathor (3.0.0) ? |
Last edited by imanickam on Wed Jul 20, 2022 1:20 pm, edited 1 time in total.
Reason: Disabled Smiliies
AlexanderG_2019 wrote: Wed Jul 20, 2022 11:14 am The problem seems to be in:
/home/haistift/www/haistiftung.ch/htdocs/administrator/components/com_admin/views/sysinfo/tmpl/default_config.php:37
This is line 37 of default_config.php:

Code: Select all

						<?php echo htmlspecialchars($value, ENT_QUOTES); ?>
That line is perfectly normal and the command works, as long as the variable $value contains a string. The error message says this parameter contains an array. The contents of $value comes from the settings in the Global Configuration, the file configuration.php, which, by default, does not contain any arrays.
A possible explanation is that the array is inserted into the file or the generated config object by a third party extension that uses the array for its own purposes. Because PHP 8 rejects an array as the first parameter of the function in line 37, that extension is now incompatible.
The website has a couple of possible extensions that may use the Joomla configuration file in a non-standard way. Profiles was last updated in 2015 and is therefore unlikely to work with PHP 8. The paid extension MightySites could also be involved in this issue because the FPA is unable to find the Joomla database configuration.
Toivo Talikka , Global Moderator
Dear Toivo
Thank you very much for this really helpful info. I uninstalled Profiles (error remains) and asked the MightySites guys if they know of any PHP 8.0 problems.
Is there any way to print out the $value that is passed to default_config.php:37? Maybe I can find the problematic extension like this. Otherwise I would have to install a vanilla 3.10.10 and all my the extensions one by one to find the culprit.
Thanks again
Alexander
Posts: 20661
Joined: Mon Aug 29, 2005 10:17 am
Location: Netherlands/ Germany/ S'pore/Bogor/ North America
Contact: