couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cml...@apache.org
Subject svn commit: r647314 - /incubator/couchdb/trunk/share/www/script/browse.js
Date Fri, 11 Apr 2008 21:20:01 GMT
Author: cmlenz
Date: Fri Apr 11 14:19:59 2008
New Revision: 647314

URL: http://svn.apache.org/viewvc?rev=647314&view=rev
Log:
Fix for double-encoded document IDs in Futon. Closes COUCHDB-39.

Modified:
    incubator/couchdb/trunk/share/www/script/browse.js

Modified: incubator/couchdb/trunk/share/www/script/browse.js
URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/share/www/script/browse.js?rev=647314&r1=647313&r2=647314&view=diff
==============================================================================
--- incubator/couchdb/trunk/share/www/script/browse.js [utf-8] (original)
+++ incubator/couchdb/trunk/share/www/script/browse.js [utf-8] Fri Apr 11 14:19:59 2008
@@ -58,10 +58,11 @@
   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);
 
@@ -376,7 +377,7 @@
   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});



Mime
View raw message