Uploaded image for project: 'Service Packs and Hot Fixes'
  1. Service Packs and Hot Fixes
  2. MNT-11871

Adding tag with name containing new lines (\n) breaks the tagging service.

    Details

    • Type: Service Pack Request
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: 4.1
    • Fix Version/s: 4.2.4
    • Component/s: Tags and Categories
    • Labels:
      None

      Description

      If tag having name containing a (\n) is created then the tags are not visible any more on the left panel in SHARE under the “Tags” root.

      How to reproduce:

      1) In SHARE insure that you have a site called “test” created.
      2) Upload the attached webscript “support2”
      3) Execute the webscript “http://localhost:8080/alfresco/service/support2
      4) Browse to ore refresh page using SHARE in root of document library of TEST.

      Observed result:

      The elements under Tags” is empty and will stay empty.
      The attached exception is raised, see exception.txt

      Hints:
      -The problem is that a tagService allows tag names using \n, see support2.get.js attached. Once \n is there it is written to a content property used by “TaggingServiceImpl”. “TaggingServiceImpl” expect lines having following structure: “tag name|count\n”. If tag name contains “\n” it is not the case any more, and it generates “java.lang.ArrayIndexOutOfBoundsException”.

      -Would it not be better to trigger an exception when “addTag(tagname)” is called with a “tagname” containing “\n”. By doing so it would prevent the problem to occur.

        Attachments

        1. support2.get.js
          0.2 kB
        2. support2.get.html.ftl
          0.0 kB
        3. support2.get.desc .xml
          0.2 kB
        4. exception.txt
          31 kB

          Structure

            Activity

              People

              • Assignee:
                closedbugs Closed Bugs (Inactive)
                Reporter:
                pdubois Philippe Dubois [X] (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day, 5 hours
                  1d 5h

                    Structure Helper Panel