Changeset 2999478
- Timestamp:
- 11/21/2023 10:28:12 AM (16 months ago)
- Location:
- jvm-rich-text-icons/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
jvm-rich-text-icons/trunk/plugin.php
r2890094 r2999478 3 3 * Plugin Name: JVM rich text icons 4 4 * Description: Add Font Awesome icons, or icons from a custom icon set to the Gutenberg editor. 5 * Version: 1.2. 35 * Version: 1.2.4 6 6 * Author: Joris van Montfort 7 7 * Author URI: https://jorisvm.nl … … 11 11 * @category Gutenberg 12 12 * @author Joris van Montfort 13 * @version 1.2. 313 * @version 1.2.4 14 14 * @package JVM rich text icons 15 15 */ … … 24 24 25 25 if (is_admin()) { 26 26 require_once plugin_dir_path( __FILE__ ) . 'src/settings.php'; 27 27 } 28 28 -
jvm-rich-text-icons/trunk/readme.txt
r2890094 r2999478 88 88 == Changelog == 89 89 90 = 1.2.4 = 91 Security update. Fixed a vulnerability issue in the uploader and plugin settings. 92 90 93 = 1.2.3 = 91 94 Fixed the thick border around the toolbar button by using the correct toolbar button markup. -
jvm-rich-text-icons/trunk/src/settings.php
r2789395 r2999478 20 20 */ 21 21 public function try_add_settings() { 22 $show_settings = apply_filters('jvm_richtext_icons_show_settings', true); 23 if ($show_settings) { 24 add_action( 'admin_menu', array( $this, 'add_plugin_page' ) ); 25 add_action( 'admin_init', array( $this, 'page_init' ) ); 26 add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' )); 27 28 // Ajax calls 29 add_action('wp_ajax_jvm-rich-text-icons-delete-icon', array( $this, 'ajax_delete_icon')); 30 add_action('wp_ajax_jvm-rich-text-icons-upload-icon', array( $this, 'ajax_upload_icon')); 31 32 // Notice on settings screen if a custom icon set is loaded 33 add_action('admin_notices', array($this, 'admin_notice')); 22 $user = wp_get_current_user(); 23 // Only admin users have access to the settings. 24 if (in_array( 'administrator', (array) $user->roles ) ) { 25 26 $show_settings = apply_filters('jvm_richtext_icons_show_settings', true); 27 if ($show_settings) { 28 add_action( 'admin_menu', array( $this, 'add_plugin_page' ) ); 29 add_action( 'admin_init', array( $this, 'page_init' ) ); 30 add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' )); 31 32 // Ajax calls 33 if (current_user_can( 'upload_files' )) { 34 add_action('wp_ajax_jvm-rich-text-icons-delete-icon', array( $this, 'ajax_delete_icon')); 35 add_action('wp_ajax_jvm-rich-text-icons-upload-icon', array( $this, 'ajax_upload_icon')); 36 } 37 38 // Notice on settings screen if a custom icon set is loaded 39 add_action('admin_notices', array($this, 'admin_notice')); 40 } 34 41 } 35 42 } … … 117 124 */ 118 125 public function ajax_upload_icon() { 119 if (isset($_FILES['file']) ) {126 if (isset($_FILES['file']) && wp_verify_nonce($_GET['nonce'], 'jvm-rich-text-icons-upload-icon' )) { 120 127 // Check if file is SVG as we only accept SVG files 121 if ($_FILES['file']['type'] == 'image/svg+xml') { 128 $pi = pathinfo($_FILES['file']['name']); 129 if ($_FILES['file']['type'] == 'image/svg+xml' && strtolower($pi['extension']) == 'svg') { 122 130 123 131 $base = JVM_Richtext_icons::get_svg_directory();
Note: See TracChangeset
for help on using the changeset viewer.