Package de.uplanet.util
Class URLValidator
java.lang.Object
de.uplanet.util.URLValidator
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isSafeWebUrl
(String p_strUrl) CallsisSafeWebUrl(String, boolean)
with the second parameter set tofalse
to disallow single quotes in the URL.static boolean
isSafeWebUrl
(String p_strUrl, boolean p_bAllowSingleQuotes) Check if the given URL is a safe URL in Intrexx' sense.
-
Method Details
-
isSafeWebUrl
CallsisSafeWebUrl(String, boolean)
with the second parameter set tofalse
to disallow single quotes in the URL.- Parameters:
p_strUrl
- The URL.- Returns:
true
if the URL is considered safe, orfalse
otherwise.
-
isSafeWebUrl
Check if the given URL is a safe URL in Intrexx' sense.The URL must meet the following conditions to be considered a safe Web ULR:
- The URL must only contain characters allowed by the spec (http://tools.ietf.org/html/rfc3986).
- The URL must not contain numeric or named HTML character references.
- The scheme must be either
http
, orhttps
, orftp
, or the URL must be a relative URL. - If the URL is absolute it must have an authority part.
- If the URL is relative it must not have an authority part.
- Parameters:
p_strUrl
- The URL.p_bAllowSingleQuotes
-true
if single quotes are allowed to occur in the attribute value, orfalse
otherwise.- Returns:
true
if the URL is considered safe, orfalse
otherwise.
-