From 19eb79ebf9250e5f339675319902458c40ed1755 Mon Sep 17 00:00:00 2001 From: Florian Schlichting Date: Sat, 29 Dec 2018 19:38:13 +0100 Subject: [PATCH] provide defaults for unused function parameters (fixes #155) PHP 7.1 throws an exception when a user-defined function is called with too few arguments: http://php.net/manual/en/migration71.incompatible.php As explained in the comments, collection_privilege_format_function and principal_privilege_format_function take three arguments because of their use as a rendering callback, however the latter two of them are never used and thus can be ommitted in other uses. --- inc/ui/collection-edit.php | 2 +- inc/ui/principal-edit.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/ui/collection-edit.php b/inc/ui/collection-edit.php index 3af9edd3..8c1d8401 100644 --- a/inc/ui/collection-edit.php +++ b/inc/ui/collection-edit.php @@ -190,7 +190,7 @@ $privilege_xlate = array( * @param dbrow $row The row object we read from the database. * @return string The formatted privileges. */ -function collection_privilege_format_function( $value, $column, $row ) { +function collection_privilege_format_function( $value, $column = NULL, $row = NULL ) { global $privilege_xlate; $privs = bits_to_privilege($value, 'calendar'); diff --git a/inc/ui/principal-edit.php b/inc/ui/principal-edit.php index 20dee7fa..2e37cd59 100644 --- a/inc/ui/principal-edit.php +++ b/inc/ui/principal-edit.php @@ -454,7 +454,7 @@ EOTEMPLATE; * @param dbrow $row The row object we read from the database. * @return string The formatted privileges. */ -function principal_privilege_format_function( $value, $column, $row ) { +function principal_privilege_format_function( $value, $column = NULL, $row = NULL ) { global $privilege_xlate; $privs = bits_to_privilege($value,'*');