? Success
Pull Request for # 8073

User tests: Successful: Unsuccessful:

avatar klas
klas
12 Oct 2015

Fix JInputCookie set method to support array values (fixes #8073 )


Steps to reproduce the issue

Run this code
JFactory::getApplication()->input->cookie->set("arraytest", array("asssoc1"=>"assoc1value","asssoc2"=>"assoc2value" ),time() + 365 * 86400);

Expected result

Cookies arraytest[asssoc1] with value "assoc1value", and arraytest[asssoc2] with value "assoc2value" beeing set

Actual result

Warning: setcookie() expects parameter 2 to be string, array given in libraries\joomla\input\cookie.php on line 85
No cookie is set

avatar klas klas - open - 12 Oct 2015
avatar klas klas - change - 12 Oct 2015
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 12 Oct 2015
Labels Added: ?
avatar zero-24 zero-24 - change - 12 Oct 2015
The description was changed
avatar zero-24 zero-24 - change - 12 Oct 2015
Category Libraries
avatar zero-24 zero-24 - change - 12 Oct 2015
Rel_Number 0 8073
Relation Type Pull Request for
Easy No Yes
avatar Fedik
Fedik - comment - 13 Oct 2015

@klas but you know that the Browser Cookies accept only String? :wink:
I think, if you need something extra, you need to do it in your code

From my point of view suggested behavior is wrong

avatar klas
klas - comment - 13 Oct 2015

@Fedik not exactly true, thaere are also array cookies, see example #3 here http://php.net/manual/en/function.setcookie.php

avatar infograf768
infograf768 - comment - 13 Oct 2015

This is B/C in multilanguage.

avatar Fedik
Fedik - comment - 13 Oct 2015

@klas hm, this I missed, sorry :wink:

avatar klas
klas - comment - 13 Oct 2015

@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).

avatar infograf768
infograf768 - comment - 13 Oct 2015

@klas
Yep, that's what I confirmed above. :smile:

avatar klas
klas - comment - 13 Oct 2015

Ah, sorry, I thought you are saying it is not B/C :)

avatar klas
klas - comment - 20 Oct 2015

@zero-24 I removed the empty line, so it should be ok now

avatar zero-24 zero-24 - test_item - 20 Oct 2015 - Tested successfully
avatar zero-24
zero-24 - comment - 20 Oct 2015

I have tested this item :white_check_mark: successfully on 45ef9af


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

avatar zero-24
zero-24 - comment - 20 Oct 2015

Works here see: screen shot 2015-10-20 at 09 15 04


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

avatar kolvar kolvar - test_item - 24 Oct 2015 - Tested successfully
avatar kolvar
kolvar - comment - 24 Oct 2015

I have tested this item :white_check_mark: successfully on 45ef9af

Tested whit given code. Works


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

avatar kolvar kolvar - test_item - 24 Oct 2015 - Tested successfully
avatar kolvar
kolvar - comment - 24 Oct 2015

I have tested this item :white_check_mark: successfully on 45ef9af

Tested whit given code. Works


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

avatar SniperSister SniperSister - change - 24 Oct 2015
Status Pending Ready to Commit
avatar SniperSister
SniperSister - comment - 24 Oct 2015

2 successful tests, setting RTC


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

avatar joomla-cms-bot joomla-cms-bot - change - 24 Oct 2015
Labels Added: ?
avatar Kubik-Rubik Kubik-Rubik - change - 24 Oct 2015
Milestone
avatar Kubik-Rubik
Kubik-Rubik - comment - 24 Oct 2015

Thank you @klas! Merged.

avatar Kubik-Rubik Kubik-Rubik - reference | f89ecaf - 24 Oct 15
avatar Kubik-Rubik Kubik-Rubik - merge - 24 Oct 2015
avatar Kubik-Rubik Kubik-Rubik - close - 24 Oct 2015
avatar Kubik-Rubik Kubik-Rubik - change - 24 Oct 2015
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2015-10-24 10:13:03
Closed_By Kubik-Rubik
avatar Kubik-Rubik Kubik-Rubik - close - 24 Oct 2015
avatar joomla-cms-bot joomla-cms-bot - close - 24 Oct 2015
avatar joomla-cms-bot joomla-cms-bot - change - 24 Oct 2015
Labels Removed: ?
avatar zero-24 zero-24 - change - 28 Oct 2015
Milestone
avatar zero-24 zero-24 - change - 28 Oct 2015
Milestone Added:
avatar zero-24 zero-24 - change - 28 Oct 2015
Milestone Added:
avatar zero-24 zero-24 - change - 28 Oct 2015
Milestone

Add a Comment

Login with GitHub to post a comment