From 2b71bba8db13045e379d2f4f97930bc42ed13b26 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Wed, 18 Aug 2021 12:29:50 +0200 Subject: [PATCH] LSurl::add_handler: fix handling all params in case of multiple patterns --- src/includes/class/class.LSurl.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/includes/class/class.LSurl.php b/src/includes/class/class.LSurl.php index 75a4a939..f84a725a 100644 --- a/src/includes/class/class.LSurl.php +++ b/src/includes/class/class.LSurl.php @@ -33,21 +33,20 @@ class LSurl extends LSlog_staticLoggerClass { /* * Configured URL patterns : * - * array ( - * '[URL pattern]' => '[handler]', - * [...] - * ) - * - * Example : + * Example : * * array ( * '|get/(?P[a-zA-Z0-9]+)$|' => array ( * 'handler' => 'get', * 'authenticated' => true, + * 'api_mode' => false, + * 'methods' => array('GET'), * ), * '|get/all$|' => => array ( * 'handler' => 'get_all', * 'authenticated' => true, + * 'api_mode' => false, + * 'methods' => array('GET', 'POST'), * ), * ) * @@ -72,10 +71,10 @@ class LSurl extends LSlog_staticLoggerClass { if (is_array($pattern)) { if (is_null($handler)) 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 foreach($pattern as $p) - self :: add_handler($p, $handler, $override, $api_mode, $methods); + self :: add_handler($p, $handler, $authenticated, $override, $api_mode, $methods); } else { if (!isset(self :: $patterns[$pattern])) {