Skip to content

Smart single quote not removed from slug creation #8844

@odeland

Description

@odeland

Bug description

When you enter a single smart quote (’) in an entry's title, the slug generated contains a single straight quote, which is not a valid character for a slug.

Smart double quotes (") are properly removed.

How to reproduce

  1. Create a new entry. (https://demo.statamic.com/cp/collections/news/entries/create/default)
  2. Copy-paste the title with a smart quote in it. (GTA Online’s latest news: “huge map”)
  3. Notice the generated slug (gta-online's-latest-news-huge-map) has removed the smart double quotes, but converted the single smart quote to a straight single quote, which is not a valid character for a slug. It should have been removed completely.
  4. Try to save, you get a validation error. (May only contain letters, numbers, dashes and underscores.)

Logs

No response

Environment

Environment
Application Name: Statamic
Laravel Version: 9.52.16
PHP Version: 8.1.12
Composer Version: 2.5.8
Environment: local
Debug Mode: ENABLED
URL: statamic.local
Maintenance Mode: OFF

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: statamic
Database: mysql
Logs: stack / single
Mail: smtp
Queue: sync
Session: file

Statamic
Addons: 3
Antlers: runtime
Stache Watcher: Disabled
Static Caching: Disabled
Version: 4.24.0 PRO

Statamic Addons
aerni/social-links: 3.1.0
jacksleight/statamic-bard-mutator: 2.3.0
withcandour/aardvark-seo: 3.0.0

Installation

Fresh statamic/statamic site via CLI

Antlers Parser

regex (default)

Additional details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions