php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49873 array_map + htmlspecialchars_decode problem
Submitted: 2009-10-14 11:38 UTC Modified: 2009-10-14 16:18 UTC
From: webmaster at flex-code dot net Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 5.3.0 OS: Ubuntu Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: webmaster at flex-code dot net
New email:
PHP Version: OS:

 

 [2009-10-14 11:38 UTC] webmaster at flex-code dot net
Description:
------------
Trying to decode encoded html special characters by using the array_map and htmlspecialchars_decode functions returns an error by htmlspecialchars_decode.

Reproduce code:
---------------
return array_map('htmlspecialchars_decode', array($aArray, ENT_QUOTES));

Expected result:
----------------
All encoded special characters should be decoded to their respective html characters, eg. ' => ', " => "

Actual result:
--------------
ERRNO: 2
TEXT: htmlspecialchars_decode() expects parameter 1 to be string, array given
LOCATION: /var/www/live/i/intranet-rewrite/base/includes/class_postgres.php, line 345, at October 14, 2009, 1:25 pm

Debug Backtrace:

- htmlspecialchars_decode(Array[57]) # line 0, file: unknown
- array_map("htmlspecialchars_decode", Array[2]) # line 345, file: /var/www/live/i/intranet-rewrite/base/includes/class_postgres.php
- Resultset.convertCharacters(Array[57]) # line 336, file: /var/www/live/i/intranet-rewrite/base/includes/class_postgres.php
- Resultset.fetchRow() # line 87, file: /var/www/live/i/intranet-rewrite/hr/person_add_edit.php

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-10-14 16:18 UTC] Sjoerd@php.net
Thank you for your report.

The behavior you report is not a bug. Also note that bugs.php.net is not a place to ask for support; it is a place to file bugs. For support, please see:
http://nl2.php.net/support.php

Please try:
array_map('htmlspecialchars_decode', $anArray);
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 14:04:04 2025 UTC