Special characters in project names are replaced on project members page

Bug

Summary

If your project name contains a special character (not A-Z, a-z, 0-9), these characters are replaced by - on project members page.

Steps to reproduce

Create a new project on GitLab.com and set a project name which contains a special character (e.g. German Umlaute). Go to Settings and Members. All special characters of your project name will be replaced by -.

What is the current bug behavior?

Special characters are replaced by -.

What is the expected correct behavior?

Project name should not be modified.

Relevant logs and/or screenshots

gitlab-issue-prjnamespechar

As you can see, Persönlich is shown correctly in the navigation bar but it replaced by Pers-nlich on the project members page itself.

Checks and environments

Reproduced on GitLab.com and GitLab CE Docker 11.8.1-ce.0. Seems to affect any current GitLab version.

Fix

The unwanted replacement is caused by the usage of sanitize_project_name(name) which will call gsub(/[^\w\-]/, '-'). This function is mainly used by project import processes. With 277ad219 the project members page was prepared for localization and the usage of sanitize_project_name(name) was introduced.

IMHO it makes no sense to sanitize the project name in this case, so one can remove these function calls.

This only affects the following files (Search):

  • app/views/projects/project_members/_groups.html.haml
  • app/views/projects/project_members/_team.html.haml
  • app/views/projects/project_members/index.html.haml

See upcoming MR.


/cc @gtsiolis (introduced changes)
/cc @filipa (GitLab CE Frontend expert)