Class BambooStringUtils


  • public final class BambooStringUtils
    extends Object
    • Field Detail

      • XSS_RELATED_CHARACTERS

        public static final char[] XSS_RELATED_CHARACTERS
      • RELAXED_XSS_RELATED_CHARACTERS

        public static final char[] RELAXED_XSS_RELATED_CHARACTERS
      • SHELL_INJECTION_RELATED_CHARACTERS

        public static final char[] SHELL_INJECTION_RELATED_CHARACTERS
    • Method Detail

      • containsRelatedCharacters

        public static boolean containsRelatedCharacters​(@Nullable
                                                        @Nullable String string,
                                                        @NotNull
                                                        @org.jetbrains.annotations.NotNull char[] characters)
      • containsXssRelatedCharacters

        public static boolean containsXssRelatedCharacters​(@Nullable
                                                           @Nullable String string)
        Returns true if the supplied string contains characters that could be used to deface a page or trigger an XSS exploit (characters: "&'<>\).
        Parameters:
        string - string to check
        Returns:
        true if string contains unsafe characters, false otherwise
      • containsRelaxedXssRelatedCharacters

        public static boolean containsRelaxedXssRelatedCharacters​(@Nullable
                                                                  @Nullable String string)
        Relaxed xss check that allows \ character (mainly for repositories on Windows).
        Parameters:
        string - string to check
        Returns:
        true if string contains unsafe characters, false otherwise
      • containsShellInjectionRelatedCharacters

        public static boolean containsShellInjectionRelatedCharacters​(@Nullable
                                                                      @Nullable String string)