Overview
Comment:Fix: erreur quand le fichier de fond d'écran a déjà été supprimé (race condition)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | stable
Files: files | file ages | folders
SHA1: 41baaae90be2e7e4f587f46e1ccb82c83b045a1b
User & Date: bohwaz on 2020-09-08 18:42:03
Other Links: manifest | tags
Context
2020-09-08
18:53
Limiter la longueur du champ de recherche Leaf check-in: 0277842dc6 user: bohwaz tags: trunk, stable
18:42
Fix: erreur quand le fichier de fond d'écran a déjà été supprimé (race condition) check-in: 41baaae90b user: bohwaz tags: trunk, stable
18:36
Exiger que le code OTP fasse 6 caractères check-in: 14198574ed user: bohwaz tags: trunk, stable
Changes

Modified src/include/lib/Garradin/Config.php from [9e09070cbb] to [c889a0eda3].

   122    122           $values = [];
   123    123           $db = DB::getInstance();
   124    124   
   125    125           if (isset($this->modified['image_fond']))
   126    126           {
   127    127               if ($current = $db->firstColumn('SELECT valeur FROM config WHERE cle = \'image_fond\';'))
   128    128               {
   129         -                $f = new Fichiers($current);
   130         -                $f->remove();
          129  +                try {
          130  +                    $f = new Fichiers($current);
          131  +                    $f->remove();
          132  +                }
          133  +                catch (\InvalidArgumentException $e) {
          134  +                    // Ignore: the file has already been deleted
          135  +                }
   131    136               }
   132    137   
   133    138               if (strlen($this->config['image_fond']) > 0)
   134    139               {
   135    140                   $f = Fichiers::storeFromBase64('Image_fond_admin.png', $this->config['image_fond']);
   136    141                   $this->config['image_fond'] = $f->id;
   137    142                   unset($f);