WordPress.org

Making WordPress.org

Changeset 4536


Ignore:
Timestamp:
12/15/2016 06:38:16 AM (5 years ago)
Author:
dd32
Message:

Login: Make the REST API endpoints regex more greedy, fixes a case where the incorrect response could be supplied if a field contained /.

See #148

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions-restapi.php

    r4470 r4536  
    22
    33function wporg_login_rest_routes() {
    4     register_rest_route( 'wporg/v1', '/username-available/(?P<login>[^/]+)', array(
     4    register_rest_route( 'wporg/v1', '/username-available/(?P<login>.*)', array(
    55        'methods'  => WP_REST_Server::READABLE,
    66        'callback' => 'wporg_login_rest_username_exists'
     
    1111    ) );
    1212
    13     register_rest_route( 'wporg/v1', '/email-in-use/(?P<email>[^/]*)', array(
     13    register_rest_route( 'wporg/v1', '/email-in-use/(?P<email>.*)', array(
    1414        'methods'  => WP_REST_Server::READABLE,
    1515        'callback' => 'wporg_login_rest_email_in_use'
Note: See TracChangeset for help on using the changeset viewer.