? Success

User tests: Successful: Unsuccessful:

avatar infograf768
infograf768
27 May 2014

When using php 5.4 and displaying in frontend the Advanced parameters in a Smart Search form (from the menu item or from the result of a search via the module, we get
Warning: Illegal string offset 'class' in ROOT/libraries/cms/html/html.php on line 965

Also, the tips for the date do not display as should;

After patch, no more Warning and the tips should display like this, when hovering the Start Date or hovering the date field (if a date has been chosen when doing a second search)
screen shot 2014-05-27 at 13 01 05
screen shot 2014-05-27 at 13 01 33

avatar infograf768 infograf768 - open - 27 May 2014
avatar wilsonge
wilsonge - comment - 27 May 2014

There is something similar to this here: #3578 but I think the point is the bug is that we shouldn't be putting in a string. We're supposed to have put in an array since J1.6

avatar SpiritJC
SpiritJC - comment - 27 May 2014

Tested with PHP 5.5.9. PR works as described.

avatar tompap
tompap - comment - 28 May 2014

Hello, Tested with PHP 5.5.7. it's ok.

I agree with wilsonge: "Can we move this to the in_array() statement 3/4 lines below"

think the point is the bug is that we shouldn't be putting in a string. We're supposed to have put in an array since J1.6
I agree with that but if we want only a string we should return an error instead of processing.
Also as some third party extensions are still using the string way, it's better for me to support both and better for backward compatibility.

Finally, the bug is not limited to PHP 5.4+, if you use PHP 5.3 there is no warning, but the result is not correct. It's just that PHP5.4+ it's better than telling you there is an error.

PHP 5.3 Bug Example: $attribs = " onchange='XXXXXX'";
$attribs['class'] = isset($attribs['class']) ? $attribs['class'] : 'input-medium';
var_dump($attribs);
$atttribs = "ionchange='XXXX'";

avatar infograf768 infograf768 - change - 28 May 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-05-28 10:10:13
avatar infograf768 infograf768 - close - 28 May 2014
avatar infograf768 infograf768 - close - 28 May 2014
avatar infograf768
infograf768 - comment - 28 May 2014
avatar infograf768 infograf768 - head_ref_deleted - 28 May 2014

Add a Comment

Login with GitHub to post a comment