JavaScript deleteCookie() function is broken (affects Internet Explorer, section edit icons)
- Status
- Open
- Subject
- JavaScript deleteCookie() function is broken (affects Internet Explorer, section edit icons)
- Version
- 15.x
19.x - Category
- Bug
- Resolution status
- New
- Submitted by
- Philippe Cloutier
- Lastmod by
- Philippe Cloutier
- Rating
- Description
The deleteCookie function in tiki-js.js uses an invalid date format which is not accepted by Internet Explorer (even version 11) for its expires attribute. As a result, the following line which is supposed to delete the cookie only sets its value to an empty string in Internet Explorer:
Copy to clipboarddocument.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01 Jan 1970 00:00:01 GMT";
This impacts code which checks for a cookie's existence, such as the following fragment from parse_first() (in parserlib.php):Copy to clipboard$iconDisplayStyle = ''; if ($prefs['wiki_edit_icons_toggle'] == 'y' && ($prefs['wiki_edit_plugin'] == 'y' || $prefs['wiki_edit_section'] == 'y')) { if (!isset($_COOKIE['wiki_plugin_edit_view'])) { $iconDisplayStyle = ' style="display:none;"'; } }
The above example means that plugin call and section edit icons do not get their style set to display:none by specific CSS, which causes icons to show during load, until Javascript hides these when the page load is over. This happens when wiki_edit_icons_toggle is enabled and a user of Internet Explorer has hidden icons. To reproduce, it is probably necessary to display icons, then to hide them, then to load a page.The invalid date format was introduced no later than 2003-08-07 and remains in trunk as of r68584.
- Files
- Solution
- Valid full date formats for Document.cookie
are specified in section 3.3.1 of RFC 2616
. The attached patch uses the preferred (first) format rather than a mixture of several. - Importance
- 2
- Easy to solve?
- 8
- Priority
- 16
- Demonstrate Bug on Tiki 19+
-
This bug has been demonstrated on show2.tiki.org
Please demonstrate your bug on show2.tiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show2.tiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Demonstrate Bug (older Tiki versions)
-
This bug has been demonstrated on show.tikiwiki.org
Please demonstrate your bug on show.tikiwiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show.tikiwiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Ticket ID
- 7007
- Created
- Friday 25 January, 2019 20:21:28 UTC
by Philippe Cloutier - LastModif
- Saturday 06 July, 2024 10:21:44 UTC