Plugin Directory


Ignore:
Timestamp:
11/14/2018 04:44:36 PM (6 years ago)
Author:
krmoorhouse
Message:

Release 3.3.18, see readme.txt for the changelog.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ninja-forms/trunk/includes/Admin/Menus/Submissions.php

    r1886851 r1974335  
    7575        unset( $views[ 'publish' ] );
    7676
    77         // If the Form ID is not empty...
    78         if( ! empty( $_GET[ 'form_id' ] ) ) {
     77        // If the Form ID is not empty and IS a number...
     78        if( ! empty( $_GET[ 'form_id' ] ) && ctype_digit( $_GET[ 'form_id' ] ) ) {
    7979            // ...populate the rest of the query string.
    8080            $form_id = '&form_id=' . $_GET[ 'form_id' ] . '&nf_form_filter&paged=1';
     
    141141    public function change_columns()
    142142    {
    143         $form_id = ( isset( $_GET['form_id'] ) ) ? $_GET['form_id'] : FALSE;
     143        // if the form_id isset and ID a number
     144        $form_id = ( isset( $_GET['form_id'] ) && ctype_digit( $_GET[ 'form_id' ] ) ) ? $_GET['form_id'] : FALSE;
    144145
    145146        if( ! $form_id ) return array();
     
    185186    public function custom_columns( $column, $sub_id )
    186187    {
     188        global $post_type;
     189       
     190        if ( 'nf_sub' !== $post_type ) return false;
     191
    187192        $sub = Ninja_Forms()->form()->get_sub( $sub_id );
    188193
     
    234239        asort($form_options);
    235240
    236         if( isset( $_GET[ 'form_id' ] ) ) {
     241
     242        // make sure form_id isset and is a number
     243        if( isset( $_GET[ 'form_id' ] ) && ctype_digit( $_GET[ 'form_id' ] ) ) {
    237244            $form_selected = $_GET[ 'form_id' ];
    238245        } else {
     
    241248
    242249        if( isset( $_GET[ 'begin_date' ] ) ) {
    243             $begin_date = $_GET[ 'begin_date' ];
     250            // check for bad characters(possible xss vulnerability)
     251            $beg_date_sep = preg_replace('/[0-9]+/', '', $_GET[ 'begin_date' ]);
     252
     253            if ( 1 !== count( array_unique( str_split( $beg_date_sep ) ) ) ) {// We got bad data.
     254                $begin_date = '';
     255            } else {
     256                $begin_date = $_GET[ 'begin_date' ];
     257            }
    244258        } else {
    245259            $begin_date = '';
     
    247261
    248262        if( isset( $_GET[ 'end_date' ] ) ) {
    249             $end_date = $_GET[ 'end_date' ];
     263            // check for bad characters(possible xss vulnerability)
     264            $end_date_sep = preg_replace('/[0-9]+/', '', $_GET[ 'end_date' ]);
     265
     266            if ( 1 !== count( array_unique( str_split( $end_date_sep ) ) ) ) {// We got bad data.
     267                $end_date = '';
     268            } else {
     269                $end_date = $_GET[ 'end_date' ];
     270            }
    250271        } else {
    251272            $end_date = '';
     
    266287        $vars = &$query->query_vars;
    267288
    268         $form_id = ( ! empty( $_GET['form_id'] ) ) ? $_GET['form_id'] : 0;
     289        // make sure form_id is not empty and is a number
     290        $form_id = ( ! empty( $_GET['form_id'] ) && ctype_digit( $_GET[ 'form_id' ] ) ) ? $_GET['form_id'] : 0;
    269291
    270292        $vars = $this->table_filter_by_form( $vars, $form_id );
     
    278300        global $typenow;
    279301        // filter to select search query
    280         if ( is_search() && is_admin() && $typenow == 'nf_sub' && isset ( $_GET['s'] ) ) {
     302        if ( isset ( $_GET['s'] ) && $typenow == 'nf_sub' && is_search() && is_admin() ) {
    281303            global $wpdb;
    282304
     
    378400            }
    379401
    380             Ninja_Forms()->form( $_REQUEST['form_id'] )->export_subs( $sub_ids );
     402            Ninja_Forms()->form( absint( $_REQUEST['form_id'] ) )->export_subs( $sub_ids );
    381403        }
    382404
     
    499521        // Include submissions on the end_date.
    500522        $end_date = date( 'm/d/Y', strtotime( '+1 day', strtotime( $end_date ) ) );
    501 
     523       
    502524        if ( ! isset ( $vars['date_query'] ) ) {
    503525
Note: See TracChangeset for help on using the changeset viewer.