X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FPathRouter.php;h=eb52d7cd23d9ce415aea7afdaf93b69e1053ba32;hb=aeea6c552032ceb7ee3b21a17556d90bb5764cdd;hp=faf4db4f623744aae48cccd77c595dadc927f4a5;hpb=d80a3827ab6e1ab00cb6ac8dd329ed43ae015353;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/PathRouter.php b/includes/PathRouter.php index faf4db4f62..eb52d7cd23 100644 --- a/includes/PathRouter.php +++ b/includes/PathRouter.php @@ -133,10 +133,8 @@ class PathRouter { // Loop over our options and convert any single value $# restrictions // into an array so we only have to do in_array tests. foreach ( $options as $optionName => $optionData ) { - if ( preg_match( '/^\$\d+$/u', $optionName ) ) { - if ( !is_array( $optionData ) ) { - $options[$optionName] = [ $optionData ]; - } + if ( preg_match( '/^\$\d+$/u', $optionName ) && !is_array( $optionData ) ) { + $options[$optionName] = [ $optionData ]; } } @@ -252,7 +250,7 @@ class PathRouter { // array() (a match with no data) but our WebRequest caller // expects array() even when we have no matches so return // a array() when we have null - return is_null( $matches ) ? [] : $matches; + return $matches ?? []; } /**