Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-118

[lang] StringEscapeUtils.unescapeHtml() doesn't handle hex entities

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0
    • 2.1
    • None
    • None
    • Operating System: All
      Platform: PC

    • 25227

    Description

      Pass a string into the unescapeHtml() method that contains a hex entity (i.e.
      · instead of ·) and you will get a NumberFormatException. The
      offending code is in Entity.java, line 690. It should check whether the
      character after the # is 'x' and if so, prefix it with '0' and call
      Integer.decode().intValue() (or some other hex converting function).

      Hex entities are valid HTML
      (http://www.htmlhelp.com/reference/html40/entities/latin1.html) so this should
      be supported.

      Attachments

        Activity

          People

            Unassigned Unassigned
            mgiles@visionstudio.com Michael Giles
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: