Plugin Directory

Changeset 2132000


Ignore:
Timestamp:
08/01/2019 09:35:24 AM (7 years ago)
Author:
fpin
Message:

Version 1.4

Location:
taugun/trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • taugun/trunk/esf.php

    r2130178 r2132000  
    44 * Plugin Name: Taugun Events Calendar
    55 * Description: Taugun is a free Events Calendar plugin which allows you to create and manage events in your WordPress site.
    6  * Version: 1.3
     6 * Version: 1.4
    77 * Author: Flintop
    88 * Author URI: https://flintop.com/
     
    2727         * Version
    2828         * */
    29         private $version = '1.3' ;
     29        private $version = '1.4' ;
    3030
    3131        /**
  • taugun/trunk/inc/abstracts/class-esf-post.php

    r2129128 r2132000  
    114114         */
    115115        public function exists() {
    116 
    117116            return isset( $this->post->post_type ) && $this->post->post_type == $this->post_type ;
    118117        }
  • taugun/trunk/inc/abstracts/class-esf-settings-page.php

    r2129128 r2132000  
    168168            $section = ($current_sub_section) ? $current_sub_section : $current_section ;
    169169
    170             if ( empty( $_POST[ 'reset' ] ) )
     170            if ( ! isset( $_POST[ 'reset' ] ) || empty( $_POST[ 'reset' ] ) )
    171171                return ;
    172172
  • taugun/trunk/inc/admin/menu/class-esf-menu-management.php

    r2106552 r2132000  
    9393            $current_sub_section = empty( $_REQUEST[ 'subsection' ] ) ? '' : sanitize_title( wp_unslash( $_REQUEST[ 'subsection' ] ) ) ;
    9494
    95             do_action( self::$plugin_slug . '_settings_save_' . $current_tab , $current_section ) ;
    96             do_action( self::$plugin_slug . '_settings_reset_' . $current_tab , $current_section ) ;
     95            do_action( sanitize_key( self::$plugin_slug . '_settings_save_' . $current_tab ) , $current_section ) ;
     96            do_action( sanitize_key( self::$plugin_slug . '_settings_reset_' . $current_tab ) , $current_section ) ;
    9797        }
    9898
  • taugun/trunk/inc/admin/menu/class-esf-post-type-handler.php

    r2129128 r2132000  
    238238
    239239            // If this is an autosave, our form has not been submitted, so we don't want to do anything.
    240             if ( empty( $post_id ) || empty( $post ) ) {
    241                 return ;
    242             }
     240            if ( empty( $post_id ) || empty( $post ) )
     241                return ;
    243242
    244243            // Check the nonce
    245             if ( empty( $_POST[ 'esf_events_nonce' ] ) || ! wp_verify_nonce( $_POST[ 'esf_events_nonce' ] , 'esf_save_event_settings' ) )
     244            if ( ! isset( $_POST[ 'esf_events_nonce' ] ) || empty( $_POST[ 'esf_events_nonce' ] ) || ! wp_verify_nonce( esf_sanitize_text_field( $_POST[ 'esf_events_nonce' ] ) , 'esf_save_event_settings' ) )
    246245                return ;
    247246
     
    251250
    252251            // Dont' save meta boxes for revisions or autosaves
    253             if ( defined( 'DOING_AUTOSAVE' ) || is_int( wp_is_post_revision( $post_id ) ) || is_int( wp_is_post_autosave( $post_id ) ) ) {
    254                 return ;
    255             }
     252            if ( defined( 'DOING_AUTOSAVE' ) || is_int( wp_is_post_revision( $post_id ) ) || is_int( wp_is_post_autosave( $post_id ) ) )
     253                return ;
    256254
    257255            // Check user has permission to edit
    258             if ( ! current_user_can( 'edit_post' , $post_id ) ) {
    259                 return ;
    260             }
     256            if ( ! current_user_can( 'edit_post' , $post_id ) )
     257                return ;
    261258
    262259            //Prevent to update post multi time.
  • taugun/trunk/inc/admin/menu/class-esf-settings.php

    r2125765 r2132000  
    5050            }
    5151
    52             self::$settings = apply_filters( self::$plugin_slug . '_get_settings_pages' , $settings ) ;
     52            self::$settings = apply_filters( sanitize_key( self::$plugin_slug . '_get_settings_pages' ) , $settings ) ;
    5353
    5454            return self::$settings ;
  • taugun/trunk/inc/admin/menu/pages/class-esf-locations.php

    r2129128 r2132000  
    194194            }
    195195
    196             if ( isset( $meta_data[ 'esf_image' ] ) && ! filter_var( $meta_data[ 'esf_image' ] , FILTER_VALIDATE_URL ) === FALSE ) {
    197                 throw new Exception( esc_html__( 'Inavlid Image URL' , ESF_LOCALE ) ) ;
    198             }
    199 
    200196            $post_args = array(
    201197                'post_title'   => esf_sanitize_text_field( $meta_data[ 'esf_name' ] ) ,
     
    272268            }
    273269
    274             if ( isset( $meta_data[ 'esf_image' ] ) && filter_var( $meta_data[ 'esf_image' ] , FILTER_VALIDATE_URL ) === FALSE ) {
    275                 throw new Exception( esc_html__( 'Inavlid Image URL' , ESF_LOCALE ) ) ;
    276             }
    277 
    278270            $post_args = array(
    279271                'post_title'   => esf_sanitize_text_field( $meta_data[ 'esf_name' ] ) ,
  • taugun/trunk/inc/admin/menu/pages/class-esf-organizers.php

    r2129128 r2132000  
    153153            // Check user permission
    154154            if ( ! current_user_can( 'publish_posts' ) ) {
    155                 throw new Exception( esc_html__( 'You do not have permission to create Locations' , ESF_LOCALE ) ) ;
     155                throw new Exception( esc_html__( "You don't have permission to do this action" , ESF_LOCALE ) ) ;
    156156            }
    157157
     
    161161            }
    162162
    163             $meta_data = $_POST[ 'organizer' ] ;
     163            $meta_data = esf_sanitize_text_field( $_POST[ 'organizer' ] ) ;
    164164
    165165            if ( $meta_data[ 'esf_name' ] == '' ) {
  • taugun/trunk/inc/admin/menu/wp-list-table/class-esf-locations-table.php

    r2106552 r2132000  
    6666            $this->base_url = add_query_arg( array( 'page' => 'locations' ) , esf_get_event_page_url() ) ;
    6767
    68             add_filter( $this->plugin_slug . '_query_where' , array( $this , 'custom_search' ) , 10 , 1 ) ;
     68            add_filter( sanitize_key( $this->plugin_slug . '_query_where' ) , array( $this , 'custom_search' ) , 10 , 1 ) ;
    6969
    7070            $this->prepare_current_url() ;
     
    218218                return ;
    219219
    220             if ( ! current_user_can( 'edit_post' ) )
    221                 wp_die( '<p class="esf_warning_notice">' . esc_html__( 'Sorry, you are not allowed to edit this Location.' , ESF_LOCALE ) . '</p>' ) ;
     220            if ( ! current_user_can( 'edit_posts' ) )
     221                wp_die( '<p class="esf_warning_notice">' . esc_html__( "You don't have permission to do this action" , ESF_LOCALE ) . '</p>' ) ;
    222222
    223223            $action = $this->current_action() ;
     
    287287            $where = " where post_type='" . $this->post_type . "' and post_status" . $status ;
    288288
    289             $where   = apply_filters( $this->plugin_slug . '_query_where' , $where ) ;
    290             $limit   = apply_filters( $this->plugin_slug . '_query_limit' , $this->perpage ) ;
    291             $offset  = apply_filters( $this->plugin_slug . '_query_offset' , $this->offset ) ;
    292             $orderby = apply_filters( $this->plugin_slug . '_query_orderby' , $this->orderby ) ;
     289            $where   = apply_filters( sanitize_key( $this->plugin_slug . '_query_where' ) , $where ) ;
     290            $limit   = apply_filters( sanitize_key( $this->plugin_slug . '_query_limit' ) , $this->perpage ) ;
     291            $offset  = apply_filters( sanitize_key( $this->plugin_slug . '_query_offset' ) , $this->offset ) ;
     292            $orderby = apply_filters( sanitize_key( $this->plugin_slug . '_query_orderby' ) , $this->orderby ) ;
    293293
    294294            $count_items       = $wpdb->get_results( "SELECT ID FROM " . $wpdb->posts . " $where $orderby" ) ;
  • taugun/trunk/inc/admin/menu/wp-list-table/class-esf-organizers-table.php

    r2106552 r2132000  
    6666            $this->base_url = add_query_arg( array( 'page' => 'organizers' ) , esf_get_event_page_url() ) ;
    6767
    68             add_filter( $this->plugin_slug . '_query_where' , array( $this , 'custom_search' ) , 10 , 1 ) ;
     68            add_filter( sanitize_key( $this->plugin_slug . '_query_where' ) , array( $this , 'custom_search' ) , 10 , 1 ) ;
    6969
    7070            $this->prepare_current_url() ;
     
    218218                return ;
    219219
    220             if ( ! current_user_can( 'edit_post' ) )
    221                 wp_die( '<p class="esf_warning_notice">' . esc_html__( 'Sorry, you are not allowed to edit this Organizer.' , ESF_LOCALE ) . '</p>' ) ;
     220            if ( ! current_user_can( 'edit_posts' ) )
     221                wp_die( '<p class="esf_warning_notice">' . esc_html__( "You don't have permission to do this action" , ESF_LOCALE ) . '</p>' ) ;
    222222
    223223            $action = $this->current_action() ;
     
    283283            $where  = " where post_type='" . $this->post_type . "' and post_status" . $status ;
    284284
    285             $where   = apply_filters( $this->plugin_slug . '_query_where' , $where ) ;
    286             $limit   = apply_filters( $this->plugin_slug . '_query_limit' , $this->perpage ) ;
    287             $offset  = apply_filters( $this->plugin_slug . '_query_offset' , $this->offset ) ;
    288             $orderby = apply_filters( $this->plugin_slug . '_query_orderby' , $this->orderby ) ;
     285            $where   = apply_filters( sanitize_key( $this->plugin_slug . '_query_where' ) , $where ) ;
     286            $limit   = apply_filters( sanitize_key( $this->plugin_slug . '_query_limit' ) , $this->perpage ) ;
     287            $offset  = apply_filters( sanitize_key( $this->plugin_slug . '_query_offset' ) , $this->offset ) ;
     288            $orderby = apply_filters( sanitize_key( $this->plugin_slug . '_query_orderby' ) , $this->orderby ) ;
    289289
    290290            $count_items       = $wpdb->get_results( "SELECT ID FROM " . $wpdb->posts . " $where $orderby" ) ;
  • taugun/trunk/readme.txt

    r2130178 r2132000  
    55Tested up to: 5.2.1
    66Requires PHP: 5.6.25
    7 Stable tag: 1.3
     7Stable tag: 1.4
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    156156== Changelog ==
    157157
     158V1.4
     159
     160 Fix: Unable to update location without image once saved
     161
    158162V1.3
    159163
Note: See TracChangeset for help on using the changeset viewer.