Overview
Comment:Ne calculer la longueur qu'une seule fois
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | dev
Files: files | file ages | folders
SHA1: 257cb45cb0b4dbeb534e83ce336c249e58796bcc
User & Date: bohwaz on 2017-01-27 00:26:04
Other Links: branch diff | manifest | tags
Context
2017-02-17
02:08
Ajout signaux pour plugin, fix [743d7e1483fc23c85bd66aa44bd5673479a88913] check-in: a1acf12dcf user: bohwaz tags: dev
2017-01-27
00:26
Ne calculer la longueur qu'une seule fois check-in: 257cb45cb0 user: bohwaz tags: dev
00:24
Ne pas utiliser shuffle/array_rand pour la crypto, utiliser quelque chose de sécurisé check-in: 91685a0145 user: bohwaz tags: dev
Changes

Modified src/include/lib/Garradin/Membres.php from [8ea0f4ea30] to [6c7caf4cad].

    12     12       const ITEMS_PER_PAGE = 50;
    13     13   
    14     14       protected function _getSalt($length)
    15     15       {
    16     16           static $str = './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
    17     17           
    18     18           $out = '';
           19  +        $max = strlen($str) - 1;
    19     20   
    20     21           for ($i = 0; $i < $length; $i++)
    21     22           {
    22         -            $random = \KD2\Security::random_int(0, strlen($str) - 1);
           23  +            $random = \KD2\Security::random_int(0, $max);
    23     24               $out .= $str[$random];
    24     25           }
    25     26   
    26     27           return $out;
    27     28       }
    28     29   
    29     30       protected function _hashPassword($password)