User tests: Successful: Unsuccessful:
Fix JInputCookie set method to support array values (fixes #8073 )
Run this code
JFactory::getApplication()->input->cookie->set("arraytest", array("asssoc1"=>"assoc1value","asssoc2"=>"assoc2value" ),time() + 365 * 86400);
Cookies arraytest[asssoc1] with value "assoc1value", and arraytest[asssoc2] with value "assoc2value" beeing set
Warning: setcookie() expects parameter 2 to be string, array given in libraries\joomla\input\cookie.php on line 85
No cookie is set
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
Category | ⇒ | Libraries |
Rel_Number | 0 | ⇒ | 8073 |
Relation Type | ⇒ | Pull Request for | |
Easy | No | ⇒ | Yes |
@Fedik not exactly true, thaere are also array cookies, see example #3 here http://php.net/manual/en/function.setcookie.php
This is B/C in multilanguage.
@infograf768 After the change method only starts accepting arrays (which did not work at all before, see #8073 ), but it still accepts strings, so there should be no B/C change (for strings code is exactly the same as it was before).
Ah, sorry, I thought you are saying it is not B/C :)
I have tested this item successfully on 45ef9af
I have tested this item successfully on 45ef9af
Tested whit given code. Works
I have tested this item successfully on 45ef9af
Tested whit given code. Works
Status | Pending | ⇒ | Ready to Commit |
2 successful tests, setting RTC
Labels |
Added:
?
|
Milestone |
Status | Ready to Commit | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-10-24 10:13:03 |
Closed_By | ⇒ | Kubik-Rubik |
Labels |
Removed:
?
|
Milestone |
Milestone |
Added: |
Milestone |
Added: |
Milestone |
@klas but you know that the Browser Cookies accept only String?
I think, if you need something extra, you need to do it in your code
From my point of view suggested behavior is wrong