Skip to content

Commit 5aee638

Browse files
Add filter + formatting
1 parent f46592c commit 5aee638

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/admin-settings.cls.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,17 @@ public function save($raw_data)
119119
$v = Utility::sanitize_lines($v);
120120

121121
// Remove from MAPPING FILETYPE extensions for IMAGES, CSS, JS
122-
$remove_type = array('.jpg', '.jpeg', '.png', '.gif', '.svg', '.webp', '.avif', '.css', '.js');
122+
$remove_type = apply_filters('litespeed_cdn_save_filetypes_remove', array(
123+
'.jpg',
124+
'.jpeg',
125+
'.png',
126+
'.gif',
127+
'.svg',
128+
'.webp',
129+
'.avif',
130+
'.css',
131+
'.js',
132+
));
123133
$v = array_diff($v, $remove_type);
124134
}
125135
if ($child == self::CDN_MAPPING_URL) {

src/cdn.cls.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@ public function init()
9494
Debug2::debug2('[CDN] mapping ' . implode(',', $v[Base::CDN_MAPPING_FILETYPE]) . ' -> ' . $this_url);
9595
}
9696
}
97-
97+
9898
// Add CSS to rewrite if CDN Mapping setting is enabled
9999
if (!empty($this->_cfg_cdn_mapping[Base::CDN_MAPPING_INC_CSS])) {
100-
$this->_cfg_cdn_mapping['.css'] = $this->_cfg_cdn_mapping[Base::CDN_MAPPING_INC_CSS];
100+
$this->_cfg_cdn_mapping['.css'] = $this->_cfg_cdn_mapping[Base::CDN_MAPPING_INC_CSS];
101101
}
102-
102+
103103
// Add JS to rewrite if CDN Mapping setting is enabled
104104
if (!empty($this->_cfg_cdn_mapping[Base::CDN_MAPPING_INC_JS])) {
105105
$this->_cfg_cdn_mapping['.js'] = $this->_cfg_cdn_mapping[Base::CDN_MAPPING_INC_JS];

0 commit comments

Comments
 (0)