Make WordPress Core


Ignore:
Timestamp:
07/02/2016 11:02:45 PM (8 years ago)
Author:
rachelbaker
Message:

REST API: Reverse order of setting sanitization/validation, validating prior to sanitizing.

Fixes mistake in the current behavior, where the sanitization callback ran before the validation callback. Now the validation callback will run before the sanitization.

Props schlessera, rachelbaker.
See #37247.
Fixes #37192.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/class-wp-rest-server.php

    r37903 r37943  
    854854                    $request->set_attributes( $handler );
    855855
    856                     $request->sanitize_params();
    857 
    858856                    $defaults = array();
    859857
     
    870868                        $response = $check_required;
    871869                    }
     870
     871                    $request->sanitize_params();
    872872                }
    873873
Note: See TracChangeset for help on using the changeset viewer.