From 96395bccaa46391a23bae02bef6059c440f12be9 Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Sat, 13 Jun 2015 19:28:19 -0700 Subject: [PATCH] javascript-detection: do not munge javascript: links Adding a '?js=0' or '?js=1' to a 'javascript:...' link will break it so update the RegExp to exclude them. Signed-off-by: Kyle J. McKay --- gitweb/static/js/javascript-detection.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gitweb/static/js/javascript-detection.js b/gitweb/static/js/javascript-detection.js index fa2596f77c..09dcaa64f7 100644 --- a/gitweb/static/js/javascript-detection.js +++ b/gitweb/static/js/javascript-detection.js @@ -16,10 +16,10 @@ * and other reasons to not add 'js=1' param at the end of link * @constant */ -var jsExceptionsRe = /[;?]js=[01](#.*)?$/; +var jsExceptionsRe = /(^javascript:)|([;?]js=[01](#.*)?$)/; /** - * Add '?js=1' or ';js=1' to the end of every link in the document + * Add '?js=1' or ';js=1' to the end of every non-javascript link in the document * that doesn't have 'js' query parameter set already. * * Links with 'js=1' lead to JavaScript version of given action, if it -- 2.11.4.GIT