|
1 | 1 | <?php |
2 | | - |
3 | 2 | /** |
4 | | - * FBalliano |
5 | | - * |
6 | | - * NOTICE OF LICENSE |
7 | | - * |
8 | 3 | * This source file is subject to the Open Software License (OSL 3.0) |
9 | 4 | * that is bundled with this package in the file LICENSE.txt. |
10 | 5 | * It is also available through the world-wide-web at this URL: |
11 | 6 | * http://opensource.org/licenses/osl-3.0.php |
12 | 7 | * |
13 | | - * DISCLAIMER |
14 | | - * |
15 | | - * Do not edit or add to this file if you wish to upgrade this Module to |
16 | | - * newer versions in the future. |
17 | | - * |
18 | 8 | * @category FBalliano |
19 | 9 | * @package FBalliano_ImageCleaner |
20 | | - * @copyright Copyright (c) 2021 Fabrizio Balliano (http://fabrizioballiano.it) |
| 10 | + * @copyright Copyright (c) Fabrizio Balliano (http://fabrizioballiano.com) |
21 | 11 | * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) |
22 | 12 | */ |
23 | 13 | class Fballiano_ImageCleaner_Helper_Data extends Mage_Core_Helper_Abstract |
@@ -83,12 +73,17 @@ public function getAllCSSFiles($dir) |
83 | 73 | return $result; |
84 | 74 | } |
85 | 75 |
|
86 | | - protected function getBlacklistedPatterns() |
| 76 | + protected function getBlacklistedPatterns(): array |
87 | 77 | { |
88 | | - return preg_split('/\r\n|\r|\n/', Mage::getStoreConfig('admin/fb_image_cleaner/blacklist')); |
| 78 | + $blacklist = Mage::getStoreConfig('admin/fb_image_cleaner/blacklist'); |
| 79 | + if ($blacklist === null) { |
| 80 | + return []; |
| 81 | + } |
| 82 | + |
| 83 | + return preg_split('/\r\n|\r|\n/', $blacklist); |
89 | 84 | } |
90 | 85 |
|
91 | | - public function isBlacklisted($path, $blacklisted_patterns) |
| 86 | + public function isBlacklisted($path, $blacklisted_patterns): bool |
92 | 87 | { |
93 | 88 | foreach ($blacklisted_patterns as $blacklisted_pattern) { |
94 | 89 | if (fnmatch('*/' . $blacklisted_pattern, $path)) return true; |
|
0 commit comments