Add back absint to validate function for customers by id endpoint

This commit is contained in:
Gerhard 2014-02-17 16:44:08 +02:00
parent a7e659b6fa
commit 5c18fab238
1 changed files with 2 additions and 0 deletions

View File

@ -475,6 +475,8 @@ class WC_API_Customers extends WC_API_Resource {
*/
protected function validate_request( $id, $type, $context ) {
$id = absint( $id );
// validate ID
if ( empty( $id ) )
return new WP_Error( 'woocommerce_api_invalid_customer_id', __( 'Invalid customer ID', 'woocommerce' ), array( 'status' => 404 ) );