Make WordPress Core


Ignore:
Timestamp:
02/07/2023 11:45:18 PM (4 years ago)
Author:
danielbachhuber
Message:

REST API: Support non-Latin characters in template route regex.

Non-Latin characters are URL-encoded (e.g. %cf%84%ce%b5%cf%83%cf%84). Matching % in the route ensures templates with non-Latin titles can be properly saved.

Props antonyagrios, mburridge.
Fixes #57329.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api/rest-schema-setup.php

    r55029 r55294  
    147147                        '/wp/v2/template-parts',
    148148                        '/wp/v2/template-parts/(?P<id>[\d]+)/autosaves',
    149                         '/wp/v2/template-parts/(?P<id>([^\/:<>\*\?"\|]+(?:\/[^\/:<>\*\?"\|]+)?)[\/\w-]+)',
     149                        '/wp/v2/template-parts/(?P<id>([^\/:<>\*\?"\|]+(?:\/[^\/:<>\*\?"\|]+)?)[\/\w%-]+)',
    150150                        '/wp/v2/template-parts/(?P<parent>[\d]+)/autosaves/(?P<id>[\d]+)',
    151151                        '/wp/v2/template-parts/(?P<parent>[\d]+)/revisions',
     
    154154                        '/wp/v2/templates',
    155155                        '/wp/v2/templates/(?P<id>[\d]+)/autosaves',
    156                         '/wp/v2/templates/(?P<id>([^\/:<>\*\?"\|]+(?:\/[^\/:<>\*\?"\|]+)?)[\/\w-]+)',
     156                        '/wp/v2/templates/(?P<id>([^\/:<>\*\?"\|]+(?:\/[^\/:<>\*\?"\|]+)?)[\/\w%-]+)',
    157157                        '/wp/v2/templates/(?P<parent>[\d]+)/autosaves/(?P<id>[\d]+)',
    158158                        '/wp/v2/templates/(?P<parent>[\d]+)/revisions',
Note: See TracChangeset for help on using the changeset viewer.