Changeset 3165219
- Timestamp:
- 10/08/2024 07:39:51 PM (18 months ago)
- Location:
- svgplus/trunk
- Files:
-
- 2 edited
-
includes/class-svgplus-sanitizer.php (modified) (3 diffs)
-
svgplus.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
svgplus/trunk/includes/class-svgplus-sanitizer.php
r3165213 r3165219 7 7 8 8 use enshrined\svgSanitize\Sanitizer; 9 use enshrined\svgSanitize\Config;10 9 11 10 class SVGPlus_Sanitizer { … … 19 18 public static function sanitize_svg($svg_content) { 20 19 // Retrieve plugin settings 21 $settings = get_option('svgplus_settings' );20 $settings = get_option('svgplus_settings', svgplus_default_settings()); 22 21 $allow_animations = isset($settings['allow_animations']) ? (bool) $settings['allow_animations'] : false; 23 22 24 // Initialize the sanitizer and config23 // Initialize the sanitizer 25 24 $sanitizer = new Sanitizer(); 26 $config = Sanitizer::createConfig(); 25 26 // Get the current config 27 $config = $sanitizer->getConfig(); 27 28 28 29 if ($allow_animations) { … … 37 38 } 38 39 39 // Apply the config to the sanitizer40 // Apply the updated config to the sanitizer 40 41 $sanitizer->setConfig($config); 41 42 -
svgplus/trunk/svgplus.php
r3165218 r3165219 74 74 if (!isset($settings['allowed_roles']) || !is_array($settings['allowed_roles'])) { 75 75 $settings['allowed_roles'] = ['administrator', 'editor', 'author']; 76 update_option('svgplus_settings', $settings); 76 77 } 77 78 … … 156 157 } 157 158 add_action('wp_enqueue_scripts', 'svgplus_enqueue_custom_css'); 159 158 160 ?>
Note: See TracChangeset
for help on using the changeset viewer.