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 +19 -15 5.5.725.5.84 View file →
@@ -442,11 +442,13 @@
442 442 'validate_callback' => 'rest_validate_request_arg',
443 443 ),
444 444 'vqb' => array(
445 445 'required' => false,
446 - 'type' => 'boolean',
447 - 'description' => __( 'Query uses Visual Query Builder', 'wp-data-access' ),
448 - 'sanitize_callback' => 'sanitize_text_field',
446 + 'type' => 'mixed',
447 + 'description' => __( 'Visual Query Builder', 'wp-data-access' ),
448 + 'sanitize_callback' => function ( $param ) {
449 + return rest_sanitize_object( $param );
450 + },
449 451 'validate_callback' => 'rest_validate_request_arg',
450 452 ),
451 453 'params' => array(
452 454 'required' => false,
@@ -453,18 +455,20 @@
453 455 'type' => 'array',
454 456 'description' => __( 'Cron job parameters', 'wp-data-access' ),
455 457 'sanitize_callback' => function ( $param ) {
456 458 $params = array();
457 - foreach ( $param as $key => $value ) {
458 - if ( 'params' === $key || 'notify' === $key ) {
459 - // Sanitize custom parameters
460 - $custom_params = array();
461 - foreach ( $value as $param_key => $param_value ) {
462 - $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 );
463 470 }
464 - $params[sanitize_text_field( $key )] = $custom_params;
465 - } else {
466 - $params[sanitize_text_field( $key )] = sanitize_text_field( $value );
467 471 }
468 472 }
469 473 return $params;
470 474 },
@@ -599,15 +603,16 @@
599 603 return $users;
600 604 }
601 605
602 606 protected function get_env() {
603 - return array(
604 - 'ip' => $_SERVER['REMOTE_ADDR'],
607 + $env = array(
608 + 'ip' => ( isset( $_SERVER['REMOTE_ADDR'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) ) : '' ),
605 609 'id' => WPDA::get_current_user_id(),
606 610 'user' => WPDA::get_current_user_login(),
607 611 'roles' => WPDA::get_current_user_roles(),
608 612 'login' => 'anonymous' !== WPDA::get_current_user_login(),
609 613 );
614 + return $env;
610 615 }
611 616
612 617 protected function get_table_info( $dbs, $tbl, $default_where = '' ) {
613 618 $wpdadb = WPDADB::get_db_connection( $dbs );
@@ -619,9 +624,8 @@
619 624 );
620 625 }
621 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) );
622 627 $resultset = $wpdadb->get_results( $query, 'ARRAY_N' );
623 - // phpcs:ignore Standard.Category.SniffName.ErrorCode
624 628 if ( count( $resultset ) === 1 ) {
625 629 if ( null !== $resultset[0][2] ) {
626 630 return array(
627 631 'type' => $resultset[0][0],