PluginProbe
WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards / 5.5.84
WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards v5.5.84
5.5.84 5.5.83 5.5.82 5.5.81 5.5.80 5.5.79 5.5.77 5.5.76 5.5.75 5.5.73 5.5.72 5.5.22 5.5.23 5.5.29 5.5.3 5.5.31 5.5.32 5.5.34 5.5.35 5.5.36 5.5.37 5.5.4 5.5.40 5.5.41 5.5.42 All 160 releases
← All changes | WPDataAccess/API/WPDA_API_Core.php +14 -12 5.5.755.5.84 View file →
@@ -455,18 +455,20 @@
455 455 'type' => 'array',
456 456 'description' => __( 'Cron job parameters', 'wp-data-access' ),
457 457 'sanitize_callback' => function ( $param ) {
458 458 $params = array();
459 - foreach ( $param as $key => $value ) {
460 - if ( 'params' === $key || 'notify' === $key ) {
461 - // Sanitize custom parameters
462 - $custom_params = array();
463 - foreach ( $value as $param_key => $param_value ) {
464 - $custom_params[sanitize_text_field( $param_key )] = sanitize_text_field( $param_value );
459 + if ( is_array( $param ) ) {
460 + foreach ( $param as $key => $value ) {
461 + if ( 'params' === $key || 'notify' === $key ) {
462 + // Sanitize custom parameters
463 + $custom_params = array();
464 + foreach ( $value as $param_key => $param_value ) {
465 + $custom_params[sanitize_text_field( $param_key )] = sanitize_text_field( $param_value );
466 + }
467 + $params[sanitize_text_field( $key )] = $custom_params;
468 + } else {
469 + $params[sanitize_text_field( $key )] = sanitize_text_field( $value );
465 470 }
466 - $params[sanitize_text_field( $key )] = $custom_params;
467 - } else {
468 - $params[sanitize_text_field( $key )] = sanitize_text_field( $value );
469 471 }
470 472 }
471 473 return $params;
472 474 },
@@ -601,15 +603,16 @@
601 603 return $users;
602 604 }
603 605
604 606 protected function get_env() {
605 - return array(
606 - 'ip' => $_SERVER['REMOTE_ADDR'],
607 + $env = array(
608 + 'ip' => ( isset( $_SERVER['REMOTE_ADDR'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) ) : '' ),
607 609 'id' => WPDA::get_current_user_id(),
608 610 'user' => WPDA::get_current_user_login(),
609 611 'roles' => WPDA::get_current_user_roles(),
610 612 'login' => 'anonymous' !== WPDA::get_current_user_login(),
611 613 );
614 + return $env;
612 615 }
613 616
614 617 protected function get_table_info( $dbs, $tbl, $default_where = '' ) {
615 618 $wpdadb = WPDADB::get_db_connection( $dbs );
@@ -621,9 +624,8 @@
621 624 );
622 625 }
623 626 $query = $wpdadb->prepare( "\n\t\t\t\t\tselect table_type,\n\t\t\t\t\t engine,\n\t\t\t\t\t table_rows\n\t\t\t\t\t from information_schema.tables\n\t\t\t\t\t where table_schema = %s\n\t\t\t\t\t and table_name = %s\n\t\t\t\t", array($wpdadb->dbname, $tbl) );
624 627 $resultset = $wpdadb->get_results( $query, 'ARRAY_N' );
625 - // phpcs:ignore Standard.Category.SniffName.ErrorCode
626 628 if ( count( $resultset ) === 1 ) {
627 629 if ( null !== $resultset[0][2] ) {
628 630 return array(
629 631 'type' => $resultset[0][0],