Changeset 3242543
- Timestamp:
- 02/18/2025 10:25:23 AM (13 months ago)
- Location:
- borderless
- Files:
-
- 220 added
- 5 edited
-
tags/1.6.3 (added)
-
tags/1.6.3/assets (added)
-
tags/1.6.3/assets/fonts (added)
-
tags/1.6.3/assets/fonts/bootstrap-icons.woff (added)
-
tags/1.6.3/assets/fonts/bootstrap-icons.woff2 (added)
-
tags/1.6.3/assets/fonts/borderless-icon-font.svg (added)
-
tags/1.6.3/assets/fonts/borderless-icon-font.ttf (added)
-
tags/1.6.3/assets/fonts/borderless-icon-font.woff (added)
-
tags/1.6.3/assets/img (added)
-
tags/1.6.3/assets/img/borderless.svg (added)
-
tags/1.6.3/assets/img/library.svg (added)
-
tags/1.6.3/assets/img/post-type.svg (added)
-
tags/1.6.3/assets/lib (added)
-
tags/1.6.3/assets/lib/appear.js (added)
-
tags/1.6.3/assets/lib/countto.js (added)
-
tags/1.6.3/assets/lib/flickity (added)
-
tags/1.6.3/assets/lib/flickity/flickity-as-nav-for.js (added)
-
tags/1.6.3/assets/lib/flickity/flickity-fade.css (added)
-
tags/1.6.3/assets/lib/flickity/flickity-fade.js (added)
-
tags/1.6.3/assets/lib/flickity/flickity-fullscreen.css (added)
-
tags/1.6.3/assets/lib/flickity/flickity-fullscreen.js (added)
-
tags/1.6.3/assets/lib/flickity/flickity.css (added)
-
tags/1.6.3/assets/lib/flickity/flickity.js (added)
-
tags/1.6.3/assets/lib/images-loaded.js (added)
-
tags/1.6.3/assets/lib/isotope.js (added)
-
tags/1.6.3/assets/lib/marquee.js (added)
-
tags/1.6.3/assets/lib/progressbar.js (added)
-
tags/1.6.3/assets/lib/typewriterjs.js (added)
-
tags/1.6.3/assets/scripts (added)
-
tags/1.6.3/assets/scripts/ai-button.js (added)
-
tags/1.6.3/assets/scripts/bootstrap.js (added)
-
tags/1.6.3/assets/scripts/borderless-elementor.min.js (added)
-
tags/1.6.3/assets/scripts/borderless-wpbakery.min.js (added)
-
tags/1.6.3/assets/scripts/borderless.js (added)
-
tags/1.6.3/assets/scripts/borderless.min.js (added)
-
tags/1.6.3/assets/scripts/library.js (added)
-
tags/1.6.3/assets/styles (added)
-
tags/1.6.3/assets/styles/bootstrap-icons.css (added)
-
tags/1.6.3/assets/styles/bootstrap.css (added)
-
tags/1.6.3/assets/styles/borderless-icon-font.css (added)
-
tags/1.6.3/assets/styles/borderless.css (added)
-
tags/1.6.3/assets/styles/borderless.min.css (added)
-
tags/1.6.3/assets/styles/dashboard.css (added)
-
tags/1.6.3/assets/styles/dashboard.min.css (added)
-
tags/1.6.3/assets/styles/elementor (added)
-
tags/1.6.3/assets/styles/elementor.css (added)
-
tags/1.6.3/assets/styles/elementor.min.css (added)
-
tags/1.6.3/assets/styles/elementor/elementor-widget-animated-text.css (added)
-
tags/1.6.3/assets/styles/elementor/elementor-widget-hero.css (added)
-
tags/1.6.3/assets/styles/elementor/elementor-widget-portfolio.css (added)
-
tags/1.6.3/assets/styles/elementor/elementor-widget-slider.css (added)
-
tags/1.6.3/assets/styles/elementor/elementor-widget-split-hero.css (added)
-
tags/1.6.3/assets/styles/library.css (added)
-
tags/1.6.3/assets/styles/wpbakery (added)
-
tags/1.6.3/assets/styles/wpbakery.css (added)
-
tags/1.6.3/assets/styles/wpbakery.min.css (added)
-
tags/1.6.3/assets/styles/wpbakery/wpbakery-icon-fonts.css (added)
-
tags/1.6.3/borderless.php (added)
-
tags/1.6.3/includes (added)
-
tags/1.6.3/includes/class-borderless-loader.php (added)
-
tags/1.6.3/includes/class-borderless-public.php (added)
-
tags/1.6.3/includes/class-borderless.php (added)
-
tags/1.6.3/includes/custom-post-types (added)
-
tags/1.6.3/includes/custom-post-types/custom-post-types.php (added)
-
tags/1.6.3/includes/custom-post-types/templates.php (added)
-
tags/1.6.3/includes/helper.php (added)
-
tags/1.6.3/includes/icon-manager (added)
-
tags/1.6.3/includes/icon-manager/assets (added)
-
tags/1.6.3/includes/icon-manager/assets/css (added)
-
tags/1.6.3/includes/icon-manager/assets/css/icon-manager.css (added)
-
tags/1.6.3/includes/icon-manager/assets/css/icon-manager.min.css (added)
-
tags/1.6.3/includes/icon-manager/assets/css/icon-manager.scss (added)
-
tags/1.6.3/includes/icon-manager/assets/js (added)
-
tags/1.6.3/includes/icon-manager/assets/js/icon-manager.js (added)
-
tags/1.6.3/includes/icon-manager/assets/js/icon-manager.min.js (added)
-
tags/1.6.3/includes/icon-manager/icon-manager.php (added)
-
tags/1.6.3/includes/index.php (added)
-
tags/1.6.3/includes/library (added)
-
tags/1.6.3/includes/library/importer.php (added)
-
tags/1.6.3/includes/library/inc (added)
-
tags/1.6.3/includes/library/inc/BorderlessLibraryImporter.php (added)
-
tags/1.6.3/includes/library/inc/CustomizerImporter.php (added)
-
tags/1.6.3/includes/library/inc/CustomizerOption.php (added)
-
tags/1.6.3/includes/library/inc/Downloader.php (added)
-
tags/1.6.3/includes/library/inc/Helpers.php (added)
-
tags/1.6.3/includes/library/inc/ImportActions.php (added)
-
tags/1.6.3/includes/library/inc/Importer.php (added)
-
tags/1.6.3/includes/library/inc/Logger.php (added)
-
tags/1.6.3/includes/library/inc/PluginInstaller.php (added)
-
tags/1.6.3/includes/library/inc/PluginInstallerSkin.php (added)
-
tags/1.6.3/includes/library/inc/PluginInstallerSkinSilent.php (added)
-
tags/1.6.3/includes/library/inc/ReduxImporter.php (added)
-
tags/1.6.3/includes/library/inc/ViewHelpers.php (added)
-
tags/1.6.3/includes/library/inc/WPCLICommands.php (added)
-
tags/1.6.3/includes/library/inc/WXRImporter.php (added)
-
tags/1.6.3/includes/library/inc/WidgetImporter.php (added)
-
tags/1.6.3/includes/library/templates (added)
-
tags/1.6.3/includes/library/templates/borderless-templates-after.php (added)
-
tags/1.6.3/includes/library/templates/borderless-templates.php (added)
-
tags/1.6.3/includes/library/templates/classic-templates-after.php (added)
-
tags/1.6.3/includes/library/templates/classic-templates-plugins.php (added)
-
tags/1.6.3/includes/library/templates/classic-templates.php (added)
-
tags/1.6.3/includes/library/templates/templates.php (added)
-
tags/1.6.3/includes/library/vendor (added)
-
tags/1.6.3/includes/library/vendor/autoload.php (added)
-
tags/1.6.3/includes/library/vendor/awesomemotive (added)
-
tags/1.6.3/includes/library/vendor/awesomemotive/wp-content-importer-v2 (added)
-
tags/1.6.3/includes/library/vendor/awesomemotive/wp-content-importer-v2/src (added)
-
tags/1.6.3/includes/library/vendor/awesomemotive/wp-content-importer-v2/src/Importer.php (added)
-
tags/1.6.3/includes/library/vendor/awesomemotive/wp-content-importer-v2/src/WPImporterLogger.php (added)
-
tags/1.6.3/includes/library/vendor/awesomemotive/wp-content-importer-v2/src/WPImporterLoggerCLI.php (added)
-
tags/1.6.3/includes/library/vendor/awesomemotive/wp-content-importer-v2/src/WXRImportInfo.php (added)
-
tags/1.6.3/includes/library/vendor/awesomemotive/wp-content-importer-v2/src/WXRImporter.php (added)
-
tags/1.6.3/includes/library/vendor/composer (added)
-
tags/1.6.3/includes/library/vendor/composer/ClassLoader.php (added)
-
tags/1.6.3/includes/library/vendor/composer/autoload_classmap.php (added)
-
tags/1.6.3/includes/library/vendor/composer/autoload_namespaces.php (added)
-
tags/1.6.3/includes/library/vendor/composer/autoload_psr4.php (added)
-
tags/1.6.3/includes/library/vendor/composer/autoload_real.php (added)
-
tags/1.6.3/includes/library/vendor/composer/autoload_static.php (added)
-
tags/1.6.3/includes/library/views (added)
-
tags/1.6.3/includes/library/views/import.php (added)
-
tags/1.6.3/includes/library/views/install-plugins.php (added)
-
tags/1.6.3/includes/library/views/plugin-page.php (added)
-
tags/1.6.3/includes/svg (added)
-
tags/1.6.3/includes/svg/sanitizer.php (added)
-
tags/1.6.3/includes/svg/svg.min.js (added)
-
tags/1.6.3/includes/svg/svg.php (added)
-
tags/1.6.3/includes/svg/whitelist.php (added)
-
tags/1.6.3/includes/templates (added)
-
tags/1.6.3/includes/templates/dashboard.php (added)
-
tags/1.6.3/includes/templates/license.php (added)
-
tags/1.6.3/includes/templates/system-info.php (added)
-
tags/1.6.3/languages (added)
-
tags/1.6.3/languages/borderless.pot (added)
-
tags/1.6.3/license.txt (added)
-
tags/1.6.3/modules (added)
-
tags/1.6.3/modules/block-editor (added)
-
tags/1.6.3/modules/block-editor/contact-information (added)
-
tags/1.6.3/modules/block-editor/contact-information/contact-information-frontend.css (added)
-
tags/1.6.3/modules/block-editor/contact-information/contact-information.css (added)
-
tags/1.6.3/modules/block-editor/contact-information/contact-information.js (added)
-
tags/1.6.3/modules/block-editor/contact-information/contact-information.php (added)
-
tags/1.6.3/modules/block-editor/social-icons (added)
-
tags/1.6.3/modules/block-editor/social-icons/social-icons-backend.css (added)
-
tags/1.6.3/modules/block-editor/social-icons/social-icons-frontend.css (added)
-
tags/1.6.3/modules/block-editor/social-icons/social-icons.js (added)
-
tags/1.6.3/modules/block-editor/social-icons/social-icons.php (added)
-
tags/1.6.3/modules/block-editor/spacer (added)
-
tags/1.6.3/modules/block-editor/spacer/spacer-backend.css (added)
-
tags/1.6.3/modules/block-editor/spacer/spacer.js (added)
-
tags/1.6.3/modules/block-editor/spacer/spacer.php (added)
-
tags/1.6.3/modules/elementor (added)
-
tags/1.6.3/modules/elementor/assets.php (added)
-
tags/1.6.3/modules/elementor/elementor.php (added)
-
tags/1.6.3/modules/elementor/helper.php (added)
-
tags/1.6.3/modules/elementor/widgets (added)
-
tags/1.6.3/modules/elementor/widgets/animated-text.php (added)
-
tags/1.6.3/modules/elementor/widgets/circular-progress-bar.php (added)
-
tags/1.6.3/modules/elementor/widgets/contact-form-7.php (added)
-
tags/1.6.3/modules/elementor/widgets/hero.php (added)
-
tags/1.6.3/modules/elementor/widgets/marquee-text.php (added)
-
tags/1.6.3/modules/elementor/widgets/portfolio.php (added)
-
tags/1.6.3/modules/elementor/widgets/progress-bar.php (added)
-
tags/1.6.3/modules/elementor/widgets/semi-circular-progress-bar.php (added)
-
tags/1.6.3/modules/elementor/widgets/slider.php (added)
-
tags/1.6.3/modules/elementor/widgets/split-hero.php (added)
-
tags/1.6.3/modules/elementor/widgets/team-member.php (added)
-
tags/1.6.3/modules/elementor/widgets/testimonial.php (added)
-
tags/1.6.3/modules/related-posts (added)
-
tags/1.6.3/modules/related-posts/related-posts.php (added)
-
tags/1.6.3/modules/wpbakery (added)
-
tags/1.6.3/modules/wpbakery/custom-default-elements.php (added)
-
tags/1.6.3/modules/wpbakery/elements (added)
-
tags/1.6.3/modules/wpbakery/elements/alert.php (added)
-
tags/1.6.3/modules/wpbakery/elements/circular-progress-bar.php (added)
-
tags/1.6.3/modules/wpbakery/elements/counter.php (added)
-
tags/1.6.3/modules/wpbakery/elements/icon-group.php (added)
-
tags/1.6.3/modules/wpbakery/elements/icon.php (added)
-
tags/1.6.3/modules/wpbakery/elements/infobox.php (added)
-
tags/1.6.3/modules/wpbakery/elements/list-group.php (added)
-
tags/1.6.3/modules/wpbakery/elements/modal.php (added)
-
tags/1.6.3/modules/wpbakery/elements/pricing.php (added)
-
tags/1.6.3/modules/wpbakery/elements/progress-bar.php (added)
-
tags/1.6.3/modules/wpbakery/elements/semi-circular-progress-bar.php (added)
-
tags/1.6.3/modules/wpbakery/elements/svg.php (added)
-
tags/1.6.3/modules/wpbakery/elements/team-member.php (added)
-
tags/1.6.3/modules/wpbakery/elements/testimonial.php (added)
-
tags/1.6.3/modules/wpbakery/images (added)
-
tags/1.6.3/modules/wpbakery/images/alert.png (added)
-
tags/1.6.3/modules/wpbakery/images/circular-progress-bar.png (added)
-
tags/1.6.3/modules/wpbakery/images/counter.png (added)
-
tags/1.6.3/modules/wpbakery/images/icon-group.png (added)
-
tags/1.6.3/modules/wpbakery/images/icon.png (added)
-
tags/1.6.3/modules/wpbakery/images/infobox.png (added)
-
tags/1.6.3/modules/wpbakery/images/list-group.png (added)
-
tags/1.6.3/modules/wpbakery/images/list-item.png (added)
-
tags/1.6.3/modules/wpbakery/images/modal.png (added)
-
tags/1.6.3/modules/wpbakery/images/pricing.png (added)
-
tags/1.6.3/modules/wpbakery/images/progress-bar.png (added)
-
tags/1.6.3/modules/wpbakery/images/semi-circular-progress-bar.png (added)
-
tags/1.6.3/modules/wpbakery/images/svg.png (added)
-
tags/1.6.3/modules/wpbakery/images/team-member.png (added)
-
tags/1.6.3/modules/wpbakery/images/testimonial-section.png (added)
-
tags/1.6.3/modules/wpbakery/images/testimonial.png (added)
-
tags/1.6.3/modules/wpbakery/lean-map.php (added)
-
tags/1.6.3/modules/wpbakery/paramns (added)
-
tags/1.6.3/modules/wpbakery/paramns/icon-manager-param.php (added)
-
tags/1.6.3/modules/wpbakery/wpbakery.php (added)
-
tags/1.6.3/readme.txt (added)
-
trunk/borderless.php (modified) (3 diffs)
-
trunk/includes/class-borderless.php (modified) (1 diff)
-
trunk/includes/icon-manager (added)
-
trunk/includes/icon-manager/assets (added)
-
trunk/includes/icon-manager/assets/css (added)
-
trunk/includes/icon-manager/assets/css/icon-manager.css (added)
-
trunk/includes/icon-manager/assets/css/icon-manager.min.css (added)
-
trunk/includes/icon-manager/assets/css/icon-manager.scss (added)
-
trunk/includes/icon-manager/assets/js (added)
-
trunk/includes/icon-manager/assets/js/icon-manager.js (added)
-
trunk/includes/icon-manager/assets/js/icon-manager.min.js (added)
-
trunk/includes/icon-manager/icon-manager.php (added)
-
trunk/includes/svg/svg.php (modified) (5 diffs)
-
trunk/includes/templates/dashboard.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
borderless/trunk/borderless.php
r3242167 r3242543 5 5 Plugin URI: https://visualmodo.com/borderless/ 6 6 Description: One service packed with powerful tools to help you reach your purposes. 7 Version: 1.6. 27 Version: 1.6.3 8 8 Author: Visualmodo 9 9 Author URI: https://visualmodo.com … … 21 21 /*-----------------------------------------------------------------------------------*/ 22 22 23 define( 'BORDERLESS__VERSION', '1.6. 2' );23 define( 'BORDERLESS__VERSION', '1.6.3' ); 24 24 define( 'BORDERLESS__DIR', plugin_dir_path( __FILE__ ) ); 25 25 define( 'BORDERLESS__URL', plugins_url( '/', __FILE__ ) ); … … 135 135 136 136 require_once( BORDERLESS__INC . "/templates/system-info.php" ); 137 //require_once( BORDERLESS__INC . "/icon-manager/icon-manager.php" );137 require_once( BORDERLESS__INC . "/icon-manager/icon-manager.php" ); 138 138 require_once( BORDERLESS__INC . "/custom-post-types/custom-post-types.php" ); 139 139 require_once( BORDERLESS__INC . "/svg/svg.php" ); -
borderless/trunk/includes/class-borderless.php
r3242167 r3242543 92 92 93 93 require_once( BORDERLESS__INC . "/templates/system-info.php" ); 94 //require_once( BORDERLESS__INC . "/icon-manager/icon-manager.php" );94 require_once( BORDERLESS__INC . "/icon-manager/icon-manager.php" ); 95 95 require_once( BORDERLESS__INC . "/custom-post-types/custom-post-types.php" ); 96 96 require_once( BORDERLESS__INC . "/svg/svg.php" ); -
borderless/trunk/includes/svg/svg.php
r2479909 r3242543 5 5 } 6 6 7 // Sanitizes a comma separated CSS selectors with class and id namesto ensure it only contains valid characters.8 // Complex selectors (for ex.[name*="value"]) are not allowed.9 // Allowed characters: A-Z, a-z, 0-9, _, -, .(dot), >, (space), #, ,(comma)7 // Sanitizes a comma-separated list of CSS selectors (with class and id names) to ensure it only contains valid characters. 8 // Complex selectors (e.g., [name*="value"]) are not allowed. 9 // Allowed characters: A-Z, a-z, 0-9, _, -, . (dot), >, (space), #, , (comma) 10 10 function borderless_svg_sanitize_css_selectors( $selectors ) { 11 11 $selectors = htmlspecialchars_decode( $selectors ); 12 12 13 // Strip out any % encoded octets13 // Strip out any % encoded octets 14 14 $sanitized = preg_replace( '|%[a-fA-F0-9][a-fA-F0-9]|', '', $selectors ); 15 15 16 // Limit to A-Z, a-z, 0-9, _, -, .(dot), >, (space), #, ,(comma)16 // Limit to A-Z, a-z, 0-9, _, -, . (dot), >, (space), #, , (comma) 17 17 $sanitized = preg_replace( '/[^A-Za-z0-9 _,.#>-]/', '', $sanitized ); 18 18 19 // convert the ">" (greater-than) sign to > for storing in a database20 $sanitized = htmlspecialchars( $sanitized);19 // Convert the ">" (greater-than) sign to > for storing in a database 20 $sanitized = htmlspecialchars( $sanitized ); 21 21 22 22 return apply_filters( 'borderless_svg_sanitize_css_selectors', $sanitized ); 23 23 } 24 24 25 // Allow SVG through WordPress Media Uploader 26 function borderless_svg_cc_mime_types( $mimes ) { 27 $mimes['svg'] = 'image/svg+xml'; 28 $mimes['svgz'] = 'image/svg+xml'; 29 return $mimes; 30 } 31 add_filter( 'upload_mimes', 'borderless_svg_cc_mime_types' ); 25 32 26 //Allow SVG through WordPress Media Uploader 27 function borderless_svg_cc_mime_types($mimes) { 28 $mimes['svg'] = 'image/svg+xml'; 29 $mimes['svgz'] = 'image/svg+xml'; 30 return $mimes; 31 } 32 add_filter('upload_mimes', 'borderless_svg_cc_mime_types'); 33 // Removed the temporary fix that disabled real MIME checking, 34 // as this practice may compromise security. WordPress versions from 4.7.2 onwards 35 // already perform the check correctly. 33 36 34 /** 35 * TEMP FIX FOR 4.7.1 36 * Issue should be fixed in 4.7.2 in which case this will be deleted. 37 */ 38 function borderless_svgs_disable_real_mime_check( $data, $file, $filename, $mimes ) { 39 $wp_filetype = wp_check_filetype( $filename, $mimes ); 37 // Sanitize SVG code of a file during upload to the media library: remove all JavaScript tags and attributes. 38 function borderless_sanitize_svg( $file ) { 39 if ( isset( $file['type'] ) && $file['type'] === 'image/svg+xml' ) { 40 40 41 $ext = $wp_filetype['ext'];42 $type = $wp_filetype['type'];43 $proper_filename = $data['proper_filename'];44 45 return compact( 'ext', 'type', 'proper_filename' );46 }47 add_filter( 'wp_check_filetype_and_ext', 'borderless_svgs_disable_real_mime_check', 10, 4 );48 49 //Sanitize SVG code of a file during uploading into media library: remove all JavaScript tags and attributes.50 function borderless_sanitize_svg( $file ) {51 if( $file['type'] == 'image/svg+xml' ) {52 53 41 require_once 'sanitizer.php'; 54 42 55 43 $svg = new BORDERLESS_SvgSanitizer(); 56 57 $svg->load_svg( $file['tmp_name'] ); 44 if ( ! $svg->load_svg( $file['tmp_name'] ) ) { 45 $file['error'] = 'Failed to load the SVG for sanitization.'; 46 return $file; 47 } 48 58 49 $svg->borderless_sanitize_svg(); 59 50 $sanitized_svg = $svg->save_svg(); 51 if ( empty( $sanitized_svg ) ) { 52 $file['error'] = 'SVG sanitization resulted in an empty file.'; 53 return $file; 54 } 60 55 56 if ( ! function_exists( 'WP_Filesystem' ) ) { 57 require_once( ABSPATH . 'wp-admin/includes/file.php' ); 58 } 61 59 global $wp_filesystem; 62 $creds = request_filesystem_credentials( admin_url(), '', FALSE, FALSE, array() );60 $creds = request_filesystem_credentials( admin_url(), '', false, false, array() ); 63 61 if ( ! WP_Filesystem( $creds ) ) { 64 request_filesystem_credentials( admin_url(), '', TRUE, FALSE, NULL ); 62 $file['error'] = 'Unable to access the filesystem to sanitize the SVG.'; 63 return $file; 65 64 } 66 65 67 66 $replaced = $wp_filesystem->put_contents( $file['tmp_name'], $sanitized_svg, FS_CHMOD_FILE ); 67 if ( ! $replaced ) { 68 $file['error'] = 'Failed to write the sanitized SVG to the temporary file.'; 69 return $file; 70 } 68 71 } 69 70 72 return $file; 71 73 } 72 74 add_filter( 'wp_handle_upload_prefilter', 'borderless_sanitize_svg' ); 73 75 74 75 //Fixing SVG width and height attributes to show correctly in TinyMCE editor 76 // Fix SVG width and height attributes so they display correctly in the TinyMCE editor 76 77 function borderless_svg_fix_svg_size_attributes( $out, $id ) { 77 $image_url = wp_get_attachment_url( $id ); 78 $file_ext = pathinfo( $image_url, PATHINFO_EXTENSION ); 79 if ( ! is_admin() || 'svg' !== $file_ext ) 80 { 78 $image_url = wp_get_attachment_url( $id ); 79 $file_ext = pathinfo( $image_url, PATHINFO_EXTENSION ); 80 if ( ! is_admin() || 'svg' !== $file_ext ) { 81 81 return false; 82 82 } … … 85 85 add_filter( 'image_downsize', 'borderless_svg_fix_svg_size_attributes', 10, 2 ); 86 86 87 88 //Fixing SVG width and height attributes to show correctly in Media Library in grid mode 89 function borderless_svg_prepare_attachment_for_js_filter($response, $attachment, $meta){ 90 if( $response['mime'] == 'image/svg+xml' && empty($response['sizes']) ){ 87 // Fix SVG width and height attributes so they display correctly in the Media Library grid view 88 function borderless_svg_prepare_attachment_for_js_filter( $response, $attachment, $meta ) { 89 if ( $response['mime'] == 'image/svg+xml' && empty( $response['sizes'] ) ) { 91 90 $svg_file_path = get_attached_file( $attachment->ID ); 92 91 … … 95 94 $response['sizes'] = array( 96 95 'full' => array( 97 'url' => $response['url'],98 'width' => $orig_size[0],96 'url' => $response['url'], 97 'width' => $orig_size[0], 99 98 'height' => $orig_size[1] 100 99 ) … … 106 105 return $response; 107 106 } 108 //get width and height attributes of uploded SVG 109 function borderless_svg_get_original_svg_size($file) { 107 add_filter( 'wp_prepare_attachment_for_js', 'borderless_svg_prepare_attachment_for_js_filter', 10, 3 ); 108 109 // Retrieve width and height attributes of the uploaded SVG. 110 // Now disables external entity loading to prevent XXE attacks. 111 function borderless_svg_get_original_svg_size( $file ) { 110 112 $arr = array(); 111 $xml_get = simplexml_load_file($file); 112 $xml_attrs = $xml_get->attributes(); 113 114 $width = (string) $xml_attrs->width; 115 if ( empty($width) ) { 116 $width = '100%'; 117 } 118 119 $height = (string) $xml_attrs->height; 120 if ( empty($height) ) { 113 114 $prev = libxml_disable_entity_loader( true ); 115 $xml_get = simplexml_load_file( $file, 'SimpleXMLElement', LIBXML_NONET ); 116 libxml_disable_entity_loader( $prev ); 117 118 if ( $xml_get === false ) { 119 $width = '100%'; 121 120 $height = '100%'; 121 } else { 122 $xml_attrs = $xml_get->attributes(); 123 124 $width = (string) $xml_attrs->width; 125 if ( empty( $width ) ) { 126 $width = '100%'; 127 } 128 129 $height = (string) $xml_attrs->height; 130 if ( empty( $height ) ) { 131 $height = '100%'; 132 } 122 133 } 123 134 … … 127 138 return $arr; 128 139 } 129 add_filter('wp_prepare_attachment_for_js', 'borderless_svg_prepare_attachment_for_js_filter', 10, 3);130 140 131 //Define styles and scripts for site's front-end 132 141 // Define styles and scripts for the site's front-end 133 142 function borderless_svg_scripts() { 134 wp_enqueue_script( 'borderless_svg_js', plugins_url( '/svg.min.js', __FILE__ ), array('jquery'), BORDERLESS__VERSION, true ); 135 143 wp_enqueue_script( 'borderless_svg_js', plugins_url( '/svg.min.js', __FILE__ ), array( 'jquery' ), BORDERLESS__VERSION, true ); 136 144 wp_enqueue_script( 'borderless_svg_js' ); 137 145 } 138 add_action('wp_enqueue_scripts', 'borderless_svg_scripts'); 139 146 add_action( 'wp_enqueue_scripts', 'borderless_svg_scripts' ); 140 147 141 148 ?> -
borderless/trunk/includes/templates/dashboard.php
r3242167 r3242543 83 83 } 84 84 } 85 86 /*87 85 88 86 add_action( 'admin_menu', 'borderless_icon_fonts_submenu', 50 ); … … 102 100 } 103 101 } 104 105 */106 102 107 103 add_submenu_page( -
borderless/trunk/readme.txt
r3242167 r3242543 5 5 Tested up to: 6.7.1 6 6 Requires PHP: 7.4 7 Stable tag: 1.6. 27 Stable tag: 1.6.3 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 82 82 == Changelog == 83 83 84 = 1.6.3 - Feb 18 2025 = 85 * Fixed - SVG Vulnerability. 86 * Fixed - Icon Manager Readded. 87 84 88 = 1.6.2 - Feb 17 2025 = 85 89 * Fixed - Icon Manager Removed.
Note: See TracChangeset
for help on using the changeset viewer.