Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-24010

unEscapeHTML method does not

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: CLOSED
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.8.0
    • Fix Version/s: None
    • Component/s: BasicLTI
    • Labels:
    • Environment:
      Static code review against trunk
    • Previous Issue Keys:
      BLTI-40

      Description

      The following method is essentially valueless and perhaps is never called.

      */
      497 public static String unEscapeHtml(String value)
      498

      { 499 if (value == null) return ""; 500 if (value.equals("")) return ""; 501 value.replaceAll("<", "<"); 502 value.replaceAll(">", ">"); 503 value.replaceAll("&", "&"); 504 value.replaceAll(""", "\""); 505 return value; 506 }

      replaceAll returns an immutable result and does not change value. Therefore the return value is never changed unless it is null and then it is replaced with an empty string.

      To correct

      value= value.replaceAll(""", "\"");

      etc

      http://qa1-nl.sakaiproject.org/codereview/trunk/api/org/sakaiproject/portlet/util/FormattedText.java.html#501

      Further, looking in the source we have two methods with the same intent and name. The second class does not have this failure.
      ./basiclti/portlet-util/src/java/org/sakaiproject/portlet/util/FormattedText.java
      ./kernel/kernel-util/src/main/java/org/sakaiproject/util/FormattedText.java

        Gliffy Diagrams

          Zeplin

            Attachments

              Activity

                People

                Assignee:
                csev Charles Severance
                Reporter:
                a.m.berg@uva.nl Alan Berg
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    Git Integration