PUBLIC - Liferay Portal Community Edition
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-33399

incorrect Blog Atom/RSS encoding: Portal URL replacement done on text only

    Details

    • Type: Bug Bug
    • Status: Verified
    • Resolution: Unresolved
    • Affects Version/s: 6.1.1 CE GA2, 6.1.20 EE GA2
    • Fix Version/s: None
    • Labels:
      None
    • Fix Priority:
      3
    • Similar Issues:
      Show 5 results 

      Description

      Steps to reproduce:

      1. create a blog entry. Pretend you're blogging about HTML, use the following text:

      If you link to server-relative files you can do it like <a href="/some-file">this</a> or, with image, like <img src="/some-file.png"/> this

      (Note that this is the actual HTML text, not the source!)
      2. access the blog's RSS feed. The text you'll find in there (with the default "full content" displayed) is:

      If you link to server-relative files you can do it like <a href="http://localhost:8080/some-file">this</a> or, with image, like <img src="http://localhost:8080/some-file.png"/> this

      (or whatever your current portal URL is).

      The offending code is from BlogsEntryServiceImpl:

      if (displayStyle.equals(RSSUtil.DISPLAY_STYLE_ABSTRACT)) {
      	... // shortened
      }
      else if (displayStyle.equals(RSSUtil.DISPLAY_STYLE_TITLE)) {
      	value = StringPool.BLANK;
      }
      else {
      	value = StringUtil.replace(
      		entry.getContent(),
      		new String[] {
      			"href=\"/", "src=\"/"
      		},
      		new String[] {
      			"href=\"" + themeDisplay.getURLPortal() + "/",
      			"src=\"" + themeDisplay.getURLPortal() + "/"
      		});
      }

      i.e. blind replacement of the href and src sequences, no matter if they're markup or text.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            SE Support
            Reporter:
            Olaf Kock
            Recent user:
            Randy Zhu
            Participants of an Issue:
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Days since last comment:
              2 years, 12 weeks, 5 days ago

              Development

                Structure Helper Panel