PluginProbe
WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards / 5.5.85
WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards v5.5.85
5.5.85 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 All 161 releases
← All changes | WPDataAccess/Simple_Form/WPDA_Simple_Form_Item.php +14 -14 5.5.36 → 5.5.85 View file →
@@ -333,26 +333,29 @@
333 333 );
334 334
335 335 if ( '' === $args['item_name'] ) {
336 336 // Without an item name it makes no sense to continue
337 - wp_die( __( 'ERROR: Wrong arguments [missing item name]', 'wp-data-access' ) );
337 + wp_die( esc_attr__( 'ERROR: Wrong arguments [missing item name]', 'wp-data-access' ) );
338 338 }
339 339
340 340 if ( '' === $args['data_type'] ) {
341 341 // Without a data type it makes no sense to continue
342 - wp_die( __( 'ERROR: Wrong arguments [missing data type]', 'wp-data-access' ) );
342 + wp_die( esc_attr__( 'ERROR: Wrong arguments [missing data type]', 'wp-data-access' ) );
343 343 }
344 344
345 345 $this->item_name = $args['item_name'];
346 346 $this->data_type = WPDA::get_type( $args['data_type'] );
347 347 $this->item_icon_type = $this->data_type;
348 - $this->item_label = (string) $args['item_label']; //phpcs:ignore - 8.1 proof
348 + $this->item_label = (string) $args['item_label']; // phpcs:ignore -- 8.1 proof
349 349 if ( null === $args['item_value'] ) {
350 350 $this->item_value = null;
351 351 } else {
352 - $this->item_value = (string) $args['item_value']; //phpcs:ignore - 8.1 proof
352 + $this->item_value = (string) $args['item_value']; // phpcs:ignore -- 8.1 proof
353 353 }
354 - if ( 'CURRENT_TIMESTAMP' !== $args['item_default_value'] ) {
354 + if (
355 + 'current_timestamp()' !== strtolower( (string) $args['item_default_value'] ) &&
356 + 'current_timestamp' !== strtolower( (string) $args['item_default_value'] )
357 + ) {
355 358 $this->item_default_value = $args['item_default_value'];
356 359 }
357 360 $this->item_extra = $args['item_extra'];
358 361 if ( 'auto_increment' === $this->item_extra ) {
@@ -368,9 +371,9 @@
368 371 '\'',
369 372 '',
370 373 substr( substr( ( string ) $args['item_enum'], 5 ), 0, - 1 )
371 374 )
372 - );//phpcs:ignore - 8.1 proof
375 + ); // phpcs:ignore -- 8.1 proof
373 376 }
374 377 if ( 'set' === $this->data_type ) {
375 378 $this->item_enum = explode(
376 379 ',',
@@ -378,9 +381,9 @@
378 381 '\'',
379 382 '',
380 383 substr( substr( ( string ) $args['item_enum'], 4 ), 0, - 1 )
381 384 )
382 - );//phpcs:ignore - 8.1 proof
385 + ); // phpcs:ignore -- 8.1 proof
383 386 }
384 387 $this->column_type = $args['column_type'];
385 388 $this->item_event = $args['item_event'];
386 389 $this->item_js = $args['item_js'];
@@ -400,12 +403,12 @@
400 403 foreach ( $args as $property => $value ) {
401 404 $this->$property = $value;
402 405 }
403 406 } else {
404 - wp_die( __( 'Class must be of (sub)type WPDA_Simple_Form_Item', 'wp-data-access' ) );
407 + wp_die( esc_attr__( 'Class must be of (sub)type WPDA_Simple_Form_Item', 'wp-data-access' ) );
405 408 }
406 409 } else {
407 - wp_die( __( 'Could not create form item instance [argument must be array or object]', 'wp-data-access' ) );
410 + wp_die( esc_attr__( 'Could not create form item instance [argument must be array or object]', 'wp-data-access' ) );
408 411 }
409 412 }
410 413
411 414 /**
@@ -445,9 +448,9 @@
445 448 <tr <?php echo '' === $row_class ? '' : ' class="' . esc_attr( $row_class ) . '"'; ?>>
446 449 <?php
447 450 }
448 451
449 - $label = explode( '|', esc_attr( $this->item_label ) );//phpcs:ignore - 8.1 proof
452 + $label = explode( '|', esc_attr( $this->item_label ) ); // phpcs:ignore -- 8.1 proof
450 453 $label_before = $label[0];
451 454 $label_after = '';
452 455 if ( isset( $label[1] ) ) {
453 456 $label_after = $label[1];
@@ -971,12 +974,9 @@
971 974
972 975 if ( 'NO' === $this->is_nullable ) {
973 976 // Empty values are not allowed for this column: check value.
974 977 if ( '' === $this->item_value ) {
975 - if (
976 - isset( $_REQUEST[ "{$this->item_name}_db_is_null" ] ) &&
977 - 'false' === strtolower( $_REQUEST[ "{$this->item_name}_db_is_null" ] ) // phpcs:ignore WordPress.Security.ValidatedSanitizedInput
978 - ) {
978 + if ( isset( $_REQUEST[ "{$this->item_name}_db_is_null" ] ) && 'false' === strtolower( $_REQUEST[ "{$this->item_name}_db_is_null" ] ) ) { // phpcs:ignore
979 979 // Allow update if original column already was an empty string
980 980 return true;
981 981 }
982 982