Overview
Comment: | Utilisation de safe_unlink/safe_mkdir partout |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | dev |
Files: | files | file ages | folders |
SHA1: |
85d5a50a945511222fdf17a1630179b6 |
User & Date: | bohwaz on 2018-09-13 22:21:52 |
Other Links: | branch diff | manifest | tags |
Context
2018-09-22
| ||
09:59 | Utilisation de safe_unlink/safe_mkdir partout check-in: 933b330272 user: bohwaz tags: trunk, stable | |
2018-09-19
| ||
13:54 | Correction filtrage liste plugins check-in: 50e72bff3f user: bohwaz tags: dev | |
2018-09-13
| ||
22:21 | Utilisation de safe_unlink/safe_mkdir partout check-in: 85d5a50a94 user: bohwaz tags: dev | |
22:06 | Générer une erreur quand même quand la suppression échoue et que le fichier existe toujours check-in: 1bdf70a9d5 user: bohwaz tags: dev | |
Changes
Modified src/include/lib/Garradin/Install.php from [ba81d4bd4a] to [683f6f27e6].
︙ | |||
145 146 147 148 149 150 151 | 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | - - - + - | static public function checkAndCreateDirectories() { // Vérifier que les répertoires vides existent, sinon les créer $paths = [DATA_ROOT, PLUGINS_ROOT, CACHE_ROOT, CACHE_ROOT . '/static', CACHE_ROOT . '/compiled']; foreach ($paths as $path) { |
︙ |
Modified src/include/lib/Garradin/Plugin.php from [0e12346d98] to [e947eb781e].
︙ | |||
613 614 615 616 617 618 619 | 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 | - + | catch (\Exception $e) { throw new UserException('Le téléchargement du plugin '.$id.' a échoué : ' . $e->getMessage()); } if (!self::checkHash($id)) { |
︙ |
Modified src/include/lib/Garradin/Sauvegarde.php from [ba865c4dc1] to [3200010089].
︙ | |||
142 143 144 145 146 147 148 | 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | - + | { if (preg_match('!\.\.+!', $file) || !preg_match('!^[\w\d._-]+\.sqlite$!i', $file) || $file == basename(DB_FILE)) { throw new UserException('Nom de fichier non valide.'); } |
︙ | |||
227 228 229 230 231 232 233 | 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | - + | } } $r = $this->restoreDB($file['tmp_name'], $user_id); if ($r) { |
︙ |
Modified src/include/lib/Garradin/Squelette.php from [a6a2b8cd25] to [fc1698f7ac].
︙ | |||
878 879 880 881 882 883 884 | 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 | - + + - + + | static private function compile_store($tpl, $content) { $path = self::compile_get_path($tpl); if (!file_exists(dirname($path))) { |
︙ | |||
951 952 953 954 955 956 957 | 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 | - + - + | static public function resetSource($template) { if (!preg_match('!^[\w\d_-]+(?:\.[\w\d_-]+)*$!i', $template)) return false; if (file_exists(DATA_ROOT . '/www/squelettes/' . $template)) { |
︙ |
Modified src/include/lib/Garradin/Static_Cache.php from [453588f5aa] to [1abb2553b4].
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | - + | protected static function _getCacheDir() { $dir = CACHE_ROOT . '/static'; if (!file_exists($dir)) { |
︙ | |||
82 83 84 85 86 87 88 | 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | - + - + | { return file_exists(self::_getCachePath($id)); } static public function remove($id) { $path = self::_getCachePath($id); |
Modified src/include/lib/Garradin/Template.php from [f146e5dca4] to [bc26b664b5].
︙ | |||
19 20 21 22 23 24 25 | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | - + | public function __construct() { parent::__construct(); if (!file_exists(CACHE_ROOT . '/compiled')) { |
︙ |
Modified src/include/lib/Garradin/Utils.php from [d74b84d7b0] to [c76bd4d270].
︙ | |||
387 388 389 390 391 392 393 | 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 | - - - + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + | $path = CACHE_ROOT . '/' . $path; $dir = dir($path); while ($file = $dir->read()) { if ($file[0] != '.') { |
︙ | |||
575 576 577 578 579 580 581 | 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 | - + | if (is_dir($path . '/' . $file)) { if (!self::deleteRecursive($path . '/' . $file)) return false; } else { |
︙ |