Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.1

Bug #21097 PHP Warning: Illegal string offset 'attr' or 'text'
Submitted: 2016-07-06 08:51 UTC
From: creator Assigned:
Status: Open Package: HTML_QuickForm_advmultiselect (version 1.5.1)
PHP Version: 5.5.9-1 OS: Irrelevant
Roadmaps: (Not assigned)    
Subscription  


 [2016-07-06 08:51 UTC] creator (Stefano Coletta)
Description: ------------ When $data['attr'] or $data['text'] is used in the class code it throws the PHP Warning: Illegal string offset 'attr' or 'text'. This behaviour started after upgrading from PHP 5.2 to PHP 5.5.x. Test script: --------------- Any use of the class generates the warning. Expected result: ---------------- No warning as in PHP 5.2 Actual result: -------------- PHP Warning: Illegal string offset 'attr' or 'text'

Comments

 [2016-07-06 08:55 UTC] creator (Stefano Coletta)
To fix it just replace: $data['attr'] with (isset($data['attr']) ? $data['attr'] : '') and $data['text'] with (isset($data['text']) ? $data['text'] : '') in lines 807, 808, 821 and 822.
 [2016-07-06 09:03 UTC] creator (Stefano Coletta)
 [2016-07-06 09:09 UTC] creator (Stefano Coletta)
-PHP Version: 5.5.19 +PHP Version: 5.5.1
 [2016-07-06 09:09 UTC] creator (Stefano Coletta)
-PHP Version: 5.5.1 +PHP Version: 5.5.9-1