From a53833b9ce2ec0c31a690800a6664083401975ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Ducoulombier?= Date: Thu, 9 Jul 2020 10:37:21 +0200 Subject: [PATCH] user remote service plugin PHP < 7.3 compatibility - refs BT#16297 --- plugin/userremoteservice/lang/english.php | 7 +++---- plugin/userremoteservice/lang/french.php | 11 +++++------ .../src/user_remote_service_plugin.class.php | 12 ++++-------- 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/plugin/userremoteservice/lang/english.php b/plugin/userremoteservice/lang/english.php index 4199341ee4..b561be19c9 100644 --- a/plugin/userremoteservice/lang/english.php +++ b/plugin/userremoteservice/lang/english.php @@ -5,15 +5,14 @@ $strings['plugin_title'] = 'User Remote Services'; $strings['plugin_comment'] = 'Appends site-specific iframe-targetted user-identifying links to the menu bar.'; $strings['salt'] = 'Salt'; -$strings['salt_help'] = <<<'EOT' -Secret character string, used to generate the hash URL parameter. The longest, the best. +$strings['salt_help'] = +'Secret character string, used to generate the hash URL parameter. The longest, the best.
Remote user services can check the generated URL authenticity with the following PHP expression :
password_verify($salt.$userId, $hash)
Where
$salt is this input value,
$userId is the number of the user referenced by the username URL parameter value and -
$hash contains the hash URL parameter value. -EOT; +
$hash contains the hash URL parameter value.'; // Please keep alphabetically sorted $strings['CreateService'] = 'Add service to menu bar'; diff --git a/plugin/userremoteservice/lang/french.php b/plugin/userremoteservice/lang/french.php index b571a2592a..5768d5d35e 100644 --- a/plugin/userremoteservice/lang/french.php +++ b/plugin/userremoteservice/lang/french.php @@ -7,15 +7,14 @@ $strings['plugin_comment'] = /* Strings for settings */ $strings['salt'] = "Sel"; -$strings['salt_help'] = <<<'EOT' -Chaine de caractère secrète, utilisée pour générer le paramètre d'URL hash. Plus il est long et mieux c'est. -
Les services distants peuvent vérifier la validité de l'URL générée avec l'expression PHP suivante : +$strings['salt_help'] = +'Chaine de caractère secrète, utilisée pour générer le paramètre d\'URL hash. Plus il est long et mieux c\'est. +
Les services distants peuvent vérifier la validité de l\'URL générée avec l\'expression PHP suivante :
password_verify($salt.$userId, $hash)

$salt est la valeur saisie ici, -
$userId est le numéro de l'utilisateur auquel fait référence le paramètre d'URL username et -
$hash représente la valeur du paramètre d'URL hash. -EOT; +
$userId est le numéro de l\'utilisateur auquel fait référence le paramètre d\'URL username et +
$hash représente la valeur du paramètre d\'URL hash.'; // Please keep alphabetically sorted $strings['CreateService'] = "Ajouter le service au menu"; diff --git a/plugin/userremoteservice/src/user_remote_service_plugin.class.php b/plugin/userremoteservice/src/user_remote_service_plugin.class.php index f305a312ed..5c325c1d92 100644 --- a/plugin/userremoteservice/src/user_remote_service_plugin.class.php +++ b/plugin/userremoteservice/src/user_remote_service_plugin.class.php @@ -42,13 +42,11 @@ class UserRemoteServicePlugin extends Plugin { Database::query( sprintf( - << + '
-
-HTML, +', $this->getService( $this->getActiveServiceId() )->getCustomUserURL($userInfo['username'], $userInfo['id'], $this->salt())