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.
This commit is contained in:
Florian Schlichting 2018-12-29 19:38:13 +01:00
parent 0023b066fd
commit 19eb79ebf9
2 changed files with 2 additions and 2 deletions

View File

@ -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');

View File

@ -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,'*');