Skip to content

Commit

Permalink
2.1.2 - fix scaped secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancisTicgal committed Apr 8, 2024
1 parent 6ab4209 commit ff2a1ac
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# One-Time Secret GLPI Plugin CHANGELOG

## 2.1.2 - 2024-04-08
### Bugfixes
- Fix scaped characters in secret and passphrase #21465

## 2.1.1 - 2023-10-18
### Bugfixes
- Fix unused field that generates warning php logs #17969
Expand Down
3 changes: 3 additions & 0 deletions front/link.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
Session::addMessageAfterRedirect(__("Secret is missing", "onetimesecret"));
} else {
PluginOnetimesecretSecret::authentication();
// remove slashes
$_POST['password'] = stripslashes($_POST['password']);
$_POST['passphrase'] = stripslashes($_POST['passphrase']);
$link = PluginOnetimesecretSecret::createSecret($_POST);
if ($link) {
PluginOnetimesecretSecret::addFollowup($_POST, $link);
Expand Down
8 changes: 4 additions & 4 deletions setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

use Glpi\Plugin\Hooks;

define('PLUGIN_ONETIMESECRET_VERSION', '2.1.1');
define('PLUGIN_ONETIMESECRET_VERSION', '2.1.2');
define('PLUGIN_ONETIMESECRET_MIN_GLPI', '10.0.10');
define('PLUGIN_ONETIMESECRET_MAX_GLPI', '11.0');

Expand All @@ -45,13 +45,13 @@ function plugin_init_onetimesecret()
{
global $PLUGIN_HOOKS;

$PLUGIN_HOOKS['csrf_compliant']['onetimesecret'] = true;
$PLUGIN_HOOKS[Hooks::CSRF_COMPLIANT]['onetimesecret'] = true;

$plugin = new Plugin();
if ($plugin->isActivated('onetimesecret')) {
Plugin::registerClass('PluginOnetimesecretConfig', ['addtabon' => 'Config']);
Plugin::registerClass(PluginOnetimesecretConfig::class, ['addtabon' => 'Config']);

Plugin::registerClass('PluginOnetimesecretProfile', ['addtabon' => 'Profile']);
Plugin::registerClass(PluginOnetimesecretProfile::class, ['addtabon' => 'Profile']);

$PLUGIN_HOOKS['config_page']['onetimesecret'] = 'front/config.form.php';

Expand Down

0 comments on commit ff2a1ac

Please sign in to comment.