You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Hello, we are working on a project where we have to search using arabic letters, when we have a uri like this one: "/client/محمد" the notFoundHandler get executed which means the route was not matched
To Reproduce
usePhalcon\Di\FactoryDefault;
usePhalcon\Mvc\Micro;
$container = newFactoryDefault();
$application = newMicro($container);
$application->get(
"/client/{search:\p{Xan}{0,20}}",
function ($search) {
echo"Welcome $search!";
}
);
$application->notFound(function () use ($application) {
echo"the route was not matched";
var_dump($application->router->getRoutes()[0]->getCompiledPattern());
});
$application->handle(urldecode($_SERVER["REQUEST_URI"]));
Expected behavior
given the regular expression we use, the route must match if the uri is "/client/محمد"
Details
Phalcon version:
phalcon
Phalcon is a full stack PHP framework, delivered as a PHP extension, offering lower resource consumption and high performance.
phalcon => enabled
Author => Phalcon Team and contributors
Version => 4.0.6
Build Date => Jun 12202008:14:19
Powered by Zephir => Version 0.12.17-6724dbf
Directive => Local Value => Master Value
phalcon.db.escape_identifiers => On => On
phalcon.db.force_casting => Off => Off
phalcon.orm.case_insensitive_column_map => Off => Off
phalcon.orm.cast_last_insert_id_to_int => Off => Off
phalcon.orm.cast_on_hydrate => Off => Off
phalcon.orm.column_renaming => On => On
phalcon.orm.disable_assign_setters => Off => Off
phalcon.orm.enable_implicit_joins => On => On
phalcon.orm.enable_literals => On => On
phalcon.orm.events => On => On
phalcon.orm.exception_on_failed_save => Off => Off
phalcon.orm.exception_on_failed_metadata_save => On => On
phalcon.orm.ignore_unknown_columns => Off => Off
phalcon.orm.late_state_binding => Off => Off
phalcon.orm.not_null_validations => On => On
phalcon.orm.update_snapshot_on_save => On => On
phalcon.orm.virtual_foreign_keys => On => On
phalcon.warning.enable => On => On
PHP Version:
PHP7.2.31 (cli) (built: Jun 9202015:16:26) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Xdebug v2.9.6, Copyright (c) 2002-2020, by Derick Rethans
/*** Replaces placeholders from pattern returning a valid PCRE regular expression*/publicfunction compilePattern(string! pattern) -> string
{
..................
// Check if the pattern has parentheses in order to add the regex delimiters
if memstr(pattern, "(") {
return"#^" . pattern . "$#u";
}
// Square brackets are also checkedifmemstr(pattern, "[") {
return"#^" . pattern . "$#u";
}
return pattern;
}
The text was updated successfully, but these errors were encountered:
Describe the bug
Hello, we are working on a project where we have to search using arabic letters, when we have a uri like this one: "/client/محمد" the notFoundHandler get executed which means the route was not matched
To Reproduce
Expected behavior
given the regular expression we use, the route must match if the uri is "/client/محمد"
Details
Kubuntu 18.04
Additional context
We took a look at the phalcon github repository and we found the compilePattern (string! pattern) function which is located in https://github.com/phalcon/cphalcon/blob/master/phalcon/Cli/Router/Route.zep does not add the unicode regex delimiters 'u',
however in older versions like https://github.com/phalcon/cphalcon/blob/3.4.x/phalcon/mvc/router/route.zep it does
The text was updated successfully, but these errors were encountered: