Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Router RegEx not working. #3169

Closed
mmrtonmoybd opened this issue Jun 26, 2020 · 4 comments
Closed

Router RegEx not working. #3169

mmrtonmoybd opened this issue Jun 26, 2020 · 4 comments
Labels
bug Verified issues on the current code behavior or pull requests that will fix them

Comments

@mmrtonmoybd
Copy link
Contributor

mmrtonmoybd commented Jun 26, 2020

RegEx not working in router. I use this
[a-z0-9\x{0980}-\x{09ff}-]+$/u
RegEx but Codeigniter throw a error out over of range system/Router/Router.php on line 425

@michalsn
Copy link
Member

Sorry, but we don't allow to set regex flags or delimiters. But I guess we should support u by default.

@michalsn michalsn added the bug Verified issues on the current code behavior or pull requests that will fix them label Jun 26, 2020
@mmrtonmoybd
Copy link
Contributor Author

Sorry, but we don't allow to set regex flags or delimiters. But I guess we should support u by default.

Thank you now it's working and router RegEx now support Unicode.

@michalsn
Copy link
Member

I'm reopening this issue since it's not resolved yet.

@mmrtonmoybd it would be great if you could check #3172 and see if it works as it should.

@michalsn michalsn reopened this Jun 27, 2020
@michalsn
Copy link
Member

I just checked it and it works fine. I added a test for this to make sure.

I believe your definition for placeholder is incorrect. Try this one:

$routes->addPlaceholder(':category', '[a-z\x{0980}-\x{09ff}-]+');
$routes->addPlaceholder(':pslug', '[a-zA-Z0-9\x{0980}-\x{09ff}-]+');

$routes->add('(:category)/(:pslug)', 'Single::index/$1/$2');

@MGatner MGatner closed this as completed in 538ebe4 Jul 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

No branches or pull requests

2 participants