Plugin Directory

Changeset 3136302


Ignore:
Timestamp:
08/15/2024 07:55:02 PM (20 months ago)
Author:
levantoan
Message:

FIX Authenticated (Author+) PHP Object Injection. Thanks to Lucio Sá

Location:
devvn-image-hotspot
Files:
32 added
4 edited

Legend:

Unmodified
Added
Removed
  • devvn-image-hotspot/trunk/admin/inc/add_shortcode_devvn_ihotspot.php

    r3046139 r3136302  
    1212   
    1313    $data_post = get_post_meta($idPost, 'hotspot_content', true);
     14
     15    if(!is_serialized($data_post) && !is_array($data_post) && is_string($data_post)){
     16        $data_post = json_decode($data_post, true);
     17    }
    1418
    1519    if(!$data_post){
  • devvn-image-hotspot/trunk/admin/js/maps_points.js

    r2438984 r3136302  
    125125                    source https://github.com/ccbgs/load_editor
    126126                    */
    127                     quicktags({id : fullId});
    128                     tinymce.init({
    129                         selector:"#" + fullId,
    130                         content_css : meta_image.editor_style,
    131                         min_height: 200,
    132                         textarea_name: "pointdata[content][]",                     
    133                         relative_urls:false,
    134                         remove_script_host:false,
    135                         convert_urls:false,
    136                         browser_spellcheck:false,
    137                         fix_list_elements:true,
    138                         entities:"38,amp,60,lt,62,gt",
    139                         entity_encoding:"raw",
    140                         keep_styles:false,
    141                         //paste_webkit_styles:"font-weight font-style color",
    142                         //preview_styles:"font-family font-size font-weight font-style text-decoration text-transform",
    143                         wpeditimage_disable_captions:false,
    144                         wpeditimage_html5_captions:true,
    145                         plugins:"charmap,hr,media,paste,tabfocus,textcolor,wordpress,wpeditimage,wpgallery,wplink,wpdialogs,wpview",                       
    146                         resize:"vertical",
    147                         menubar:false,
    148                         wpautop:true,
    149                         indent:false,
    150                         toolbar1:"bold,italic,strikethrough,bullist,numlist,blockquote,hr,alignleft,aligncenter,alignright,link,unlink,wp_more,spellchecker,wp_adv",
    151                         toolbar2:"formatselect,underline,alignjustify,forecolor,pastetext,removeformat,charmap,outdent,indent,undo,redo,wp_help",
    152                         toolbar3:"",
    153                         toolbar4:"",
    154                         tabfocus_elements:":prev,:next",                                   
    155                     });
    156                    
    157                     // this is needed for the editor to initiate
    158                     tinyMCE.execCommand('mceFocus', false, fullId);
    159                     tinyMCE.execCommand('mceRemoveEditor', false, fullId);
    160                     tinyMCE.execCommand('mceAddEditor', false, fullId);                     
     127                    if(typeof quicktags != "undefined") {
     128                        quicktags({id: fullId});
     129                    }
     130
     131                    if(typeof tinymce != "undefined") {
     132                        tinymce.init({
     133                            selector: "#" + fullId,
     134                            content_css: meta_image.editor_style,
     135                            min_height: 200,
     136                            textarea_name: "pointdata[content][]",
     137                            relative_urls: false,
     138                            remove_script_host: false,
     139                            convert_urls: false,
     140                            browser_spellcheck: false,
     141                            fix_list_elements: true,
     142                            entities: "38,amp,60,lt,62,gt",
     143                            entity_encoding: "raw",
     144                            keep_styles: false,
     145                            //paste_webkit_styles:"font-weight font-style color",
     146                            //preview_styles:"font-family font-size font-weight font-style text-decoration text-transform",
     147                            wpeditimage_disable_captions: false,
     148                            wpeditimage_html5_captions: true,
     149                            plugins: "charmap,hr,media,paste,tabfocus,textcolor,wordpress,wpeditimage,wpgallery,wplink,wpdialogs,wpview",
     150                            resize: "vertical",
     151                            menubar: false,
     152                            wpautop: true,
     153                            indent: false,
     154                            toolbar1: "bold,italic,strikethrough,bullist,numlist,blockquote,hr,alignleft,aligncenter,alignright,link,unlink,wp_more,spellchecker,wp_adv",
     155                            toolbar2: "formatselect,underline,alignjustify,forecolor,pastetext,removeformat,charmap,outdent,indent,undo,redo,wp_help",
     156                            toolbar3: "",
     157                            toolbar4: "",
     158                            tabfocus_elements: ":prev,:next",
     159                        });
     160
     161                        // this is needed for the editor to initiate
     162                        tinyMCE.execCommand('mceFocus', false, fullId);
     163                        tinyMCE.execCommand('mceRemoveEditor', false, fullId);
     164                        tinyMCE.execCommand('mceAddEditor', false, fullId);
     165
     166                    }
    161167                   
    162168                    doDraggable();
  • devvn-image-hotspot/trunk/devvn-image-hotspot.php

    r3046139 r3136302  
    55Description: Image Hotspot help you add hotspot to your images.
    66Author: Le Van Toan
    7 Version: 1.2.3
     7Version: 1.2.4
    88Author URI: https://levantoan.com/
    99Text Domain: devvn-image-hotspot
     
    3030defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
    3131
    32 define('DEVVN_IHOTSPOT_VER', '1.2.3');
     32define('DEVVN_IHOTSPOT_VER', '1.2.4');
    3333define('DEVVN_IHOTSPOT_DEV_MOD', true);
     34
    3435if ( !defined( 'DEVVN_IHOTSPOT_BASENAME' ) )
    3536    define( 'DEVVN_IHOTSPOT_BASENAME', plugin_basename( __FILE__ ) );
    3637
    37 define('DEVVN_IHOTSPOT_POINT_DEFAULT',serialize(array(
     38define('DEVVN_IHOTSPOT_POINT_DEFAULT', json_encode(array(
    3839    'countPoint'    =>  '',
    3940    'content'       =>  '',
     
    4647    'pins_class'    =>  ''
    4748)));
    48 define('DEVVN_IHOTSPOT_PINS_DEFAULT',serialize(array(
     49define('DEVVN_IHOTSPOT_PINS_DEFAULT', json_encode(array(
    4950    'countPoint'    =>  '',
    5051    'imgPoint'      =>  '',
     
    9899
    99100    $data_post = get_post_meta($post->ID, 'hotspot_content', true);
     101
     102    if(!is_serialized($data_post) && !is_array($data_post) && is_string($data_post)){
     103        $data_post = json_decode($data_post, true);
     104    }
    100105
    101106    if(!$data_post){
     
    308313        'data_points'       =>  $dataPoints
    309314    );
    310     update_post_meta($post_id, 'hotspot_content', $data_post);
     315    update_post_meta($post_id, 'hotspot_content', json_encode($data_post));
    311316    /*remove_action( 'save_post', 'devvn_ihotspot_save_meta_box_data' );
    312317    wp_update_post(array(
     
    358363       
    359364        wp_enqueue_script( 'jquery-ui-core' );
    360         wp_enqueue_script('jquery-ui-droppable');       
    361        
    362         /*wp_register_script( 'bootstrap-js', plugin_dir_url( __FILE__ ) . 'admin/js/bootstrap.min.js', array( 'jquery' ), DEVVN_IHOTSPOT_VER, true );
    363         wp_enqueue_script( 'bootstrap-js' );*/
    364 
    365         wp_register_script( 'maps_points', plugin_dir_url( __FILE__ ) . 'admin/js/maps_points.js', array( 'jquery' ), DEVVN_IHOTSPOT_VER, true );
     365        wp_enqueue_script('jquery-ui-droppable');
     366
     367        wp_register_script( 'devvn-tinymce', home_url('/wp-includes/js/tinymce/wp-tinymce.js'), array(), DEVVN_IHOTSPOT_VER, true );
     368
     369        wp_register_script( 'maps_points', plugin_dir_url( __FILE__ ) . 'admin/js/maps_points.js', array( 'jquery', 'quicktags', 'devvn-tinymce', 'editor'), DEVVN_IHOTSPOT_VER, true );
    366370        wp_localize_script( 'maps_points', 'meta_image',
    367371            array(
     
    405409function devvn_ihotspot_get_input_point_default($data = array()){
    406410    if(!is_array($data)) $data = array();
    407     $data = wp_parse_args($data,unserialize(DEVVN_IHOTSPOT_POINT_DEFAULT));
     411    $data = wp_parse_args($data, json_decode(DEVVN_IHOTSPOT_POINT_DEFAULT, true));
    408412       
    409413    $countPoint                 = isset($data['countPoint'])?$data['countPoint']:'';
     
    527531function devvn_ihotspot_get_pins_default($datapin = array()){
    528532    if(!is_array($datapin)) $datapin = array();
    529     $datapin = wp_parse_args($datapin,unserialize(DEVVN_IHOTSPOT_PINS_DEFAULT));
     533    $datapin = wp_parse_args($datapin, json_decode(DEVVN_IHOTSPOT_PINS_DEFAULT, true));
    530534    $countPoint = $datapin['countPoint'];
    531535    $imgPin = $datapin['imgPoint'];
    532536    $topPin = $datapin['top'];
    533537    $leftPin = $datapin['left'];
    534     $pins_image_custom = $datapin['pins_image_custom'];
     538    $pins_image_custom = isset($datapin['pins_image_custom']) && $datapin['pins_image_custom'] ? $datapin['pins_image_custom'] : '';
    535539    if($pins_image_custom) $imgPin = $pins_image_custom;
    536540    ob_start();
  • devvn-image-hotspot/trunk/readme.txt

    r3046139 r3136302  
    44Tags: hotspot, points, image, maps, image hotspot
    55Requires at least: 4.3
    6 Tested up to: 5.9.1
    7 Stable tag: 1.2.3
     6Tested up to: 6.6.1
     7Stable tag: 1.2.4
    88License: GPLv3
    99License URI: http://www.gnu.org/licenses/gpl-3.0
     
    5050
    5151For more information, see [Releases](https://levantoan.com/devvn-image-hotspot).
     52
     53= 1.2.4 - 16/08/2024 =
     54
     55* FIX Authenticated (Author+) PHP Object Injection. Thanks to Lucio Sá
     56* Add editor js and tinymce js
    5257
    5358= 1.2.2 - 05/03/2022 =
Note: See TracChangeset for help on using the changeset viewer.