Skip to content

Commit abeca29

Browse files
authored
Merge pull request #259 from Handig-Eekhoorn/cssurl-quotes
CSSUrl, remove quotes from the URL kept in .value
2 parents 73dc4cf + ce74bc5 commit abeca29

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

org/w3c/css/values/CssURL.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,18 @@ public void set(String s, ApplContext ac, URL base)
8888
String urlname = s.substring(4, s.length() - 1).trim();
8989
this.base = base;
9090

91+
urlname = urlname.trim();
92+
if (urlname.isEmpty()){
93+
// okay, no further modifications needed
94+
}else if (urlname.charAt(0)=='"' || urlname.charAt(0)=='\''){
95+
final int l = urlname.length()-1;
96+
if (urlname.charAt(0)==urlname.charAt(l)){
97+
urlname = urlname.substring(1, l);
98+
}else{
99+
throw new InvalidParamException("url", s, ac);
100+
}
101+
}
102+
91103
value = filterURLData(urlname);
92104
full = null;
93105
if (!urlHeading.startsWith("url"))

0 commit comments

Comments
 (0)