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
I don't understand well, so please someone tell me.
In Route.zep, "/:action" is replaced with "/([\\w0-9\\_\\-]+)" and used as a regular expression pattern.
In Router.zep, "#^/([\\w0-9\\_\\-]+)/([\\w0-9\\.\\_]+)(/.*)*$ #u" is set as default.
And in the manual (maybe it's not v5 official yet) the safe pattern is /([a-zA-Z0-9\_\-]+).
(Note: Most characters within a PHP character class have no meaning, so I don't think you need to escape either the _ or the last character in the character class -.)
Maybe the regex in Zephir is different than in PHP, but isn't \w generally equivalent to a-zA-Z0-9_ ?
Why are 0-9 and _ duplicated?
And why does Router.zep include . and not - in the action part registered as the default pattern?
Why isn't it standardized across Phalcon?
Also, the controller is auto-replaced with PascalCase(="upper"camelCase), but no action is processed.
I think it's causing trouble for it to accept . _ as the default pattern.
(So, the above "standardized " is problematic)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I don't understand well, so please someone tell me.
In Route.zep,
"/:action"
is replaced with"/([\\w0-9\\_\\-]+)"
and used as a regular expression pattern.In Router.zep,
"#^/([\\w0-9\\_\\-]+)/([\\w0-9\\.\\_]+)(/.*)*$ #u"
is set as default.And in the manual (maybe it's not v5 official yet) the safe pattern is
/([a-zA-Z0-9\_\-]+)
.(Note: Most characters within a PHP character class have no meaning, so I don't think you need to escape either the _ or the last character in the character class -.)
Maybe the regex in Zephir is different than in PHP, but isn't
\w
generally equivalent toa-zA-Z0-9_
?Why are
0-9
and_
duplicated?And why does Router.zep include
.
and not-
in the action part registered as the default pattern?Why isn't it standardized across Phalcon?
Also, the controller is auto-replaced with PascalCase(="upper"camelCase), but no action is processed.
I think it's causing trouble for it to accept
. _
as the default pattern.(So, the above "standardized " is problematic)
Beta Was this translation helpful? Give feedback.
All reactions