Skip to content
GitLab
Next
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    Projects Groups Topics Snippets
  • Register
  • Sign in
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 57k
    • Issues 57k
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1.8k
    • Merge requests 1.8k
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Terraform modules
    • Model experiments
  • Monitor
    • Monitor
    • Tracing
    • Incidents
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • GitLabGitLab
  • Issues
  • #361722

Broken activity feed when image or line break used in comment

Summary

When someone posts a comment containing a line break, the produced Atom feed will be invalid.

Steps to reproduce

  1. Send a comment to containing either foo\
    bar
    or foo<br>bar to an issue.
  2. Visit project’s Activities Atom feed.

Example Project

Check https://gitlab.com/jtojnar/extensions.atom for example, which is broken by the first comment jtojnar/extensions#1.

What is the current bug behavior?

The feed will contain a literal <br> element, breaking the Atom feed.

What is the expected correct behavior?

The feed should contain a valid XML code.

Output of checks

This bug happens on GitLab.com

Possible fixes

See https://validator.w3.org/feed/docs/atom.html#text:

  • The input needs to be sanitized to be valid XML if we want to use type=xhtml,
  • or switch to type=html and
    • either escape the HTML code,
    • or wrap it with CDATA.
Edited Aug 29, 2022 by Jan Tojnar
Assignee
Assign to
Time tracking