Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-27453

StringUtil.shorten method doesn't work properly

    Details

      Description

      Try the following test case:
      StringUtil.shorten("Inspire Designer Related - Inspire Content Manager Web Installation Guide 8.0", 75, "...");
      It shortens the title to:
      Inspire Designer Related - Inspire Content Manager Web Installation Guide...
      Which is actually 76 characters long.
      It is caused by this code:
      http://svn.liferay.com/repos/public/portal/trunk/portal-service/src/com/liferay/portal/kernel/util/StringUtil.java

      there should be for (int j = (length - suffix.length()); j >= 0; j--) {
      instead of for (int j = length; j >= 0; j--) {

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              michael.saechang Michael Saechang
              Reporter:
              honyk Jan Tošovský
              Participants of an Issue:
              Recent user:
              Esther Sanz
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                9 years, 6 weeks, 6 days ago

                  Packages

                  Version Package
                  6.1.1 CE GA2
                  6.1.20 EE GA2
                  --Sprint 11/12
                  6.2.0 CE M2