auto-patch 638-dev-dev01-2024-05-14T20_44_36

This commit is contained in:
root
2024-05-14 20:44:36 +00:00
parent a941559057
commit 5dbb0b284e
1812 changed files with 29671 additions and 14588 deletions

View File

@@ -313,6 +313,24 @@ abstract class ActionScheduler_Abstract_ListTable extends WP_List_Table {
return "ORDER BY {$orderby} {$order}";
}
/**
* Querystring arguments to persist between form submissions.
*
* @since 3.7.3
*
* @return string[]
*/
protected function get_request_query_args_to_persist() {
return array_merge(
$this->sort_by,
array(
'page',
'status',
'tab',
)
);
}
/**
* Return the sortable column specified for this request to order the results by, if any.
*
@@ -682,8 +700,8 @@ abstract class ActionScheduler_Abstract_ListTable extends WP_List_Table {
// Translated status labels.
$status_labels = ActionScheduler_Store::instance()->get_status_labels();
$status_labels['all'] = _x( 'All', 'status labels', 'woocommerce' );
$status_labels['past-due'] = _x( 'Past-due', 'status labels', 'woocommerce' );
$status_labels['all'] = esc_html_x( 'All', 'status labels', 'woocommerce' );
$status_labels['past-due'] = esc_html_x( 'Past-due', 'status labels', 'woocommerce' );
foreach ( $this->status_counts as $status_slug => $count ) {
@@ -717,12 +735,15 @@ abstract class ActionScheduler_Abstract_ListTable extends WP_List_Table {
*/
protected function display_table() {
echo '<form id="' . esc_attr( $this->_args['plural'] ) . '-filter" method="get">';
foreach ( $_GET as $key => $value ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
if ( '_' === $key[0] || 'paged' === $key || 'ID' === $key ) {
foreach ( $this->get_request_query_args_to_persist() as $arg ) {
$arg_value = isset( $_GET[ $arg ] ) ? sanitize_text_field( wp_unslash( $_GET[ $arg ] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
if ( ! $arg_value ) {
continue;
}
echo '<input type="hidden" name="' . esc_attr( $key ) . '" value="' . esc_attr( $value ) . '" />';
echo '<input type="hidden" name="' . esc_attr( $arg ) . '" value="' . esc_attr( $arg_value ) . '" />';
}
if ( ! empty( $this->search_by ) ) {
echo $this->search_box( $this->get_search_box_button_text(), 'plugin' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}

View File

@@ -325,7 +325,8 @@ abstract class ActionScheduler_Store extends ActionScheduler_Store_Deprecated {
* @throws InvalidArgumentException When json encoded args is too long.
*/
protected function validate_action( ActionScheduler_Action $action ) {
if ( strlen( json_encode( $action->get_args() ) ) > static::$max_args_length ) {
if ( strlen( wp_json_encode( $action->get_args() ) ) > static::$max_args_length ) {
// translators: %d is a number (maximum length of action arguments).
throw new InvalidArgumentException( sprintf( __( 'ActionScheduler_Action::$args too long. To ensure the args column can be indexed, action args should not be more than %d characters when encoded as JSON.', 'woocommerce' ), static::$max_args_length ) );
}
}

View File

@@ -69,7 +69,7 @@ abstract class ActionScheduler_TimezoneHelper {
// Last try, guess timezone string manually.
foreach ( timezone_abbreviations_list() as $abbr ) {
foreach ( $abbr as $city ) {
if ( (bool) date( 'I' ) === (bool) $city['dst'] && $city['timezone_id'] && intval( $city['offset'] ) === $utc_offset ) {
if ( (bool) date( 'I' ) === (bool) $city['dst'] && $city['timezone_id'] && intval( $city['offset'] ) === $utc_offset ) { // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date -- we are actually interested in the runtime timezone.
return $city['timezone_id'];
}
}
@@ -122,7 +122,7 @@ abstract class ActionScheduler_TimezoneHelper {
// Try mapping to the first abbreviation we can find.
if ( false === $tzstring ) {
$is_dst = date( 'I' );
$is_dst = date( 'I' ); // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date -- we are actually interested in the runtime timezone.
foreach ( timezone_abbreviations_list() as $abbr ) {
foreach ( $abbr as $city ) {
if ( $city['dst'] == $is_dst && $city['offset'] == $gmt_offset ) {