Change cookie prefix to not include illegal ':' character

git-svn-id: https://mathjax.svn.sourceforge.net/svnroot/mathjax/trunk@595 b8fd5906-0fad-46e2-a0d3-10d94ff285d1
This commit is contained in:
Davide Cervone 2010-08-29 20:52:19 +00:00
parent b2cdb55231
commit 3a43c9b273
2 changed files with 3 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@ -944,7 +944,7 @@ MathJax.HTML = {
keys.push(id+":"+def[id].toString().replace(/&/g,"&&")); keys.push(id+":"+def[id].toString().replace(/&/g,"&&"));
}} }}
} }
var cookie = this.prefix+":"+name+"="+escape(keys.join('&;')); var cookie = this.prefix+"/"+name+"="+escape(keys.join('&;'));
if (this.expires) { if (this.expires) {
var time = new Date(); time.setDate(time.getDate() + this.expires); var time = new Date(); time.setDate(time.getDate() + this.expires);
cookie += '; expires='+time.toGMTString(); cookie += '; expires='+time.toGMTString();
@ -958,7 +958,7 @@ MathJax.HTML = {
// //
Get: function (name,obj) { Get: function (name,obj) {
if (!obj) {obj = {}} if (!obj) {obj = {}}
var pattern = new RegExp("(?:^|;\\s*)"+this.prefix+":"+name+"=([^;]*)(?:;|$)"); var pattern = new RegExp("(?:^|;\\s*)"+this.prefix+"/"+name+"=([^;]*)(?:;|$)");
var match = pattern.exec(document.cookie); var match = pattern.exec(document.cookie);
if (match && match[1] !== "") { if (match && match[1] !== "") {
var keys = unescape(match[1]).split('&;'); var keys = unescape(match[1]).split('&;');