- Issue created by @VitaliyB98
- Status changed to Needs review
over 1 year ago 9:28am 23 March 2023 - πΊπ¦Ukraine VitaliyB98
Improve provided test cases do not throw spell error
The last submitted patch, 5: 3349851-5.patch, failed testing. View results β
- Status changed to Needs work
over 1 year ago 2:07pm 23 March 2023 - πΊπΈUnited States smustgrave
There were some missing sections of the issue summary.
- π³π±Netherlands Lendude Amsterdam
Thanks for reporting this, easy enough to reproduce, doesn't lead to fatal errors even when saved, so not major.
So to me this seems about turning an ugly 'ERROR!!' into a descriptive error message.
The proposed fix uses PHP to validate the regex, but its send to the database, so ideally it should validate using the same regex library as the database uses.
MySQL uses the POSIX compliant regex library where PHP uses the Perl Compatible Regex library, so this could still give false positives and negatives I think? Might be over optimising.
Not great that this validation would use a global function, much rather have it on a class somewhere, but there doesn't seem to be a great place to put the validation function otherwise :(
- πΊπ¦Ukraine VitaliyB98
Agree with you, validation should use the same logic as MySQL use. But If someone needs some tricks, I provided it in the patch bellow: