Provide validation for regex patterns filter operation

Created on 23 March 2023, over 1 year ago
Updated 29 March 2023, over 1 year ago

Problem/Motivation

In case when the user use 'Regex expression' operator for StringFilter or NumericFilter, it could be a MySQL error when someone passes an invalid regex pattern. For example when user passes '*' symbol in filter which use 'Regex expression': Drupal\Core\Database\DatabaseExceptionWrapper: Exception in ********: SQLSTATE[42000]: Syntax error or access violation: 1139 Got error 'nothing to repeat at offset 0' from regexp

Steps to reproduce

1. Add a Numeric or String exposed filter to the view.
2. Configure the 'Regular expression' operator for the filter.
3. Pass invalid regex (for example "*") into the filter.

Proposed resolution

TBD

Remaining tasks

Update issue summary
Review

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Needs work

Version

10.1 ✨

Component
ViewsΒ  β†’

Last updated about 2 hours ago

Created by

πŸ‡ΊπŸ‡¦Ukraine VitaliyB98

Live updates comments and jobs are added and updated live.
  • views

    Involves, uses, or integrates with views. In Drupal 8 core, use the β€œVDC” tag instead.

  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024