Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#9241 closed bug (duplicate)

function dataAttr( elem, key, data ) @ line 1664 overwrites window.name

Reported by: lasstlos@… Owned by:
Priority: high Milestone: 1.6.1
Component: data Version: 1.6
Keywords: Cc:
Blocked by: Blocking:

Description

Line 1664: name = "data-" + key.replace( rmultiDash, "$1-$2" ).toLowerCase();

The name variable is not declared so name scopes to window.name and overwrites the window.name variable. Adding a var to the beginning of this line resolves this issue. I believe line 1664 should be:

var name = "data-" + key.replace( rmultiDash, "$1-$2" ).toLowerCase();

How I came across this bug: We currently use the window.name to hold a guid that is used to track the active window in a session. We then use this guid to prevent a user from getting multiple windows in the same session and getting an inconsistent session state. If window.name changes, we think that the browser window requesting the info is not the valid one and force the user to close their window.

Change History (2)

comment:1 Changed 12 years ago by Timmy Willison

Component: unfileddata
Milestone: 1.next1.6.1
Priority: undecidedhigh
Resolution: duplicate
Status: newclosed

comment:2 Changed 12 years ago by Timmy Willison

Duplicate of #9126.

Note: See TracTickets for help on using tickets.