diff --git a/include/class_listing.inc b/include/class_listing.inc index e6fc0fcb85c11d30f0541eb40119293ee13b7f23..2a2276264a43f8bee0aad5cf00a13b4f20929f73 100644 --- a/include/class_listing.inc +++ b/include/class_listing.inc @@ -1110,16 +1110,13 @@ class listing /*! * \brief Filter link */ - function filterLink() + function filterLink($row, $dn, $mask, ...$vals) { - $row = func_get_arg(0); $pid = $this->pid; - $dn = func_get_arg(1); - $params = array(func_get_arg(2)); + $params = array($mask); // Collect sprintf params - for ($i = 3;$i < func_num_args();$i++) { - $val = func_get_arg($i); + foreach ($vals as $val) { if (empty($val)) { continue; } @@ -1138,7 +1135,7 @@ class listing $result = ' '; if (count($params) > 1) { - $trans = call_user_func_array('sprintf', $params); + $trans = sprintf(...$params); if ($trans != '') { return '<a href="?plug='.$_GET['plug'].'&PID='.$pid.'&act=listing_edit_'.$row.'" title="'.$dn.'">'.$trans.'</a>'; } diff --git a/include/class_template.inc b/include/class_template.inc index 0aaa6b6d3e06afdfe0e4a68b3404ca9287b1bfb9..f5897d3d73d75615f8faa5f26e33d2a21096794b 100644 --- a/include/class_template.inc +++ b/include/class_template.inc @@ -276,7 +276,7 @@ class template $specialAttrs['caller'.strtoupper($attr)] = $ui->$attr; } $this->attrs = templateHandling::parseArray($this->attrs, $specialAttrs); - $this->tabObject->adapt_from_template($this->attrs, call_user_func_array('array_merge', $this->attributes)); + $this->tabObject->adapt_from_template($this->attrs, array_merge(...$this->attributes)); $this->applied = TRUE; return $this->tabObject; diff --git a/include/class_templateHandling.inc b/include/class_templateHandling.inc index d149e0e788ac6d3896713ab33c38f085a094fcde..0fed84fa239133dfd9f2d171663fcf552c5244b8 100644 --- a/include/class_templateHandling.inc +++ b/include/class_templateHandling.inc @@ -176,7 +176,7 @@ class templateHandling unset($attrs[$attr]); } } - $dependencies = array_unique(call_user_func_array('array_merge', $flatdepends)); + $dependencies = array_unique(array_merge(...$flatdepends)); foreach ($dependencies as $attr) { if (empty($flatdepends[$attr])) { $needed[] = $attr; @@ -515,7 +515,7 @@ class templateHandling $depends[$key] ); $array[] = $depends[$key]; - $cache[$key] = array_unique(call_user_func_array('array_merge_recursive', $array)); + $cache[$key] = array_unique(array_merge_recursive(...$array)); return $cache[$key]; } diff --git a/include/functions.inc b/include/functions.inc index 0a025c0011db90b2243cd4fe716798ae126405ff..db0c03181c2e0f35782a569eba75326718b6ec5d 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -2512,9 +2512,8 @@ function mail_utf8($to, $from_user, $from_email, $subject, $message, $type = 'pl } /* Calls fopen, gives errors as an array if any, file handle if successful */ -function fopenWithErrorHandling() +function fopenWithErrorHandling(...$args) { - $args = func_get_args(); $errors = array(); set_error_handler( function ($errno, $errstr, $errfile, $errline, $errcontext) use (&$errors) @@ -2522,7 +2521,7 @@ function fopenWithErrorHandling() $errors[] = $errstr; } ); - $fh = @call_user_func_array('fopen', $args); + $fh = @fopen(...$args); restore_error_handler(); if ($fh !== FALSE) { return $fh; diff --git a/plugins/admin/acl/class_aclManagement.inc b/plugins/admin/acl/class_aclManagement.inc index ce0b9656a1c4b4a1d8f3a6c27548eb096dc3d893..f9e5735cc4d2b8657dea4a8c0c2203adfafd034e 100644 --- a/plugins/admin/acl/class_aclManagement.inc +++ b/plugins/admin/acl/class_aclManagement.inc @@ -201,14 +201,13 @@ class aclManagement extends simpleManagement @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->dn, 'Creating new ACLĂ‚ assignment'); } - static function filterLabel($row, $dn, $pid = 0, $base = '') + static function filterLabel($row, $dn, $pid = 0, $base = '', ...$vals) { $ou = ''; if ($dn == $base) { $ou = ' . '; } else { - for ($i = 4;$i < func_num_args();$i++) { - $val = func_get_arg($i); + foreach ($vals as $val) { if (empty($val)) { continue; } diff --git a/plugins/admin/groups/class_roleGeneric.inc b/plugins/admin/groups/class_roleGeneric.inc index fabbb6a60627ec97aa01b63b33b708619f4a6cac..9569ee633aeab43ad590951d6758d218c10d8082 100644 --- a/plugins/admin/groups/class_roleGeneric.inc +++ b/plugins/admin/groups/class_roleGeneric.inc @@ -32,7 +32,7 @@ class RoleMembersAttribute extends UsersAttribute if (empty($groups)) { $this->whitelistDns = array(); } else { - $this->whitelistDns = call_user_func_array('array_merge_recursive', $groups)['member']; + $this->whitelistDns = array_merge_recursive(...$groups)['member']; } } return array(