decaporg / decaporg/decap-cms

Quotes or single quotes are not escaped in filenames

Open
#4,707 6 comments 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
JavaScript
Stars
19.4k
Forks
3.1k
Avg merge
1d 14h
Merged PRs (30d)
9

Description

**Describe the bug**
Saving collections where the title has quotes or single quotes in it while in the editorial workflow leaves quotes/single quotes in the filename.

**To Reproduce**
1. Have the publish mode be editorial_workflow
2. Have a title field
3. Use a title with quotes or single quotes
4. Save

**Expected behavior**
A file should be created with a slug that does not contain the double quotes or single quotes

**Applicable Versions:**

- netlify-cms-app 2.14.4
- netlify-cms-core 2.36.3
- netlify-cms 2.10.74

- Git provider: GitLab
- OS: Windows 10
- Browser version Edge Version 87.0.664.57 (Official build) (64-bit)

**CMS configuration**
```
backend:
name: gitlab
repo: my-group/my-proj
auth_type: implicit
app_id: xxx

site_url: https://www.example.com
logo_url: https://www.example.com/logo.png
media_folder: "static/cms-uploads"
public_folder: "/cms-uploads"
show_preview_links: false
publish_mode: editorial_workflow

collections:
- name: "posts"
label: "Posts"
label_singular: Post
description: "Blah blah"
editor:
preview: false
format: "json"
folder: "cms/blog"
create: true
slug: "{{slug}}"
fields:
- {label: "Title", name: "title", widget: "string"}
- {label: "Publish Date", name: "date", widget: "date"}
- {label: "Image", name: "image", widget: "image", allow_multiple: false, required: false, hint: "This will be the header image for the post"}
- {label: "Body", name: "body", widget: "markdown"}
- {label: "Meta Title", name: "metaTitle", widget: "text", required: false, hint: "This will default to the title of the post"}
- {label: "Meta Description", name: "metaDescription", widget: "text", required: false, hint: "This will default to a preview from the post (about the first 250 characters)"}
```

**Additional context**
I use the same config file without `publish_mode: editorial_workflow` for other sites, and files with quotes/single quotes are saved correctly.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.