Skip to content

Commit

Permalink
_oups donc (aka un base64_encode ca fait pas de mal)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cerdic authored and Gitea committed Jun 25, 2020
1 parent 6c16507 commit 0394b44
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions prive/formulaires/editer_liens.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,17 @@ function formulaires_editer_liens_charger_dist($a, $b, $c, $options = array()) {
$skel_ajout = $table_source . '_roles_associer';
}

$oups = _request('_oups');
if (unserialize(base64_decode($oups))) {
// on est bon, rien a faire
}
elseif(unserialize($oups)) {
// il faut encoder
$oups = base64_encode($oups);
}
else {
$oups = '';
}
$valeurs = array(
'id' => "$table_source-$objet-$id_objet-$objet_lien", // identifiant unique pour les id du form
'_vue_liee' => $skel_vue,
Expand All @@ -145,7 +156,7 @@ function formulaires_editer_liens_charger_dist($a, $b, $c, $options = array()) {
'ordonner_lien' => '',
'desordonner_liens' => '',
'_roles' => $roles, # description des roles
'_oups' => _request('_oups'),
'_oups' => $oups,
'editable' => $editable,
);

Expand Down Expand Up @@ -221,6 +232,7 @@ function formulaires_editer_liens_traiter_dist($a, $b, $c, $options = array()) {
// annuler les suppressions du coup d'avant !
if (_request('annuler_oups')
and $oups = _request('_oups')
and $oups = base64_decode($oups)
and $oups = unserialize($oups)
) {
if ($oups_objets = charger_fonction("editer_liens_oups_{$table_source}_{$objet}_{$objet_lien}", 'action', true)) {
Expand Down Expand Up @@ -297,7 +309,7 @@ function formulaires_editer_liens_traiter_dist($a, $b, $c, $options = array()) {
}
}
}
set_request('_oups', $oups ? serialize($oups) : null);
set_request('_oups', $oups ? base64_encode(serialize($oups)) : null);
}

if ($ajouter) {
Expand Down

0 comments on commit 0394b44

Please sign in to comment.