[ticket/17010] Make get_form_tokens() parameters optional

PHPBB3-17010
This commit is contained in:
Marc Alexander 2022-10-28 21:46:34 +02:00
parent e177ee3750
commit 166f0deae9
No known key found for this signature in database
GPG key ID: 50E0D2423696F995

View file

@ -46,13 +46,13 @@ class form_helper
* Get form tokens for form
*
* @param string $form_name Name of form
* @param int $now Token generation time
* @param string $token_sid SID used for form token
* @param string $token Generated token
* @param int|null $now Token generation time
* @param string|null $token_sid SID used for form token
* @param string|null $token Generated token
*
* @return array Array containing form_token and creation_time of form token
*/
public function get_form_tokens(string $form_name, int &$now = 0, string &$token_sid = '', string &$token = ''): array
public function get_form_tokens(string $form_name, ?int &$now = 0, ?string &$token_sid = '', ?string &$token = ''): array
{
$now = time();
$token_sid = ($this->user->data['user_id'] == ANONYMOUS && !empty($this->config['form_token_sid_guests'])) ? $this->user->session_id : '';