inloop / sqlite-viewer

View SQLite file online
http://inloop.github.io/sqlite-viewer
Apache License 2.0
861 stars 324 forks source link

Use decodeURI for remote URL #15

Closed ricardojlrufino closed 6 years ago

ricardojlrufino commented 7 years ago

This prevents errors in urls with parameters See patch file (check and apply).

git apply --check 0001-use-decodeURI-for-remote-URL.patch git am < 0001-use-decodeURI-for-remote-URL.patch

0001-use-decodeURI-for-remote-URL.patch

From 83036066645a42fc32bed6cbdd26fb83e2b77fbd Mon Sep 17 00:00:00 2001
From: "ricardo.jl.rufino@gmail.com" <ricardo.jl.rufino@gmail.com>
Date: Tue, 16 May 2017 12:51:29 -0300
Subject: [PATCH] use decodeURI for remote URL

---
 js/main.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/js/main.js b/js/main.js
index eca5a64..8ebefb7 100644
--- a/js/main.js
+++ b/js/main.js
@@ -110,7 +110,7 @@ var loadUrlDB = $.urlParam('url');
 if (loadUrlDB != null) {
     setIsLoading(true);
     var xhr = new XMLHttpRequest();
-    xhr.open('GET', loadUrlDB, true);
+    xhr.open('GET', decodeURIComponent(loadUrlDB), true);
     xhr.responseType = 'arraybuffer';

     xhr.onload = function(e) {
-- 
2.7.4
ricardojlrufino commented 7 years ago

PR #14