Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • briar briar
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 783
    • Issues 783
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 9
    • Merge requests 9
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • briar
  • briarbriar
  • Issues
  • #786

Closed
Open
Created Nov 29, 2016 by akwizgran@akwizgranOwner

Handle whitespace consistently

Text with leading or trailing whitespace is treated inconsistently:

  • Nicknames: whitespace isn't trimmed, whitespace-only names are allowed
  • Private messages: whitespace is trimmed, whitespace-only messages are allowed but become empty after trimming
  • Forum names: whitespace isn't trimmed, whitespace-only names are allowed
  • Forum invitations: whitespace isn't trimmed, whitespace-only messages are allowed
  • Forum posts: whitespace is trimmed, whitespace-only posts aren't allowed
  • Private group names: whitespace isn't trimmed, whitespace-only names are allowed
  • Private group invitations: whitespace isn't trimmed, whitespace-only messages are allowed
  • Private group posts: whitespace is trimmed, whitespace-only posts aren't allowed
  • Blog posts: whitespace is trimmed, whitespace-only posts are allowed but become empty after trimming
  • Blog comments: whitespace isn't trimmed, whitespace-only comments are allowed

Let's do the following everywhere:

When entering text:

  1. Trim leading and trailing whitespace
  2. If the trimmed text is empty and the input is optional (for example a blog comment), pass null to the backend
  3. If the trimmed text is empty and the input isn't optional (for example a blog post), don't accept the input
  4. If the trimmed text is too long, don't accept the input
  5. If the trimmed text isn't empty or too long, pass it to the backend

When validating messages (including author names and group names):

  1. Reject null if the text isn't optional
  2. Reject the text if it's empty or too long
  3. Reject the text if it has leading or trailing whitespace
Assignee
Assign to
Time tracking