From 75f62a81f651066135cf517bff27b00846fd2820 Mon Sep 17 00:00:00 2001 From: Florian Schlichting Date: Wed, 3 Feb 2021 23:22:58 +0800 Subject: [PATCH] fix PHP8 deprecation warnings: "Required parameter X follows optional parameter Y" Deprecated: Required parameter $username follows optional parameter $attributes in inc/drivers_ldap.php on line 190 Deprecated: Required parameter $passwd follows optional parameter $attributes in inc/drivers_ldap.php on line 190 Deprecated: Required parameter $ua_string follows optional parameter $min_age in inc/external-fetch.php on line 42 As explained in https://www.php.net/manual/en/migration80.deprecated.php, If a parameter with a default value is followed by a required parameter, the default value has no effect. This is deprecated as of PHP 8.0.0 and can generally be resolved by dropping the default value, without a change in functionality --- inc/drivers_ldap.php | 6 ++++-- inc/external-fetch.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/inc/drivers_ldap.php b/inc/drivers_ldap.php index e59af74a..6e8c8089 100644 --- a/inc/drivers_ldap.php +++ b/inc/drivers_ldap.php @@ -180,14 +180,16 @@ class ldapDriver } /** - * Returns the result of the LDAP query + * Actually look up a user in the LDAP directory + * (this is the LDAP part of LDAP_check() below) * * @param string $filter The filter used to search entries * @param array $attributes Attributes to be returned + * @param string $username username to check * @param string $passwd password to check * @return array Contains selected attributes from all entries corresponding to the given filter */ - function requestUser( $filter, $attributes=NULL, $username, $passwd) { + function requestUser( $filter, $attributes, $username, $passwd) { global $c; $entry=NULL; diff --git a/inc/external-fetch.php b/inc/external-fetch.php index 599470c7..b124f6e5 100644 --- a/inc/external-fetch.php +++ b/inc/external-fetch.php @@ -39,7 +39,7 @@ function create_external ( $path,$is_calendar,$is_addressbook ) } } -function fetch_external ( $bind_id, $min_age = '1 hour', $ua_string ) +function fetch_external ( $bind_id, $min_age, $ua_string ) { if ( ! function_exists ( "curl_init" ) ) { dbg_error_log("external", "external resource cannot be fetched without curl, please install curl");