aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2016-09-19 23:59:57 +0200
committerGitHub <noreply@github.com>2016-09-19 23:59:57 +0200
commitd2887b76bc8b7311b0d4347cfe956dd50ba8cceb (patch)
tree5298498c3817f94accdf95f6bcca15d91c021a74 /core
parentf4a4578f0de9cd0e41786b1af20ca642af390101 (diff)
parentc80c5ad9588ff71e92bfa43e6089e671f9ec8039 (diff)
downloadnextcloud-server-d2887b76bc8b7311b0d4347cfe956dd50ba8cceb.tar.gz
nextcloud-server-d2887b76bc8b7311b0d4347cfe956dd50ba8cceb.zip
Merge pull request #1430 from longsleep/fixup-getURLParameter
Fixup getURLParameter 'null' return and encoding support
Diffstat (limited to 'core')
-rw-r--r--core/js/js.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/js/js.js b/core/js/js.js
index c7a06b85e53..67487ec979c 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -1722,9 +1722,10 @@ function formatDate(timestamp){
* @return {string}
*/
function getURLParameter(name) {
- return decodeURI(
- (RegExp(name + '=' + '(.+?)(&|$)').exec(location.search) || [, null])[1]
- );
+ return decodeURIComponent(
+ (new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(
+ location.search)||[,''])[1].replace(/\+/g, '%20')
+ )||'';
}
/**