summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/lib
diff options
context:
space:
mode:
authorClement Ho <ClemMakesApps@gmail.com>2017-01-09 16:23:51 -0600
committerClement Ho <ClemMakesApps@gmail.com>2017-01-09 16:23:51 -0600
commite0e855b5f49bc8efc3ca69aa83ea28d6becb53cc (patch)
treeda79b8812daefecd68f10a3692674c17e42ae421 /app/assets/javascripts/lib
parentc0287e69c6717fe9de5ff0b804f952410e453ef8 (diff)
downloadgitlab-ce-e0e855b5f49bc8efc3ca69aa83ea28d6becb53cc.tar.gz
Fix code review suggestions
Diffstat (limited to 'app/assets/javascripts/lib')
-rw-r--r--app/assets/javascripts/lib/utils/common_utils.js.es62
1 files changed, 2 insertions, 0 deletions
diff --git a/app/assets/javascripts/lib/utils/common_utils.js.es6 b/app/assets/javascripts/lib/utils/common_utils.js.es6
index 8aa78f407e5..3e2c75d3cc6 100644
--- a/app/assets/javascripts/lib/utils/common_utils.js.es6
+++ b/app/assets/javascripts/lib/utils/common_utils.js.es6
@@ -169,6 +169,8 @@
w.gl.utils.getParameterByName = (name) => {
const url = window.location.href;
name = name.replace(/[[\]]/g, '\\$&');
+ // Finds the value associated to the name
+ // Example, state=open where state is the name and open is the value
const regex = new RegExp(`[?&]${name}(=([^&#]*)|&|#|$)`);
const results = regex.exec(url);
if (!results) return null;