Plugin Directory

Changeset 3201393


Ignore:
Timestamp:
12/03/2024 07:20:48 AM (16 months ago)
Author:
gqevu6bsiz
Message:

1.24.1 2024-12-03

  • Updated: For WordPress 6.7.
  • Changed: How to get the wp version and offset seconds.
  • Changed: Late include the JS and CSS on admin and frontend and login.
  • Fixed: Escape and sanitize the some values.
Location:
my-wp/trunk
Files:
36 edited

Legend:

Unmodified
Added
Removed
  • my-wp/trunk/controller/abstract.controller.toolbar.module.php

    r2817427 r3201393  
    11081108    } elseif( $item_type === 'custom' ) {
    11091109
    1110       $item_meta['html'] = do_shortcode( $item->item_custom_html );
     1110      $item_meta['html'] = wp_kses_post( do_shortcode( $item->item_custom_html ) );
    11111111
    11121112    }
     
    11341134    } else {
    11351135
    1136       $title = sprintf( '<span class="%s">%s</span>' , esc_attr( $title_class ) , $item->item_link_title );
     1136      $title = sprintf( '<span class="%s">%s</span>' , esc_attr( $title_class ) , wp_kses_post( $item->item_link_title ) );
    11371137
    11381138    }
     
    11401140    if( empty( $node_group ) ) {
    11411141
    1142       $add_menu = array( 'id' => $node_id , 'title' => $title , 'parent' => $node_parent , 'href' => $item->item_link_url , 'meta' => $item_meta );
     1142      $add_menu = array( 'id' => $node_id , 'title' => wp_kses_post( $title ) , 'parent' => $node_parent , 'href' => $item->item_link_url , 'meta' => $item_meta );
    11431143
    11441144      $wp_admin_bar->add_menu( $add_menu );
  • my-wp/trunk/controller/modules/mywp.controller.module.admin.comments.php

    r3131405 r3201393  
    227227    }
    228228
     229    $wp_kses_allowed_html = wp_kses_allowed_html( 'post' );
     230
     231    $wp_kses_allowed_html['input'] = array(
     232      'type' => 1,
     233      'class' => 1,
     234      'id' => 1,
     235    );
     236
    229237    $columns = array();
    230238
    231239    foreach( $setting_data['list_columns'] as $column_id => $column_setting ) {
    232240
    233       $columns[ $column_id ] = $column_setting['title'];
     241      $columns[ $column_id ] = wp_kses( $column_setting['title'] , $wp_kses_allowed_html );
    234242
    235243    }
  • my-wp/trunk/controller/modules/mywp.controller.module.admin.dashboard.php

    r2890935 r3201393  
    159159    foreach( $hide_meta_boxes as $meta_box_id ) {
    160160
    161       printf( '.postbox#%s { height: 0; overflow: hidden; margin: 0; box-shadow: none; border: 0 none; }' , $meta_box_id );
     161      printf( '.postbox#%s { height: 0; overflow: hidden; margin: 0; box-shadow: none; border: 0 none; }' , esc_attr( $meta_box_id ) );
    162162
    163163    }
     
    169169    foreach( $hide_meta_boxes as $meta_box_id ) {
    170170
    171       printf( '$("#screen-options-wrap .metabox-prefs label[for=%s-hide]").css("display", "none");' , $meta_box_id );
     171      printf( '$("#screen-options-wrap .metabox-prefs label[for=%s-hide]").css("display", "none");' , esc_attr( $meta_box_id ) );
    172172
    173173    }
     
    349349          }
    350350
    351           $wp_meta_boxes['dashboard'][ $context ][ $priority ][ $meta_box_id ]['title'] = do_shortcode( $change_title_meta_boxes[ $meta_box_id ] );
     351          $wp_meta_boxes['dashboard'][ $context ][ $priority ][ $meta_box_id ]['title'] = wp_kses_post( do_shortcode( $change_title_meta_boxes[ $meta_box_id ] ) );
    352352
    353353        }
  • my-wp/trunk/controller/modules/mywp.controller.module.admin.general.php

    r3013938 r3201393  
    111111    add_action( 'admin_enqueue_scripts' , array( __CLASS__ , 'admin_enqueue_scripts' ) );
    112112
    113     add_action( 'admin_enqueue_scripts' , array( __CLASS__ , 'include_jc_css' ) );
     113    add_action( 'admin_enqueue_scripts' , array( __CLASS__ , 'include_jc_css' ) , 9999 );
    114114
    115115    add_action( 'admin_print_styles' , array( __CLASS__ , 'hide_screen_tabs' ) );
     
    472472  public static function custom_footer_text() {
    473473
    474     global $wp_version;
    475474    global $post;
    476475
     
    499498    add_filter( 'mywp_controller_admin_general_custom_footer_text' , 'prepend_attachment' );
    500499
    501     if( version_compare( $wp_version , '5.7.0' , '>=' ) ) {
     500    if( version_compare( MywpHelper::get_wp_version() , '5.7.0' , '>=' ) ) {
    502501
    503502      add_filter( 'mywp_controller_admin_general_custom_footer_text' , 'wp_replace_insecure_home_url' );
     
    507506    add_filter( 'mywp_controller_admin_general_custom_footer_text' , 'do_shortcode' , 11 );
    508507
    509     if( version_compare( $wp_version , '5.5.0' , '>=' ) ) {
     508    if( version_compare( MywpHelper::get_wp_version() , '5.5.0' , '>=' ) ) {
    510509
    511510      add_filter( 'mywp_controller_admin_general_custom_footer_text' , 'wp_filter_content_tags' , 12 );
     
    524523
    525524    <div id="mywp-custom-footer-text">
    526       <?php echo $custom_footer_text; ?>
     525      <?php echo wp_kses_post( $custom_footer_text ); ?>
    527526    </div>
    528527
  • my-wp/trunk/controller/modules/mywp.controller.module.admin.post.edit.php

    r2817427 r3201393  
    975975          }
    976976
    977           $wp_meta_boxes[ self::$post_type ][ $context ][ $priority ][ $meta_box_id ]['title'] = do_shortcode( $change_title_meta_boxes[ $meta_box_id ] );
     977          $wp_meta_boxes[ self::$post_type ][ $context ][ $priority ][ $meta_box_id ]['title'] = wp_kses_post( do_shortcode( $change_title_meta_boxes[ $meta_box_id ] ) );
    978978
    979979        }
  • my-wp/trunk/controller/modules/mywp.controller.module.admin.posts.php

    r3131405 r3201393  
    499499    }
    500500
     501    $wp_kses_allowed_html = wp_kses_allowed_html( 'post' );
     502
     503    $wp_kses_allowed_html['input'] = array(
     504      'type' => 1,
     505      'class' => 1,
     506      'id' => 1,
     507    );
     508
    501509    $columns = array();
    502510
    503511    foreach( $setting_data['list_columns'] as $column_id => $column_setting ) {
    504512
    505       $columns[ $column_id ] = do_shortcode( $column_setting['title'] );
     513      $columns[ $column_id ] = wp_kses( do_shortcode( $column_setting['title'] ) , $wp_kses_allowed_html );
    506514
    507515    }
     
    545553    } elseif( $column_id === 'mywp_column_slug' ) {
    546554
    547       echo sanitize_title( $post->post_name );
     555      echo esc_html( $post->post_name );
    548556
    549557    } elseif( $column_id === 'mywp_column_excerpt' ) {
     
    969977  }
    970978
    971   private static function get_post_statuses() {
     979  private static function get_post_statuses( $post_type = false ) {
    972980
    973981    global $wp_post_statuses;
     
    975983    $post_statuses = array();
    976984
     985    $post_type = MywpHelper::sanitize_text( $post_type );
     986
     987    if( empty( $post_type ) ) {
     988
     989      return $post_statuses;
     990
     991    }
     992
    977993    foreach( $wp_post_statuses as $post_status => $wp_post_status ) {
    978994
    979       /*
    980       if( ! in_array( $post_status , array( 'draft' , 'publish' , 'trash' , 'private' ) ) ) {
     995      if( in_array( $post_status , array( 'auto-draft' ) ) ) {
    981996
    982997        continue;
    983998
    984999      }
    985       */
    9861000
    9871001      $post_statuses[ $post_status ] = $wp_post_status->label;
     
    9891003    }
    9901004
     1005    $post_statuses = apply_filters( 'mywp_controller_admin_posts_get_post_statuses' , $post_statuses , $post_type );
     1006
     1007    $post_statuses = apply_filters( 'mywp_controller_admin_posts_get_post_statuses-' . $post_type , $post_statuses );
     1008
    9911009    return $post_statuses;
    9921010
     
    10311049      $post_status = MywpHelper::sanitize_text( $custom_search_filter_requests['mywp_custom_search_post_status'] );
    10321050
    1033       $post_statuses = self::get_post_statuses();
     1051      $post_statuses = self::get_post_statuses( self::$post_type );
    10341052
    10351053      if( ! empty( $post_statuses[ $post_status ] ) ) {
     
    11321150          'field' => 'term_id',
    11331151          'terms' => $term_ids,
    1134           'operator' => 'AND',
     1152          'operator' => 'IN',
    11351153        );
    11361154
     
    11821200    );
    11831201
    1184     $post_statuses = self::get_post_statuses();
     1202    $post_statuses = self::get_post_statuses( self::$post_type );
    11851203
    11861204    $custom_search_filter_fields['mywp_custom_search_post_status']['choices'] = $post_statuses;
  • my-wp/trunk/controller/modules/mywp.controller.module.admin.sidebar.php

    r3013938 r3201393  
    10031003    if( $item_type === 'custom' ) {
    10041004
    1005       echo do_shortcode( $item->item_custom_html );
     1005      echo wp_kses_post( do_shortcode( $item->item_custom_html ) );
    10061006
    10071007    } elseif( $item_type === 'separator' ) {
     
    10831083      } elseif( ! empty( $icon_class ) or ! empty( $icon_style ) or ! empty( $icon_id ) ) {
    10841084
    1085         printf( '<div class="wp-menu-image mywp-sidebar-item-icon %s" id="%s" style="%s">%s</div>'  , esc_attr( $icon_class ) , esc_attr( $icon_id ) , $icon_style , $icon_title );
     1085        printf( '<div class="wp-menu-image mywp-sidebar-item-icon %s" id="%s" style="%s">%s</div>'  , esc_attr( $icon_class ) , esc_attr( $icon_id ) , esc_attr( $icon_style ) , wp_kses_post( $icon_title ) );
    10861086
    10871087      } else {
     
    10911091      }
    10921092
    1093       printf( '<div class="wp-menu-name mywp-sidebar-name">%s</div>' , $item->item_link_title );
     1093      printf( '<div class="wp-menu-name mywp-sidebar-name">%s</div>' , wp_kses_post( $item->item_link_title ) );
    10941094
    10951095      echo '</a>';
     
    11011101        echo '<ul class="wp-submenu wp-submenu-wrap mywp-sidebar-item-childs">';
    11021102
    1103         printf( '<li class="wp-submenu-head" aria-hidden="true">%s</li>' , $item->item_link_title );
     1103        printf( '<li class="wp-submenu-head" aria-hidden="true">%s</li>' , wp_kses_post( $item->item_link_title ) );
    11041104
    11051105        foreach( $child_items as $child_item ) {
  • my-wp/trunk/controller/modules/mywp.controller.module.admin.terms.php

    r3131405 r3201393  
    330330    }
    331331
     332    $wp_kses_allowed_html = wp_kses_allowed_html( 'post' );
     333
     334    $wp_kses_allowed_html['input'] = array(
     335      'type' => 1,
     336      'class' => 1,
     337      'id' => 1,
     338    );
     339
    332340    $columns = array();
    333341
    334342    foreach( $setting_data['list_columns'] as $column_id => $column_setting ) {
    335343
    336       $columns[ $column_id ] = do_shortcode( $column_setting['title'] );
     344      $columns[ $column_id ] = wp_kses( do_shortcode( $column_setting['title'] ) , $wp_kses_allowed_html );
    337345
    338346    }
  • my-wp/trunk/controller/modules/mywp.controller.module.admin.uploads.php

    r3131405 r3201393  
    367367    }
    368368
     369    $wp_kses_allowed_html = wp_kses_allowed_html( 'post' );
     370
     371    $wp_kses_allowed_html['input'] = array(
     372      'type' => 1,
     373      'class' => 1,
     374      'id' => 1,
     375    );
     376
    369377    $columns = array();
    370378
    371379    foreach( $setting_data['list_columns'] as $column_id => $column_setting ) {
    372380
    373       $columns[ $column_id ] = $column_setting['title'];
     381      $columns[ $column_id ] = wp_kses( $column_setting['title'] , $wp_kses_allowed_html );
    374382
    375383    }
  • my-wp/trunk/controller/modules/mywp.controller.module.admin.users.php

    r3131405 r3201393  
    236236    }
    237237
     238    $wp_kses_allowed_html = wp_kses_allowed_html( 'post' );
     239
     240    $wp_kses_allowed_html['input'] = array(
     241      'type' => 1,
     242      'class' => 1,
     243      'id' => 1,
     244    );
     245
    238246    $columns = array();
    239247
    240248    foreach( $setting_data['list_columns'] as $column_id => $column_setting ) {
    241249
    242       $columns[ $column_id ] = $column_setting['title'];
     250      $columns[ $column_id ] = wp_kses( $column_setting['title'] , $wp_kses_allowed_html );
    243251
    244252    }
  • my-wp/trunk/controller/modules/mywp.controller.module.frontend.general.php

    r3013938 r3201393  
    103103    add_action( 'wp_head' , array( __CLASS__ , 'wp_head' ) );
    104104
    105     add_action( 'wp_enqueue_scripts' , array( __CLASS__ , 'wp_enqueue_scripts' ) );
     105    add_action( 'wp_enqueue_scripts' , array( __CLASS__ , 'include_jc_css' ) , 9999 );
    106106
    107107  }
     
    411411  }
    412412
    413   public static function wp_enqueue_scripts() {
     413  public static function include_jc_css() {
    414414
    415415    if( ! self::is_do_function( __FUNCTION__ ) ) {
  • my-wp/trunk/controller/modules/mywp.controller.module.login.general.php

    r3013938 r3201393  
    4545  public static function mywp_wp_loaded() {
    4646
    47     global $wp_version;
    48 
    4947    if( is_admin() ) {
    5048
     
    5957    }
    6058
    61     add_action( 'login_enqueue_scripts' , array( __CLASS__ , 'include_css' ) );
     59    add_action( 'login_enqueue_scripts' , array( __CLASS__ , 'include_css' ) , 9999 );
    6260
    6361    add_action( 'wp_print_scripts' , array( __CLASS__ , 'input_css' ) );
     
    6967    add_filter( 'login_headerurl' , array( __CLASS__ , 'logo_link_url' ) );
    7068
    71     if( version_compare( $wp_version , '5.2.0' , '>=' ) ) {
     69    if( version_compare( MywpHelper::get_wp_version() , '5.2.0' , '>=' ) ) {
    7270
    7371      add_filter( 'login_headertext' , array( __CLASS__ , 'logo_title' ) );
     
    163161    if( ! empty( $logo_image_path ) ) {
    164162
    165       printf( '.login h1 a { background-image: url(%s); }' , esc_attr( $logo_image_path ) );
     163      printf( '.login h1 a, .login .wp-login-logo a { background-image: url(%s); }' , esc_attr( $logo_image_path ) );
    166164
    167165    }
     
    271269  public static function custom_footer_text() {
    272270
    273     global $wp_version;
    274271    global $post;
    275272
     
    298295    add_filter( 'mywp_controller_login_general_custom_footer_text' , 'prepend_attachment' );
    299296
    300     if( version_compare( $wp_version , '5.7.0' , '>=' ) ) {
     297    if( version_compare( MywpHelper::get_wp_version() , '5.7.0' , '>=' ) ) {
    301298
    302299      add_filter( 'mywp_controller_login_general_custom_footer_text' , 'wp_replace_insecure_home_url' );
     
    306303    add_filter( 'mywp_controller_login_general_custom_footer_text' , 'do_shortcode' , 11 );
    307304
    308     if( version_compare( $wp_version , '5.5.0' , '>=' ) ) {
     305    if( version_compare( MywpHelper::get_wp_version() , '5.5.0' , '>=' ) ) {
    309306
    310307      add_filter( 'mywp_controller_login_general_custom_footer_text' , 'wp_filter_content_tags' , 12 );
     
    317314
    318315    <div id="mywp-custom-footer-text">
    319       <?php echo $custom_footer_text; ?>
     316      <?php echo wp_kses_post( $custom_footer_text ); ?>
    320317    </div>
    321318
  • my-wp/trunk/core/class.helper.php

    r3131405 r3201393  
    257257  }
    258258
     259  public static function get_gmt_offset_seconds() {
     260
     261    $gmt_offset = (float) get_option( 'gmt_offset' );
     262
     263    $gmt_offset_seconds = (int) ( $gmt_offset * HOUR_IN_SECONDS );
     264
     265    return $gmt_offset_seconds;
     266
     267  }
     268
     269  public static function get_wp_version() {
     270
     271    global $wp_version;
     272
     273    if( function_exists( 'wp_get_wp_version' ) ) {
     274
     275      $version = wp_get_wp_version();
     276
     277    } else {
     278
     279      $version = $wp_version;
     280
     281    }
     282
     283    return $wp_version;
     284
     285  }
     286
    259287  public static function sanitize_text( $value ) {
    260288
  • my-wp/trunk/developer/modules/mywp.developer.module.core.environment.php

    r3131405 r3201393  
    3030  protected static function get_debug_lists() {
    3131
    32     global $wp_version;
    33 
    3432    $debug_lists = array();
    3533
     
    5957    }
    6058
    61     $debug_lists['$wp_version'] = $wp_version;
     59    $debug_lists['wp_version'] = MywpHelper::get_wp_version();
    6260    $debug_lists['is_multisite()'] = is_multisite();
    6361    $debug_lists['PHP_VERSION'] = PHP_VERSION;
  • my-wp/trunk/mywp.php

    r3131405 r3201393  
    44Plugin URI: https://mywpcustomize.com/
    55Description: My WP is powerful admin and frontend customize and debug and extendable plugin.
    6 Version: 1.24.0
     6Version: 1.24.1
    77Author: gqevu6bsiz
    88Author URI: https://mywpcustomize.com/
     
    4343
    4444    define( 'MYWP_NAME' , 'My WP' );
    45     define( 'MYWP_VERSION' , '1.24.0' );
     45    define( 'MYWP_VERSION' , '1.24.1' );
    4646    define( 'MYWP_PLUGIN_FILE' , __FILE__ );
    4747    define( 'MYWP_PLUGIN_BASENAME' , plugin_basename( MYWP_PLUGIN_FILE ) );
     
    8383  private static function do_action() {
    8484
    85     global $wp_version;
    86 
    87     $wp_compare = version_compare( $wp_version , MYWP_REQUIRED_WP_VERSION , '>=' );
     85    $wp_compare = version_compare( MywpHelper::get_wp_version() , MYWP_REQUIRED_WP_VERSION , '>=' );
    8886
    8987    if( ! $wp_compare ) {
  • my-wp/trunk/post-type/modules/mywp.post-type.module.admin.sidebar.php

    r2641658 r3201393  
    9595      if( $mywp_post->menu_order ) {
    9696
    97         echo $mywp_post->menu_order;
     97        echo esc_html( $mywp_post->menu_order );
    9898
    9999      }
     
    103103      if( $mywp_post->ID ) {
    104104
    105         echo $mywp_post->ID;
     105        echo esc_html( $mywp_post->ID );
    106106
    107107      }
     
    111111      if( $mywp_post->item_parent ) {
    112112
    113         echo $mywp_post->item_parent;
     113        echo esc_html( $mywp_post->item_parent );
    114114
    115115      }
     
    119119      if( $mywp_post->item_type ) {
    120120
    121         echo $mywp_post->item_type;
     121        echo esc_html( $mywp_post->item_type );
    122122
    123123      }
     
    127127      if( $mywp_post->item_link_title ) {
    128128
    129         echo $mywp_post->item_link_title;
     129        echo esc_html( $mywp_post->item_link_title );
    130130
    131131      }
     
    133133    } elseif( $column_name === 'info' ) {
    134134
    135       printf( '<textarea class="large-text" readonly="readonly">%s</textarea>' , print_r( $mywp_post , true ) );
     135      printf( '<textarea class="large-text" readonly="readonly">%s</textarea>' , esc_textarea( print_r( $mywp_post , true ) ) );
    136136
    137137    }
  • my-wp/trunk/post-type/modules/mywp.post-type.module.admin.toolbar.php

    r2641658 r3201393  
    9595      if( $mywp_post->menu_order ) {
    9696
    97         echo $mywp_post->menu_order;
     97        echo esc_html( $mywp_post->menu_order );
    9898
    9999      }
     
    103103      if( $mywp_post->ID ) {
    104104
    105         echo $mywp_post->ID;
     105        echo esc_html( $mywp_post->ID );
    106106
    107107      }
     
    111111      if( $mywp_post->item_parent ) {
    112112
    113         echo $mywp_post->item_parent;
     113        echo esc_html( $mywp_post->item_parent );
    114114
    115115      }
     
    119119      if( $mywp_post->item_type ) {
    120120
    121         echo $mywp_post->item_type;
     121        echo esc_html( $mywp_post->item_type );
    122122
    123123      }
     
    127127      if( $mywp_post->item_link_title ) {
    128128
    129         echo $mywp_post->item_link_title;
     129        echo esc_html( $mywp_post->item_link_title );
    130130
    131131      }
     
    133133    } elseif( $column_name === 'info' ) {
    134134
    135       printf( '<textarea class="large-text" readonly="readonly">%s</textarea>' , print_r( $mywp_post , true ) );
     135      printf( '<textarea class="large-text" readonly="readonly">%s</textarea>' , esc_textarea( print_r( $mywp_post , true ) ) );
    136136
    137137    }
  • my-wp/trunk/post-type/modules/mywp.post-type.module.front.toolbar.php

    r2641658 r3201393  
    9595      if( $mywp_post->menu_order ) {
    9696
    97         echo $mywp_post->menu_order;
     97        echo esc_html( $mywp_post->menu_order );
    9898
    9999      }
     
    103103      if( $mywp_post->ID ) {
    104104
    105         echo $mywp_post->ID;
     105        echo esc_html( $mywp_post->ID );
    106106
    107107      }
     
    111111      if( $mywp_post->item_parent ) {
    112112
    113         echo $mywp_post->item_parent;
     113        echo esc_html( $mywp_post->item_parent );
    114114
    115115      }
     
    119119      if( $mywp_post->item_type ) {
    120120
    121         echo $mywp_post->item_type;
     121        echo esc_html( $mywp_post->item_type );
    122122
    123123      }
     
    133133        }
    134134
    135         echo $mywp_post->item_link_title;
     135        echo esc_html( $mywp_post->item_link_title );
    136136
    137137      }
     
    139139    } elseif( $column_name === 'info' ) {
    140140
    141       printf( '<textarea class="large-text" readonly="readonly">%s</textarea>' , print_r( $mywp_post , true ) );
     141      printf( '<textarea class="large-text" readonly="readonly">%s</textarea>' , esc_textarea( print_r( $mywp_post , true ) ) );
    142142
    143143    }
  • my-wp/trunk/post-type/modules/mywp.post-type.module.logger.php

    r2641658 r3201393  
    146146    } elseif( $column_name === 'log' ) {
    147147
    148       printf( '<textarea class="large-text" readonly="readonly">%s</textarea>' , print_r( $mywp_post->log , true ) );
     148      printf( '<textarea class="large-text" readonly="readonly">%s</textarea>' , esc_textarea( print_r( $mywp_post->log , true ) ) );
    149149
    150150    }
  • my-wp/trunk/readme.txt

    r3131405 r3201393  
    33Tags: admin, frontend, debug, sidebar, toolbar
    44Requires at least: 4.7
    5 Tested up to: 6.6
     5Tested up to: 6.7
    66Requires PHP: 5.6
    7 Stable tag: 1.24.0
     7Stable tag: 1.24.1
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    9393== Changelog ==
    9494
     95= 1.24.1 2024-12-03 =
     96* Updated: For WordPress 6.7.
     97* Changed: How to get the wp version and offset seconds.
     98* Changed: Late include the JS and CSS on admin and frontend and login.
     99* Fixed: Escape and sanitize the some values.
     100
    95101= 1.24.0 2024-08-06 =
    96102* Added: Deprecated list columns on Posts, Comments, Users, Uploads, Terms.
  • my-wp/trunk/setting/abstract.setting.columns.module.php

    r3131405 r3201393  
    517517    }
    518518
     519    $wp_kses_allowed_html = wp_kses_allowed_html( 'post' );
     520
     521    $wp_kses_allowed_html['input'] = array(
     522      'type' => 1,
     523      'class' => 1,
     524      'id' => 1,
     525    );
     526
    519527    ?>
    520528
     
    529537          <?php if( ! empty( $column['title'] ) ) : ?>
    530538
    531             <?php echo strip_shortcodes( $column['title'] ); ?>
     539            <?php echo wp_kses( strip_shortcodes( $column['title'] ) , $wp_kses_allowed_html ); ?>
    532540
    533541          <?php endif; ?>
     
    539547          <?php if( ! empty( $column['default_title'] ) ) : ?>
    540548
    541             (<?php echo esc_attr( $column['default_title'] ); ?>)
     549            (<?php echo esc_html( $column['default_title'] ); ?>)
    542550
    543551          <?php endif; ?>
  • my-wp/trunk/setting/abstract.setting.toolbar.module.php

    r3013938 r3201393  
    444444      } elseif( in_array( $meta_key , array( 'item_link_title' , 'item_custom_html' , 'item_icon_title' ) ) ) {
    445445
    446         $meta_value = wp_unslash( $meta_value );
     446        $meta_value = wp_unslash( wp_kses_post( $meta_value ) );
    447447
    448448      } elseif( in_array( $meta_key , array( 'item_location' ) ) ) {
     
    27652765    } elseif( $field_name === 'item_custom_html' ) {
    27662766
    2767       printf( '<textarea class="item_custom_html large-text" placeholder="%s">%s</textarea>' , esc_attr( '<div class="" style="">Custom HTML</div>...' ) , $value );
     2767      printf( '<textarea class="item_custom_html large-text" placeholder="%s">%s</textarea>' , esc_attr( '<div class="" style="">Custom HTML</div>...' ) , esc_textarea( wp_kses_post( $value ) ) );
    27682768
    27692769    } elseif( $field_name === 'item_li_class' ) {
     
    27892789      }
    27902790
    2791       printf( '<input type="text" class="item_link_title large-text" value="%s" placeholder="%s" />' , esc_attr( $value ) , esc_attr( $default_title ) );
     2791      printf( '<input type="text" class="item_link_title large-text" value="%s" placeholder="%s" />' , esc_attr( wp_kses_post( $value ) ) , esc_attr( $default_title ) );
    27922792
    27932793    } elseif( $field_name === 'item_link_attr' ) {
     
    28142814    } elseif( $field_name === 'item_icon_title' ) {
    28152815
    2816       printf( '<input type="text" class="item_icon_title large-text" value="%s" placeholder="%s" />' , esc_attr( $value ) , esc_attr( 'Icon Html' ) );
     2816      printf( '<input type="text" class="item_icon_title large-text" value="%s" placeholder="%s" />' , esc_attr( wp_kses_post( $value ) ) , esc_attr( 'Icon Html' ) );
    28172817
    28182818    } elseif( $field_name === 'item_meta' ) {
  • my-wp/trunk/setting/modules/mywp.setting.admin.comments.php

    r3131405 r3201393  
    497497    if( ! empty( $formatted_data['list_columns'] ) ) {
    498498
     499      $wp_kses_allowed_html = wp_kses_allowed_html( 'post' );
     500
     501      $wp_kses_allowed_html['input'] = array(
     502        'type' => 1,
     503        'class' => 1,
     504        'id' => 1,
     505      );
     506
    499507      foreach( $formatted_data['list_columns'] as $list_column_id => $list_column_setting ) {
    500508
     
    511519        if( ! empty( $list_column_setting['title'] ) ) {
    512520
    513           $new_list_column_setting['title'] = wp_unslash( $list_column_setting['title'] );
     521          $new_list_column_setting['title'] = wp_unslash( wp_kses( $list_column_setting['title'] , $wp_kses_allowed_html ) );
    514522
    515523        }
  • my-wp/trunk/setting/modules/mywp.setting.admin.dashboard.php

    r2890935 r3201393  
    120120        if( ! empty( $meta_box_setting['title'] ) ) {
    121121
    122           $new_meta_box_setting['title'] = wp_unslash( $meta_box_setting['title'] );
     122          $new_meta_box_setting['title'] = wp_unslash( wp_kses_post( $meta_box_setting['title'] ) );
    123123
    124124        }
  • my-wp/trunk/setting/modules/mywp.setting.admin.general.php

    r2655597 r3201393  
    308308    if( ! empty( $formatted_data['custom_footer_text'] ) ) {
    309309
    310       $new_formatted_data['custom_footer_text'] = wp_unslash( $formatted_data['custom_footer_text'] );
     310      $new_formatted_data['custom_footer_text'] = wp_unslash( wp_kses_post( $formatted_data['custom_footer_text'] ) );
    311311
    312312    }
  • my-wp/trunk/setting/modules/mywp.setting.admin.post-edit.php

    r3001445 r3201393  
    500500        if( ! empty( $meta_box_setting['title'] ) ) {
    501501
    502           $new_meta_box_setting['title'] = wp_unslash( $meta_box_setting['title'] );
     502          $new_meta_box_setting['title'] = wp_unslash( wp_kses_post( $meta_box_setting['title'] ) );
    503503
    504504        }
  • my-wp/trunk/setting/modules/mywp.setting.admin.posts.php

    r3131405 r3201393  
    829829    if( ! empty( $formatted_data['list_columns'] ) ) {
    830830
     831      $wp_kses_allowed_html = wp_kses_allowed_html( 'post' );
     832
     833      $wp_kses_allowed_html['input'] = array(
     834        'type' => 1,
     835        'class' => 1,
     836        'id' => 1,
     837      );
     838
    831839      foreach( $formatted_data['list_columns'] as $list_column_id => $list_column_setting ) {
    832840
     
    843851        if( ! empty( $list_column_setting['title'] ) ) {
    844852
    845           $new_list_column_setting['title'] = wp_unslash( $list_column_setting['title'] );
     853          $new_list_column_setting['title'] = wp_unslash( wp_kses( $list_column_setting['title'] , $wp_kses_allowed_html ) );
    846854
    847855        }
  • my-wp/trunk/setting/modules/mywp.setting.admin.sidebar.php

    r3013938 r3201393  
    421421      } elseif( in_array( $meta_key , array( 'item_link_title' , 'item_custom_html' , 'item_icon_title' ) ) ) {
    422422
    423         $meta_value = wp_unslash( $meta_value );
     423        $meta_value = wp_unslash( wp_kses_post( $meta_value ) );
    424424
    425425      } else {
     
    25052505    } elseif( $field_name === 'item_custom_html' ) {
    25062506
    2507       printf( '<textarea class="item_custom_html large-text" placeholder="%s">%s</textarea>' , esc_attr( '<div class="" style="">Custom HTML</div>...' ) , $value );
     2507      printf( '<textarea class="item_custom_html large-text" placeholder="%s">%s</textarea>' , esc_attr( '<div class="" style="">Custom HTML</div>...' ) , esc_textarea( wp_kses_post( $value ) ) );
    25082508
    25092509    } elseif( $field_name === 'item_li_class' ) {
     
    25372537      }
    25382538
    2539       printf( '<input type="text" class="item_link_title large-text" value="%s" placeholder="%s" />' , esc_attr( $value ) , esc_attr( $default_title ) );
     2539      printf( '<input type="text" class="item_link_title large-text" value="%s" placeholder="%s" />' , esc_attr( wp_kses_post( $value ) ) , esc_attr( $default_title ) );
    25402540
    25412541    } elseif( $field_name === 'item_link_attr' ) {
     
    25622562    } elseif( $field_name === 'item_icon_title' ) {
    25632563
    2564       printf( '<input type="text" class="item_icon_title large-text" value="%s" placeholder="%s" />' , esc_attr( $value ) , esc_attr( 'Icon Html' ) );
     2564      printf( '<input type="text" class="item_icon_title large-text" value="%s" placeholder="%s" />' , esc_attr( wp_kses_post( $value ) ) , esc_attr( 'Icon Html' ) );
    25652565
    25662566    } else {
  • my-wp/trunk/setting/modules/mywp.setting.admin.terms.php

    r3131405 r3201393  
    623623    if( ! empty( $formatted_data['list_columns'] ) ) {
    624624
     625      $wp_kses_allowed_html = wp_kses_allowed_html( 'post' );
     626
     627      $wp_kses_allowed_html['input'] = array(
     628        'type' => 1,
     629        'class' => 1,
     630        'id' => 1,
     631      );
     632
    625633      foreach( $formatted_data['list_columns'] as $list_column_id => $list_column_setting ) {
    626634
     
    637645        if( ! empty( $list_column_setting['title'] ) ) {
    638646
    639           $new_list_column_setting['title'] = wp_unslash( $list_column_setting['title'] );
     647          $new_list_column_setting['title'] = wp_unslash( wp_kses( $list_column_setting['title'] , $wp_kses_allowed_html ) );
    640648
    641649        }
  • my-wp/trunk/setting/modules/mywp.setting.admin.uploads.php

    r3131405 r3201393  
    546546    if( ! empty( $formatted_data['list_columns'] ) ) {
    547547
     548      $wp_kses_allowed_html = wp_kses_allowed_html( 'post' );
     549
     550      $wp_kses_allowed_html['input'] = array(
     551        'type' => 1,
     552        'class' => 1,
     553        'id' => 1,
     554      );
     555
    548556      foreach( $formatted_data['list_columns'] as $list_column_id => $list_column_setting ) {
    549557
     
    560568        if( ! empty( $list_column_setting['title'] ) ) {
    561569
    562           $new_list_column_setting['title'] = wp_unslash( $list_column_setting['title'] );
     570          $new_list_column_setting['title'] = wp_unslash( wp_kses( $list_column_setting['title'] , $wp_kses_allowed_html ) );
    563571
    564572        }
  • my-wp/trunk/setting/modules/mywp.setting.admin.users.php

    r3131405 r3201393  
    528528    if( ! empty( $formatted_data['list_columns'] ) ) {
    529529
     530      $wp_kses_allowed_html = wp_kses_allowed_html( 'post' );
     531
     532      $wp_kses_allowed_html['input'] = array(
     533        'type' => 1,
     534        'class' => 1,
     535        'id' => 1,
     536      );
     537
    530538      foreach( $formatted_data['list_columns'] as $list_column_id => $list_column_setting ) {
    531539
     
    542550        if( ! empty( $list_column_setting['title'] ) ) {
    543551
    544           $new_list_column_setting['title'] = wp_unslash( $list_column_setting['title'] );
     552          $new_list_column_setting['title'] = wp_unslash( wp_kses( $list_column_setting['title'] , $wp_kses_allowed_html ) );
    545553
    546554        }
  • my-wp/trunk/setting/modules/mywp.setting.debug.crons.php

    r2655597 r3201393  
    5050
    5151    $timezone_format = _x( 'Y-m-d H:i:s' , 'timezone date format' );
    52     $offset = get_option( 'gmt_offset' ) * HOUR_IN_SECONDS;
    5352    $timezone = get_option( 'timezone_string' );
    5453
     
    6766          <tr>
    6867            <th>
    69               <?php echo key( $cron ); ?>
     68              <?php echo esc_html( key( $cron ) ); ?>
    7069            </th>
    7170            <td>
    72               <p><?php echo date( $timezone_format , $timestamp + $offset ); ?> (<?php echo $timezone; ?>)</p>
     71              <p><?php echo date( $timezone_format , $timestamp + MywpHelper::get_gmt_offset_seconds() ); ?> (<?php echo $timezone; ?>)</p>
    7372              <input type="text" readonly="readonly" class="large-text" value="<?php echo esc_attr( $timestamp ); ?>" /><br />
    7473              <?php _e( 'RAW' ); ?>: <?php echo date( $timezone_format , $timestamp ); ?> (<?php _e( 'UTC' ); ?>)
    7574            </td>
    7675            <td>
    77               <textarea readonly="readonly" class="large-text" style="height: 160px;"><?php print_r( $cron ); ?></textarea>
     76              <textarea readonly="readonly" class="large-text" style="height: 160px;"><?php echo esc_textarea( print_r( $cron , true ) ); ?></textarea>
    7877            </td>
    7978          </tr>
  • my-wp/trunk/setting/modules/mywp.setting.debug.datetime.php

    r2641658 r3201393  
    7474        <tr>
    7575          <th>date( "Y-m-d H:i:s" , time() + ( get_option( "gmt_offset" ) * HOUR_IN_SECONDS ) )</th>
    76           <td><?php echo date( "Y-m-d H:i:s" , time() + ( get_option( "gmt_offset" ) * HOUR_IN_SECONDS ) ); ?></td>
     76          <td><?php echo date( "Y-m-d H:i:s" , time() + MywpHelper::get_gmt_offset_seconds() ); ?></td>
    7777        </tr>
    7878        <tr>
  • my-wp/trunk/setting/modules/mywp.setting.debug.transients.php

    r2655597 r3201393  
    200200
    201201    $timezone_format = _x( 'Y-m-d H:i:s' , 'timezone date format' );
    202     $offset = get_option( 'gmt_offset' ) * HOUR_IN_SECONDS;
    203202    $timezone = get_option( 'timezone_string' );
    204203
     
    232231            <td>
    233232              <?php if( ! empty( $transient['timeout'] ) ) : ?>
    234                 <p><?php echo date( $timezone_format , $transient['timeout']['value'] + $offset ); ?> (<?php echo $timezone; ?>)</p>
     233                <p><?php echo date( $timezone_format , $transient['timeout']['value'] + MywpHelper::get_gmt_offset_seconds() ); ?> (<?php echo $timezone; ?>)</p>
    235234                <input type="text" readonly="readonly" class="large-text" value="<?php echo esc_attr( $transient['timeout']['value'] ); ?>" /><br />
    236235              <?php else : ?>
     
    245244            </td>
    246245            <td>
    247               <textarea readonly="readonly" class="large-text" style="height: 160px;"><?php print_r( maybe_unserialize( $transient['value'] ) ); ?></textarea>
     246              <textarea readonly="readonly" class="large-text" style="height: 160px;"><?php echo esc_textarea( print_r( maybe_unserialize( $transient['value'] ) , true ) ); ?></textarea>
    248247            </td>
    249248          </tr>
  • my-wp/trunk/setting/modules/mywp.setting.login.general.php

    r2677466 r3201393  
    206206    if( ! empty( $formatted_data['custom_footer_text'] ) ) {
    207207
    208       $new_formatted_data['custom_footer_text'] = wp_unslash( $formatted_data['custom_footer_text'] );
     208      $new_formatted_data['custom_footer_text'] = wp_unslash( wp_kses_post( $formatted_data['custom_footer_text'] ) );
    209209
    210210    }
  • my-wp/trunk/setting/modules/mywp.setting.update.bulk-post-meta.php

    r3122381 r3201393  
    962962                <input type="checkbox" class="update-bulk-post-meta-select-post-id" value="<?php echo esc_attr( $post_id ); ?>" />
    963963              </th>
    964               <td class="id"><?php echo $post_id; ?></td>
    965               <td class="type"><?php echo strip_tags( $post->post_type ); ?></td>
    966               <td class="status"><?php echo strip_tags( $post->post_status ); ?></td>
    967               <td class="title"><?php echo strip_tags( $post->post_title ); ?></td>
    968               <td class="metas"><textarea readonly class="large-text"><?php print_r( get_post_meta( $post_id ) ); ?></textarea></td>
     964              <td class="id"><?php echo esc_html( $post_id ); ?></td>
     965              <td class="type"><?php echo esc_html( $post->post_type ); ?></td>
     966              <td class="status"><?php echo esc_html( $post->post_status ); ?></td>
     967              <td class="title"><?php echo esc_html( $post->post_title ); ?></td>
     968              <td class="metas"><textarea readonly class="large-text"><?php echo esc_textarea( print_r( get_post_meta( $post_id ) , true ) ); ?></textarea></td>
    969969            </tr>
    970970
     
    10201020          <td class="from-meta">
    10211021            <?php if( is_array( $from_meta_value ) or is_object( $from_meta_value ) ) : ?>
    1022               <textarea class="large-text" readonly="readonly"><?php print_r( $from_meta_value ); ?></textarea>
     1022              <textarea class="large-text" readonly="readonly"><?php echo esc_textarea( print_r( $from_meta_value , true ) ); ?></textarea>
    10231023            <?php else : ?>
    10241024              <?php echo esc_html( $from_meta_value ); ?>
     
    10301030          <td class="to-meta">
    10311031            <?php if( is_array( $bulk_meta_value_unserialize ) or is_object( $bulk_meta_value_unserialize ) ) : ?>
    1032               <textarea class="large-text" readonly="readonly"><?php print_r( $bulk_meta_value_unserialize ); ?></textarea>
     1032              <textarea class="large-text" readonly="readonly"><?php echo esc_textarea( print_r( $bulk_meta_value_unserialize , true ) ); ?></textarea>
    10331033            <?php else : ?>
    10341034              <?php echo esc_html( $bulk_meta_value ); ?>
     
    10451045  }
    10461046
    1047 
    10481047}
    10491048
Note: See TracChangeset for help on using the changeset viewer.