mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

kenneth_suter
12.41.2007 6452a0b512de72a2beb6da4a3f50fdc788a0f90f
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java
@@ -1419,9 +1419,18 @@
    if (len <= 0)
      return d;
    if (len > maxll) {
      int p = d.lastIndexOf(' ', maxll);
      if (p <= 0)
        p = d.indexOf(' ', maxll);
      int p = d.lastIndexOf(Constants.HTML_LINE_BREAK, maxll);
      if (p > 0 && p < len) {
        return d.substring(0, p + Constants.HTML_LINE_BREAK.length()) +
               breakHtmlString(
                       d.substring(p + Constants.HTML_LINE_BREAK.length()),
                       maxll);
      } else {
        p = d.lastIndexOf(' ', maxll);
        if (p <= 0) {
          p = d.indexOf(' ', maxll);
        }
      }
      if (p > 0 && p < len) {
        return d.substring(0, p) +
                Constants.HTML_LINE_BREAK +
@@ -1435,6 +1444,25 @@
  }
  /**
   * Strips any potential HTML markup from a given string.
   * @param s string to strip
   * @return resulting string
   */
  static public String stripHtml(String s) {
    String o = null;
    if (s != null) {
      // This is not a comprehensive solution but addresses
      // the few tags that we have in Resources.properties
      // at the moment.  See test class for cases that might
      // cause problems.
      o = s.replaceAll("\\<.*?\\>","");
    }
    return o;
  }
  /**
   * Tests a text string to see if it contains HTML.
   * @param text String to test
   * @return true if the string contains HTML