Problem/Motivation

The character class "[a-zA-z]" have a spelling mistake.
[A-z] = A-Z, [, \, ], ^, _, ', a-z (ASCII 65-122).

Steps to reproduce

File: core/modules/views/src/Plugin/views/sort/SortPluginBase.php

line: 233
if (!preg_match('/^[a-zA-z][a-zA-Z0-9_~.\-]*$/', $field_identifier)) {

Proposed resolution

If it is a spelling mistake:

line: 233
if (!preg_match('/^[a-zA-Z][a-zA-Z0-9_~.\-]*$/', $field_identifier)) {

Remaining tasks

no

User interface changes

no

API changes

no

Data model changes

no

Release notes snippet

CommentFileSizeAuthor
#6 3376572-6.patch1.8 KBlendude
#6 3376572-6-TEST_ONLY.patch1.08 KBlendude

Comments

fnalb2 created an issue. See original summary.

cilefen’s picture

Status: Active » Postponed (maintainer needs more info)

The proposed resolution is the same as the current code. Can you explain in a little more detail please?

cilefen’s picture

Component: plugin system » views.module
cilefen’s picture

Status: Postponed (maintainer needs more info) » Active

Oh, it is not the same. I see that now.

lendude’s picture

Status: Active » Needs review
Issue tags: -preg_match
StatusFileSize
new1.08 KB
new1.8 KB

Nice catch!

Test and fix.

Should we do an upgrade path for this and fix any faulty identifiers? Feels excessive. If it's currently broken and not working and they left it in, who are we to change it.

The last submitted patch, 6: 3376572-6-TEST_ONLY.patch, failed testing. View results

longwave’s picture

Status: Needs review » Reviewed & tested by the community

Even if we did an upgrade path, not sure what we could do as we might break something if we automatically correct it. Better that it stays invalid until they next try to update the view?

  • lauriii committed edf79f67 on 11.x
    Issue #3376572 by Lendude, fnalb2, cilefen, longwave: SortPluginBase.php...
lauriii’s picture

Status: Reviewed & tested by the community » Fixed

Committed edf79f6 and pushed to 11.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.