mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-17 15:59:06 +01:00
LSurl::add_handler: fix handling all params in case of multiple patterns
This commit is contained in:
parent
2fa20316bc
commit
2b71bba8db
1 changed files with 7 additions and 8 deletions
|
@ -33,21 +33,20 @@ class LSurl extends LSlog_staticLoggerClass {
|
||||||
/*
|
/*
|
||||||
* Configured URL patterns :
|
* Configured URL patterns :
|
||||||
*
|
*
|
||||||
* array (
|
* Example :
|
||||||
* '[URL pattern]' => '[handler]',
|
|
||||||
* [...]
|
|
||||||
* )
|
|
||||||
*
|
|
||||||
* Example :
|
|
||||||
*
|
*
|
||||||
* array (
|
* array (
|
||||||
* '|get/(?P<name>[a-zA-Z0-9]+)$|' => array (
|
* '|get/(?P<name>[a-zA-Z0-9]+)$|' => array (
|
||||||
* 'handler' => 'get',
|
* 'handler' => 'get',
|
||||||
* 'authenticated' => true,
|
* 'authenticated' => true,
|
||||||
|
* 'api_mode' => false,
|
||||||
|
* 'methods' => array('GET'),
|
||||||
* ),
|
* ),
|
||||||
* '|get/all$|' => => array (
|
* '|get/all$|' => => array (
|
||||||
* 'handler' => 'get_all',
|
* 'handler' => 'get_all',
|
||||||
* 'authenticated' => true,
|
* 'authenticated' => true,
|
||||||
|
* 'api_mode' => false,
|
||||||
|
* 'methods' => array('GET', 'POST'),
|
||||||
* ),
|
* ),
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
|
@ -72,10 +71,10 @@ class LSurl extends LSlog_staticLoggerClass {
|
||||||
if (is_array($pattern)) {
|
if (is_array($pattern)) {
|
||||||
if (is_null($handler))
|
if (is_null($handler))
|
||||||
foreach($pattern as $p => $h)
|
foreach($pattern as $p => $h)
|
||||||
self :: add_handler($p, $h, $override, $api_mode, $methods);
|
self :: add_handler($p, $h, $authenticated, $override, $api_mode, $methods);
|
||||||
else
|
else
|
||||||
foreach($pattern as $p)
|
foreach($pattern as $p)
|
||||||
self :: add_handler($p, $handler, $override, $api_mode, $methods);
|
self :: add_handler($p, $handler, $authenticated, $override, $api_mode, $methods);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!isset(self :: $patterns[$pattern])) {
|
if (!isset(self :: $patterns[$pattern])) {
|
||||||
|
|
Loading…
Reference in a new issue