diff options
author | Jan Lehnardt <jan@apache.org> | 2011-04-16 20:41:19 +0000 |
---|---|---|
committer | Jan Lehnardt <jan@apache.org> | 2011-04-16 20:41:19 +0000 |
commit | 9101d43b0f1e3d7f6ea902d8b52beaa0e539f8f1 (patch) | |
tree | f1bb77d4771905fee599eeb2282e7e0fa195975d /share/www/script | |
parent | 7de9ce5408b4cee176130520bcecf742ea6a6c2a (diff) |
Fix display issue with documents that have single or double quotes
in their id.
Closes COUCHDB-1111
git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1094050 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script')
-rw-r--r-- | share/www/script/futon.browse.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/share/www/script/futon.browse.js b/share/www/script/futon.browse.js index 6b3c979c..56435ae4 100644 --- a/share/www/script/futon.browse.js +++ b/share/www/script/futon.browse.js @@ -682,10 +682,12 @@ key = $.futon.formatJSON(row.key, {indent: 0, linesep: ""}); } if (row.id) { - $("<td class='key'><a href='document.html?" + encodeURIComponent(db.name) + - "/" + $.couch.encodeDocId(row.id) + "'><strong></strong><br>" + - "<span class='docid'>ID: " + $.futon.escape(row.id) + "</span></a></td>") - .find("strong").text(key).end() + key = key.replace(/\\"/, '"'); + var rowlink = encodeURIComponent(db.name) + + "/" + $.couch.encodeDocId(row.id); + $("<td class='key'><a href=\"document.html?" + rowlink + "\"><strong>" + + $.futon.escape(key) + "</strong><br>" + + "<span class='docid'>ID: " + $.futon.escape(row.id) + "</span></a></td>") .appendTo(tr); } else { $("<td class='key'><strong></strong></td>") |