Changeset 124343 in spip-zone


Ignore:
Timestamp:
Apr 27, 2020, 10:33:15 AM (5 weeks ago)
Author:
Cerdic
Message:

masquer les mots de passe dans le mail d'erreur en cas de fail

Location:
_plugins_/trad-lang/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • _plugins_/trad-lang/trunk

    • Property subgit:lock:2d2a94995d24c174b47620cc674362fb59906763 deleted
    • Property subgit:lock:3c5f091ab1199c066c5b39b256caacc3fbfd866e set to 2020-04-27T12:33:24.440
  • _plugins_/trad-lang/trunk/inc/salvatore.php

    r121656 r124343  
    479479function salvatore_fail($sujet, $corps){
    480480        $corps = rtrim($corps) . "\n\n";
     481
     482        // masquer les mots de passe dans le message si jamais...
     483        $pass_to_hide = [];
     484        if (!empty($GLOBALS['SVNPASSWD'])) {
     485                $pass_to_hide[] = $GLOBALS['SVNPASSWD'];
     486        }
     487        if (!empty($domaines_exceptions_credentials)) {
     488                foreach ($domaines_exceptions_credentials as $domain => $credential) {
     489                        if (!empty($credential['pass'])) {
     490                                $pass_to_hide[] = $credential['pass'];
     491                        }
     492                }
     493        }
     494        foreach ($pass_to_hide as $pass) {
     495                $replace = "xxxxxxxx@";
     496                $sujet = str_replace("$pass@", $replace, $sujet);
     497                $corps = str_replace("$pass@", $replace, $corps);
     498        }
     499
    481500        salvatore_envoyer_mail($sujet, $corps);
    482501        throw new Exception($corps);
Note: See TracChangeset for help on using the changeset viewer.