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
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 3376572-6.patch | 1.8 KB | lendude |
| #6 | 3376572-6-TEST_ONLY.patch | 1.08 KB | lendude |
Comments
Comment #2
fnalb2 commentedComment #3
cilefen commentedThe proposed resolution is the same as the current code. Can you explain in a little more detail please?
Comment #4
cilefen commentedComment #5
cilefen commentedOh, it is not the same. I see that now.
Comment #6
lendudeNice 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.
Comment #8
longwaveEven 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?
Comment #10
lauriiiCommitted edf79f6 and pushed to 11.x. Thanks!