diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2016-09-19 23:59:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-19 23:59:57 +0200 |
commit | d2887b76bc8b7311b0d4347cfe956dd50ba8cceb (patch) | |
tree | 5298498c3817f94accdf95f6bcca15d91c021a74 /core | |
parent | f4a4578f0de9cd0e41786b1af20ca642af390101 (diff) | |
parent | c80c5ad9588ff71e92bfa43e6089e671f9ec8039 (diff) | |
download | nextcloud-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.js | 7 |
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') + )||''; } /** |