Changeset 2664629
- Timestamp:
- 01/25/2022 02:34:25 PM (4 years ago)
- Location:
- wp-user/trunk/admin
- Files:
-
- 2 edited
-
class-admin-ajax-action.php (modified) (3 diffs)
-
view/view-addon.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wp-user/trunk/admin/class-admin-ajax-action.php
r2662040 r2664629 177 177 } 178 178 179 $userlist_arr = isset( $_POST['userlist'] ) ? (array) $_POST['userlist'] : array(); 180 $userlist_arr = $this->recursive_sanitize_text_field( $userlist_arr ); 181 179 182 $responce = array( 180 183 'status' => 1, 181 184 'message' => 'Setting has been updated', 182 'userlist' => $ _POST['userlist'],183 'bulk_action' => $_POST['bulk_action']185 'userlist' => $userlist_arr, 186 'bulk_action' => sanitize_text_field( $_POST['bulk_action'] ) 184 187 ); 185 188 186 189 if ($_POST['bulk_action'] == 'Export') { 187 190 $fields = (isset($_REQUEST['include_fields']) && !empty($_REQUEST['include_fields'])) ? explode(',', $_REQUEST['include_fields']) : array('ID', 'user_login', 'user_nicename', 'display_name', 'user_email', 'user_activation_key', 'user_registered'); 188 $include_users = (isset($_POST['userlist']) && !empty($_POST['userlist'])) ? $_POST['userlist'] : array(); 191 $include_users = (isset($_POST['userlist']) && !empty($_POST['userlist'])) ? (array) $_POST['userlist'] : array(); 192 $include_users = $this->recursive_sanitize_text_field( $include_users ); 189 193 $args = array( 190 194 'role' => '', … … 208 212 } else { 209 213 210 foreach ($_POST['userlist'] as $userlist) { 214 $include_users_arr = (isset($_POST['userlist']) && !empty($_POST['userlist'])) ? (array) $_POST['userlist'] : array(); 215 $include_users_arr = $this->recursive_sanitize_text_field( $include_users_arr ); 216 foreach ($include_users_arr as $userlist) { 211 217 if ($_POST['bulk_action'] == 'Approve') { 212 218 update_user_meta($userlist, 'wp-approve-user', 1); … … 273 279 } 274 280 281 function recursive_sanitize_text_field($array) { 282 foreach ( $array as $key => &$value ) { 283 if ( is_array( $value ) ) { 284 $value = $this->recursive_sanitize_text_field($value); 285 } 286 else { 287 $value = sanitize_text_field( $value ); 288 } 289 } 290 291 return $array; 292 } 293 275 294 } 276 295 endif; -
wp-user/trunk/admin/view/view-addon.php
r2662040 r2664629 182 182 </a> 183 183 184 <p><?php echo $addon['description']?></p>184 <p><?php echo wp_kses_post( $addon['description'] )?></p> 185 185 <p style="margin-bottom: 0"> 186 186 <a target="_blank"
Note: See TracChangeset
for help on using the changeset viewer.