Add validation constraint to `type: label` + `type: text`: disallow control characters

Created on 3 August 2023, over 1 year ago
Updated 17 August 2023, over 1 year ago

Problem/Motivation

📌 Add validation constraint to `type: label`: disallow multiple lines Fixed added a basic constraint to type: label: disallowing multiple lines.

But … do we really want to allow any single-line string? 🤔 For example: do we want invisible control characters (think \x08 for "backspace": https://www.asciitable.com/) to be accepted?

Same thing for type: text, which is the multi-line sibling of type: label.

Steps to reproduce

N/A

Proposed resolution

  1. Disallow invisible control characters. PHP's regular expression library has a handy syntax for this: \PC. See https://stackoverflow.com/a/66587087.
  2. With the exception of:
    1. \n (*nix line endings, part of Windows line endings)
    2. \r (old macOS line endings, part of Windows line endings)
    3. \t (tabs, cannot be entered via the browser, but are harmless and could conceivably be added when modifying config outside a browser context)

Remaining tasks

TBD

User interface changes

None.

API changes

None.

Data model changes

Labels and text in config will be guaranteed to be both sensible and safe if the config has been validated: no invisible control characters present, besides \r, \n and \t.

Release notes snippet

None.

📌 Task
Status

Fixed

Version

11.0 🔥

Component
Typed data 

Last updated 16 days ago

  • Maintained by
  • 🇦🇹Austria @fago
Created by

🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024