Class URLValidator


  • @Scriptable
    public final class URLValidator
    extends Object
    • Method Detail

      • isSafeWebUrl

        public static boolean isSafeWebUrl​(String p_strUrl)
        Calls isSafeWebUrl(String, boolean) with the second parameter set to false to disallow single quotes in the URL.
        Parameters:
        p_strUrl - The URL.
        Returns:
        true if the URL is considered safe, or false otherwise.
      • isSafeWebUrl

        public static boolean isSafeWebUrl​(String p_strUrl,
                                           boolean p_bAllowSingleQuotes)
        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, or https, or ftp, 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, or false otherwise.
        Returns:
        true if the URL is considered safe, or false otherwise.