From 1111976a08d4f0957402a0cef434b7aa3ebf6c43 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Wed, 27 Feb 2008 16:00:13 +0000 Subject: [PATCH] added a syntax to prevent '.' escape. (#1227) git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@7224 71c3de6d-444a-0410-be80-ed276b4c234a --- .../security/GlobalMatrixAuthorizationStrategy.java | 2 +- .../GlobalMatrixAuthorizationStrategy/config.jelly | 11 +++-------- war/resources/scripts/hudson-behavior.js | 6 +++++- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/core/src/main/java/hudson/security/GlobalMatrixAuthorizationStrategy.java b/core/src/main/java/hudson/security/GlobalMatrixAuthorizationStrategy.java index 8608c0263c..f53f3dd83d 100644 --- a/core/src/main/java/hudson/security/GlobalMatrixAuthorizationStrategy.java +++ b/core/src/main/java/hudson/security/GlobalMatrixAuthorizationStrategy.java @@ -187,7 +187,7 @@ public class GlobalMatrixAuthorizationStrategy extends AuthorizationStrategy { String sid = r.getKey(); for(Map.Entry e : (Set>)r.getValue().entrySet()) { if(e.getValue()) { - Permission p = Permission.fromId(e.getKey().replace('-','.')); + Permission p = Permission.fromId(e.getKey()); gmas.add(p,sid); } } diff --git a/core/src/main/resources/hudson/security/GlobalMatrixAuthorizationStrategy/config.jelly b/core/src/main/resources/hudson/security/GlobalMatrixAuthorizationStrategy/config.jelly index 327eb28aad..269af5b8a7 100644 --- a/core/src/main/resources/hudson/security/GlobalMatrixAuthorizationStrategy/config.jelly +++ b/core/src/main/resources/hudson/security/GlobalMatrixAuthorizationStrategy/config.jelly @@ -8,12 +8,7 @@ - - + @@ -53,7 +48,7 @@ - + @@ -96,7 +91,7 @@ copy.removeAttribute("id"); copy.removeAttribute("style"); copy.firstChild.innerHTML = name; - copy.setAttribute("name",name); + copy.setAttribute("name",'['+name+']'); table.appendChild(copy); Behaviour.applySubtree(findAncestor(table,"TABLE")); }); diff --git a/war/resources/scripts/hudson-behavior.js b/war/resources/scripts/hudson-behavior.js index 0198b5fd69..1ec9074a47 100644 --- a/war/resources/scripts/hudson-behavior.js +++ b/war/resources/scripts/hudson-behavior.js @@ -955,8 +955,12 @@ function buildFormTree(form) { var doms = []; // DOMs that we added 'formDom' for. doms.push(form); - // abc.def.ghi -> ghi function shortenName(name) { + // [abc.def.ghi] -> abc.def.ghi + if(name.startsWith('[')) + return name.substring(1,name.length-1); + + // abc.def.ghi -> ghi var idx = name.lastIndexOf('.'); if(idx>=0) name = name.substring(idx+1); return name; -- GitLab