apostrophe-forms-regexp-text-field-widgets

1.0.0 • Public • Published

This module adds a new type of text field that allows the admin to specify their own regular expression. It is meant for use alongside the apostrophe-forms module.

Configuration

// in app.js
modules: {
  'apostrophe-forms': {
    formWidgets: {
      // other fields go here
      'apostrophe-forms-regexp-text-field': {}
    }
  },
  'apostrophe-forms-regexp-text-field-widgets'
}

Preventing DOS (Denial of Service) attacks

Since many regular expressions can run for hours on malicious input, which could completely block the site, this module uses the time-limited-regular-expressions module to limit the runtime to one-quarter second. This will not be an issue on reasonable input. If you do get a timeout message when testing your form, you should write a more efficient regular expression.

/apostrophe-forms-regexp-text-field-widgets/

    Package Sidebar

    Install

    npm i apostrophe-forms-regexp-text-field-widgets

    Weekly Downloads

    2

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    8.18 kB

    Total Files

    10

    Last publish

    Collaborators

    • haroun
    • itsrogil
    • triskuit
    • bodonkey
    • etlaurent
    • alexgilbert
    • stuartromanek
    • boutell
    • alexbea
    • gregvanbrug
    • valjed
    • romanek