contao / contao-manager

Contao Manager
GNU Lesser General Public License v3.0
85 stars 33 forks source link

Irregular regexp: invalid character in class in regular expression #821

Closed math-GH closed 1 month ago

math-GH commented 1 month ago

Contao Manager 1.8.6

<input pattern='^([^:]+)://(([^:@]+)(:([^@]+))?@)?([^:/]+(:[0-9]+)?)/([^?]+)(\?.+)?$'> kann nicht überprüft werden, da das Muster keine gültige Regexp ist: invalid character in class in regular expression [chunk-vendors.d5895f06.js:26:58062](..../contao-manager.phar.php/js/chunk-vendors.d5895f06.js)

grafik

zoglo commented 1 month ago

I stumbled upon this when creating the tool for the docs 👍 https://github.com/contao/docs/blob/4e99fef22a8076bbdea1a8cc6caee7e01b3459a2/page/static/js/tools.js#L10

Should be this on the JS side: (check the double escaping at the end)

- ^([^:]+)://(([^:@]+)(:([^@]+))?@)?([^:/]+(:[0-9]+)?)/([^?]+)(\?.+)?$
+ ^([^:]+)://(([^:@]+)(:([^@]+))?@)?([^:/]+(:[0-9]+)?)/([^?]+)(\\?.+)?$
aschempp commented 1 month ago

Fixed in e36a1402a7b7b41e8c64a773ec153ea90e9ef510