8000 Bard: Special characters cause binary encoded text when copying and pasting · Issue #11211 · statamic/cms · GitHub
[go: up one dir, main page]

Skip to content
Bard: Special characters cause binary encoded text when copying and pasting #11211
@mikemartin

Description

@mikemartin

Bug description

I've been creating blog posts which unfortunately involved a lot of copy and pasting. However I noticed afterwards that a lot of bard content paragraphs have been encoded as binary data.

text: !!binary VHJhbnNncmVzc2luZyBjb3Jwb3JhdGUgY29kZXMsIHRoZXkgaW52aXRlIHBlb3BsZSB0byBzdG9wLCBzaGVkIHRoZSBtb3JlIG11bmRhbmUgYXNwZWN0cyBvZiB0aGVpciBkYXktdG8tZGF5IGxpZmUgYW5kIGNvbm5lY3QgdG8gdGhlaXIgbWluZCBhbmQgYm9kaWVzLiBUb2dldGhlciwgdGhleSBlbWJvZHkgaW5ub3ZhdGlvbiBpbiB0aGlua2luZywgZW5naW5lZXJpbmcsIHNjYWxlLCBsaWdodCBhbmQgc291bmQsIGNyZWF0aW5nIGFuIGFsbW9zdCB0cmFuAnNjZW5kZW50YWwgZXhwZXJpZW5jZS4=

It seems that there are special characters in my text that are the cause.

Special characters:
’ (typographic apostrophe) – Appears twice.
\x02 (control character) – Appears once in the word "treatment."
– (en dash) – Appears once in the sentence with "two large-scale sculptures."

How to reproduce

This happens in a fresh statamic install.

  1. Install Statamic
  2. Create a blog entry
  3. Paste the problematic text into a bard field
  4. Inspect file contents to see !! binary encoded data.

Problematic text.
problematic.txt

Logs

No response

Environment

Environment
Application Name: Statamic
Laravel Version: 11.7.0
PHP Version: 8.2.25
Composer Version: 2.7.7
Environment: local
Debug Mode: ENABLED
URL: scratch.test
Maintenance Mode: OFF

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

Drivers
Broadcasting: log
Cache: file
Database: sqlite
Logs: stack / single
Mail: log
Queue: sync
Session: file

Statamic
Addons: 0
Sites: 1
Stache Watcher: Enabled
Static Caching: Disabled
Version: 5.40.0 PRO

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0