? Pending

User tests: Successful: Unsuccessful:

avatar dryabov
dryabov
20 Jul 2020

Fix a warning htmlspecialchars() expects parameter 1 to be string, array given in the case of array passed as an argument in the stack trace.

Summary of Changes

Add a check for special case of is_array($arg).

Testing Instructions

Declare a function like

function TestMe($array) {
  JText::_($array[0]);
}

and call it TestMe(['qweasd']) with enabled language logging.

Actual result BEFORE applying this Pull Request

<b>Warning</b>:  htmlspecialchars() expects parameter 1 to be string, array given in <b>.../plugins/system/debug/src/DataFormatter.php</b> on line <b>66</b>

Expected result AFTER applying this Pull Request

No warning message

avatar dryabov dryabov - open - 20 Jul 2020
avatar dryabov dryabov - change - 20 Jul 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 20 Jul 2020
Category Front End Plugins
avatar SharkyKZ SharkyKZ - test_item - 17 Sep 2020 - Tested successfully
avatar SharkyKZ
SharkyKZ - comment - 17 Sep 2020

I have tested this item successfully on ee90cf1


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30144.

avatar hamby
hamby - comment - 18 Oct 2020

Some questions on Testing-Instruction:

  1. What does mean "enabled language logging"
  2. Output BEFORE is to find here 'administrator/logs/...' or as font-end message?

Thanks

avatar ceford
ceford - comment - 18 Nov 2020

I am afraid this one has beaten me. I put the following in cassiopeia:

function TestMe($array) {
	echo Text::_($array[0]);
}
TestMe(['qweasd']);

But following through the code with the debugger the section where the change is made is never executed. In the debug bar I see the stack trace for qweasd whether or not the patch is applied. What am I doing wrong?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30144.

avatar gostn gostn - test_item - 24 Nov 2020 - Tested successfully
avatar gostn
gostn - comment - 24 Nov 2020

I have tested this item successfully on ee90cf1


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30144.

avatar gostn
gostn - comment - 1 Dec 2020

set RTC

avatar HLeithner HLeithner - change - 1 Dec 2020
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-12-01 09:30:37
Closed_By HLeithner
avatar HLeithner HLeithner - close - 1 Dec 2020
avatar HLeithner HLeithner - merge - 1 Dec 2020
avatar HLeithner
HLeithner - comment - 1 Dec 2020

Thanks

Add a Comment

Login with GitHub to post a comment