torchbox / torchbox/wagtail-tinytableblock

Strip control characters

Open
#19 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
10
Forks
4
Avg merge
1h 4m
Merged PRs (30d)
1

Description

PostgreSQL (and most other C software) rejects null characters (\0) in strings because reasons.

We should strip out any unwanted control characters from input (most of the C0 and C1 ranges, excluding whitespace).

[!TIP]
To test via the browser, you can use this JS since I can't paste it as it will get removed/escaped.
Run this in the browser console on the edit page, then paste into the field:

copy("This is a null here -->\x00<---")

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue does not name a file or test; start at the edit-page input handling for the TinyMCE table block. Reproduce the problem with the provided browser-console string, then verify that unwanted C0 and C1 control characters are removed while whitespace remains.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, python
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.