Skip to content

Commit

Permalink
Fix for double-encoded document IDs in Futon. Closes COUCHDB-39.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.apache.org/repos/asf/incubator/couchdb/trunk@647314 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
cmlenz committed Apr 11, 2008
1 parent 30f8e24 commit 505344c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions share/www/script/browse.js
Expand Up @@ -58,10 +58,11 @@ function CouchDatabasePage() {
var urlParts = location.search.substr(1).split("/");
var dbName = urlParts.shift();
var viewName = (urlParts.length > 0) ? urlParts.join("/") : null;
if (!viewName) {
viewName = $.cookies.get(dbName + ".view") || "";
} else {
if (viewName) {
viewName = decodeURIComponent(viewName);
$.cookies.set(dbName + ".view", viewName);
} else {
viewName = $.cookies.get(dbName + ".view") || "";
}
var db = new CouchDB(dbName);

Expand Down Expand Up @@ -376,7 +377,7 @@ function CouchDocumentPage() {
var urlParts = location.search.substr(1).split("/");
var dbName = urlParts.shift();
var idParts = urlParts.join("/").split("@", 2);
var docId = idParts[0];
var docId = decodeURIComponent(idParts[0]);
var docRev = (idParts.length > 1) ? idParts[1] : null;
var db = new CouchDB(dbName);
var doc = db.open(docId, {revs_info: true});
Expand Down

0 comments on commit 505344c

Please sign in to comment.