Cast limit to int in all branches.
This commit is contained in:
parent
c4b965e543
commit
6e9ed9a83a
|
@ -264,7 +264,7 @@ class WC_Payment_Token_Data_Store extends WC_Data_Store_WP implements WC_Payment
|
||||||
}
|
}
|
||||||
|
|
||||||
$page = isset( $args['page'] ) ? absint( $args['page'] ) : 1;
|
$page = isset( $args['page'] ) ? absint( $args['page'] ) : 1;
|
||||||
$posts_per_page = isset( $args['limit'] ) ? absint( $args['limit'] ) : get_option( 'posts_per_page' );
|
$posts_per_page = absint( isset( $args['limit'] ) ? $args['limit'] : get_option( 'posts_per_page' ) );
|
||||||
|
|
||||||
$pgstrt = absint( ( $page - 1 ) * $posts_per_page ) . ', ';
|
$pgstrt = absint( ( $page - 1 ) * $posts_per_page ) . ', ';
|
||||||
$limits = 'LIMIT ' . $pgstrt . $posts_per_page;
|
$limits = 'LIMIT ' . $pgstrt . $posts_per_page;
|
||||||
|
|
|
@ -419,7 +419,7 @@ class WC_API_Taxes extends WC_API_Resource {
|
||||||
$order_by = ' ORDER BY tax_rate_order';
|
$order_by = ' ORDER BY tax_rate_order';
|
||||||
|
|
||||||
// Pagination
|
// Pagination
|
||||||
$per_page = isset( $args['posts_per_page'] ) ? $args['posts_per_page'] : get_option( 'posts_per_page' );
|
$per_page = absint( isset( $args['posts_per_page'] ) ? $args['posts_per_page'] : get_option( 'posts_per_page' ) );
|
||||||
$offset = 1 < $args['paged'] ? ( $args['paged'] - 1 ) * $per_page : 0;
|
$offset = 1 < $args['paged'] ? ( $args['paged'] - 1 ) * $per_page : 0;
|
||||||
$pagination = sprintf( ' LIMIT %d, %d', $offset, $per_page );
|
$pagination = sprintf( ' LIMIT %d, %d', $offset, $per_page );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue