com.google.clearsilver.jsilver.functions.html
Class CssUrlValidateFunction
java.lang.Object
com.google.clearsilver.jsilver.functions.html.BaseUrlValidateFunction
com.google.clearsilver.jsilver.functions.html.CssUrlValidateFunction
- All Implemented Interfaces:
- TextFilter
public class CssUrlValidateFunction
- extends BaseUrlValidateFunction
Validates that input string is a valid URI. If it is not valid, the string #
is returned.
If it is valid, the characters [\n\r\\'"()<>*] are URL encoded to ensure the string can be safely
inserted in a CSS URL context. In particular:
- In an '@import url("URL");' statement
- In a CSS property such as 'background: url("URL");'
In both cases, enclosing quotes are optional but parenthesis are not. This filter ensures that
the URL cannot exit the parens enclosure, close a STYLE tag or reset the browser's CSS parser
(via comments or newlines).
References:
- CSS 2.1 URLs: http://www.w3.org/TR/CSS21/syndata.html#url
- CSS 1 URLs: http://www.w3.org/TR/REC-CSS1/#url
- See Also:
BaseUrlValidateFunction
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CssUrlValidateFunction
public CssUrlValidateFunction()
applyEscaping
protected void applyEscaping(String in,
Appendable out)
throws IOException
- Description copied from class:
BaseUrlValidateFunction
- Called by
filter
after verifying that the input is a valid URI. Should apply any
appropriate escaping to the input string.
- Specified by:
applyEscaping
in class BaseUrlValidateFunction
- Throws:
IOException
Copyright © 2010-2012 Google. All Rights Reserved.