Changeset 1605904
- Timestamp:
- 03/01/2017 11:59:09 AM (9 years ago)
- Location:
- delete-comments-by-status/trunk
- Files:
-
- 6 edited
-
admin/form-handler.php (modified) (2 diffs)
-
admin/main.php (modified) (1 diff)
-
admin/views/confirm-delete.php (modified) (1 diff)
-
functions.php (modified) (1 diff)
-
main.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
delete-comments-by-status/trunk/admin/form-handler.php
r1603497 r1605904 12 12 13 13 public function update_options() { 14 if ( ! isset($_POST['msbd_btn_confirm_comments_delete']) || $_POST['action']!='action-confirm-comments-delete' ) {14 if ( !isset($_POST['msbd_btn_confirm_comments_delete']) || $_POST['action']!='action-confirm-comments-delete' ) { 15 15 return; 16 16 } … … 29 29 $page_url = admin_url( 'admin.php?page=msbd-delete-comments' ); 30 30 31 $comment_statuses = explode(",", $_POST['msbd_comment_statuses']);31 $comment_statuses = explode(",", msbd_sanitization($_POST['msbd_comment_statuses'])); 32 32 $filter=""; 33 33 foreach($comment_statuses as $val) { -
delete-comments-by-status/trunk/admin/main.php
r1603497 r1605904 36 36 */ 37 37 public function plugin_pages() { 38 $page = isset($_GET['page']) ? $_GET['page']: '';39 $id = isset($_GET['id']) ? intval( $_GET['id']) : 0;38 $page = isset($_GET['page']) ? msbd_sanitization($_GET['page']) : ''; 39 $id = isset($_GET['id']) ? intval( msbd_sanitization($_GET['id']) ) : 0; 40 40 41 41 $action = 'dashboard'; 42 42 if (isset($_POST['action'])) { 43 $action = $_POST['action'];43 $action = msbd_sanitization($_POST['action']); 44 44 } elseif (isset($_GET['action'])) { 45 $action = $_GET['action'];45 $action = msbd_sanitization($_GET['action']); 46 46 } 47 47 -
delete-comments-by-status/trunk/admin/views/confirm-delete.php
r1603497 r1605904 17 17 $total_comments_delete = 0; 18 18 19 $submitValues = isset($_POST['msbd_comnts_statuses']) ? $_POST['msbd_comnts_statuses']: array();19 $submitValues = isset($_POST['msbd_comnts_statuses']) ? msbd_sanitization($_POST['msbd_comnts_statuses']) : array(); 20 20 $comment_statuses = msbddelcom_comment_statuses(); 21 21 -
delete-comments-by-status/trunk/functions.php
r1549808 r1605904 1 1 <?php 2 if (!function_exists('msbd_sanitization')) { 3 /* 4 * @ $field_type = title, text, email, number, html, no_html, custom_html, html_js default text 5 */ 6 function msbd_sanitization($data, $field_type='text', $oArray=array()) { 7 8 if( is_array($data) ) { 9 10 if( empty($data) ) 11 return $data; 12 else { 13 foreach($data as $i=>$v) { 14 $data[$i] = msbd_sanitization($v, $field_type, $oArray); 15 } 16 17 return $data; 18 } 19 } 20 21 $output = ''; 22 23 switch($field_type) { 24 case 'number': 25 $output = sanitize_text_field($data); 26 $output = intval($output); 27 break; 28 29 case 'boolean': 30 $var_permitted_values = array('y', 'n', 'true', 'false', '1', '0', 'yes', 'no'); 31 $output = in_array($data, $var_permitted_values) ? $data : 0;//returned false if not valid 32 break; 33 34 case 'email': 35 $output = sanitize_email($data); 36 $output = is_email($output);//returned false if not valid 37 break; 38 39 case 'textarea': 40 $output = esc_textarea($data); 41 break; 42 43 case 'html': 44 $output = wp_kses_post($data); 45 break; 46 47 case 'custom_html': 48 $allowedTags = isset($oArray['allowedTags']) ? $oArray['allowedTags'] : ""; 49 $output = wp_kses($data, $allowedTags); 50 break; 51 52 case 'no_html': 53 $output = strip_tags( $data ); 54 break; 55 56 57 case 'html_js': 58 $output = $data; 59 break; 60 61 case 'title': 62 $output = sanitize_title($data); 63 break; 64 65 case 'text': 66 default: 67 $output = sanitize_text_field($data); 68 break; 69 } 70 71 return $output; 72 } 73 } 74 75 2 76 function msbddelcom_comment_statuses() { 3 77 return array( 4 '0' => 'pending',5 'spam' => 'spam',6 'trash' => 'trash',7 '1' => 'approved',8 );78 '0' => 'pending', 79 'spam' => 'spam', 80 'trash' => 'trash', 81 '1' => 'approved', 82 ); 9 83 } 10 84 -
delete-comments-by-status/trunk/main.php
r1603497 r1605904 4 4 * Plugin URI: http://microsolutionsbd.com/ 5 5 * Description: Plugin to delete all comments by selecting the status (pending, spam, trash, approved) 6 * Version: 1.5. 26 * Version: 1.5.3 7 7 * Author: Micro Solutions Bangladesh 8 * Author URI: http://m cqacademy.com/author/shahalom/8 * Author URI: http://microsolutionsbd.com/ 9 9 * License: GPL2 10 10 * Text Domain: msbddelcom -
delete-comments-by-status/trunk/readme.txt
r1603497 r1605904 28 28 29 29 == Changelog == 30 31 = 1.5.3 = 32 33 * Fix more security issues 30 34 31 35 = 1.5.2 =
Note: See TracChangeset
for help on using the changeset viewer.