6402 Commits

Author SHA1 Message Date
Jb Audras
7f74aa9c5f REST API: Fix hardcoded table name in WP_Test_REST_Users_Controller.
This changeset fixes failing unit tests on the Hosting test suite because of the hardcoded table name in `WP_Test_REST_Users_Controller::test_get_items_only_fetches_ids_for_head_requests`.

Reviewed by audrasjb, spacedmonkey.
Merges [60141] to the 6.8 branch.
Props antonvlasenko, desrosj.
Fixes .



git-svn-id: https://develop.svn.wordpress.org/branches/6.8@60143 602fd350-edb4-49c9-b593-d223f7449a82
2025-04-08 13:54:41 +00:00
Jonathan Desrosiers
099da26971 Security: Don't fail the Argon2-related tests when it's not available on the test infrastructure.
These tests are not critical to the bcrypt functionality, they exist to reaffirm that the underlying use of `password_hash()` and `password_verify()` supports this algorithm. The Argon2 tests therefore shouldn't unnecessarily fail on hosts that don't support it.

Reviewed by desrosj.
Merges [60124] to the 6.8 branch.

Props desrosj, johnbillion.
Fixes .

git-svn-id: https://develop.svn.wordpress.org/branches/6.8@60126 602fd350-edb4-49c9-b593-d223f7449a82
2025-04-03 14:46:09 +00:00
John Blackbourn
0c56b81904 Application Passwords: Correct the fallback behaviour for application passwords that don't use a generic hash.
Application passwords that aren't hashed using BLAKE2b should be checked using wp_check_password() rather than assuming they were hashed with phpass. This provides full back compat support for application passwords that were created via an overridden wp_hash_password() function that uses an alternative hashing algorithm.

Reviewed by audrasjb.
Merges [60123] into the 6.8 branch.

Props snicco, debarghyabanerjee, peterwilsoncc, jorbin, johnbillion.

Fixes 


git-svn-id: https://develop.svn.wordpress.org/branches/6.8@60125 602fd350-edb4-49c9-b593-d223f7449a82
2025-04-03 14:36:46 +00:00
Joe McGill
0933036260 General: Improve unit tests for wp_unique_id_from_values().
This is a follow-up to [60038], which updates the PHPUnit tests to account for different systems producing potentially different hashes due to platform specific floating point precision settings.

Reviewed by audrasjb, desrosj.
Merges [60113] to the 6.8 branch.

Props debarghyabanerjee, joemcgill, peterwilsoncc, siliconforks.
Fixes .


git-svn-id: https://develop.svn.wordpress.org/branches/6.8@60116 602fd350-edb4-49c9-b593-d223f7449a82
2025-04-01 13:30:09 +00:00
Jb Audras
18ece266fa REST API: Properly capitalize "REST" in translation strings.
Reviewed by jorbin.
Merges [60104] to the 6.8 branch.
Props tobifjellner, sabernhardt, abcd95.
Fixes .



git-svn-id: https://develop.svn.wordpress.org/branches/6.8@60105 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-28 22:42:26 +00:00
Jb Audras
5da6814c90 Permalinks: Revert [59966].
The original commit ignores some of the arguments that can be passed to the function, mainly `base` and `format`. Reverting for now.

Props peterwilsoncc.



git-svn-id: https://develop.svn.wordpress.org/trunk@60088 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-25 15:14:50 +00:00
Adam Silverstein
0b536f1a8e Media: prevent uploading image types the server doesn’t support.
Normalize behavior between uploading in the media library and uploading directly to the block editor.  Now, when uploading an image with a mime type the server does not support (either in the media library or the block editor), the user will see an error message “This image cannot be processed by the web server. Convert it to JPEG or PNG before uploading”.

Alos, add a new filter `wp_prevent_unsupported_mime_type_uploads` which determines whether the server should prevent uploads for image types it doesn't support. The default value is true and the filter also receives the uploaded image mime type.

Props: joomskys, adamsilverstein, azaozz, swissspidy, joemcgill, flixos90, audrasjb. 

Fixes 



git-svn-id: https://develop.svn.wordpress.org/trunk@60084 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-25 14:04:47 +00:00
Jb Audras
9c09fe07a4 REST API: exclude rest_route from get_params() if pretty permalinks are disabled.
This changeset introduces a modification to the `get_params()` method within the WordPress REST API. The change ensures that the `rest_route` parameter is excluded from the parameters returned when pretty permalinks are not enabled. This update enhances the developer experience by ensuring that the parameters returned by `get_params()` are relevant and do not include unnecessary values, thereby reducing potential confusion and errors.

Props westonruter, TimothyBlynJacobs, audrasjb, debarghyabanerjee, dilip2615, shanemuir, peterwilsoncc.
Fixes .



git-svn-id: https://develop.svn.wordpress.org/trunk@60073 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-24 23:57:08 +00:00
Joe McGill
804ca756b1 Interactivity API: Apply the same directive name restrictions as the client.
This adds the same logic to filter directive data attributes to ignore invalid data attributes that is applied in the client to avoid processing directives on the server that will not be processed in the client.

Props jonsurrell, SirLouen.
Fixes .



git-svn-id: https://develop.svn.wordpress.org/trunk@60070 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-24 14:51:19 +00:00
Sergey Biryukov
c1f7f8a36c Tests: Use assertSame() in REST API attachments controller tests.
This ensures that not only the return values match the expected results, but also that their type is the same.

Going forward, stricter type checking by using `assertSame()` should generally be preferred to `assertEquals()` where appropriate, to make the tests more reliable.

Follow-up to [48291], [50124], [57603].

See .

git-svn-id: https://develop.svn.wordpress.org/trunk@60068 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-22 16:06:25 +00:00
Sergey Biryukov
0089ba1c2c Tests: Use assertSame() in REST API schema sanitization tests.
This ensures that not only the return values match the expected results, but also that their type is the same.

Going forward, stricter type checking by using `assertSame()` should generally be preferred to `assertEquals()` where appropriate, to make the tests more reliable.

Follow-up to [39061], [48937].

See .

git-svn-id: https://develop.svn.wordpress.org/trunk@60067 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-21 23:46:14 +00:00
Jb Audras
4d19161cdc General: Improve aria-current management in get_custom_logo().
This changeset fixes a edge case in `get_custom_logo()` where a page was set for the homepage without any front page in Settings > Reading and the `aria-current` attribute wasn't present on the logo link.

Props bschneidewind, audrasjb, siliconforks, sabernhardt, faisal03, shailu25, peterwilsoncc.
Fixes .



git-svn-id: https://develop.svn.wordpress.org/trunk@60062 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-21 13:54:38 +00:00
Jb Audras
2af76ed75d General: Remove noopener from links opening in a new tab in wp_list_bookmarks().
This changeset removes the automatic addition of `rel="noopener"` from links targeting a new tab via `target="_blank"` in the `wp_list_bookmarks()` function. Since this was introduced, supported browsers have changed their security policies and no longer allow the opened link to have JavaScript access to the previous tab. This also removes the unit test cases previously located in `wpListBookmarks.php` as they were dedicated to test the presence of `rel="noopener"`.

Follow-up to [52061], [59120].

Props audrasjb, rvouill, marineevain, jeremy80.
Fixes .



git-svn-id: https://develop.svn.wordpress.org/trunk@60058 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-19 23:13:46 +00:00
Joe McGill
8b632c94a5 Editor: Fix layout support classes to be generated with a stable ID.
This fixes a bug reported in https://github.com/WordPress/gutenberg/issues/67308 related to the Interactivity API's client-side navigation feature by replacing the incrementally generated IDs with stable hashes derived from the block's layout style definition.

Fixes .
Props darerodz.


git-svn-id: https://develop.svn.wordpress.org/trunk@60038 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-18 12:41:31 +00:00
Peter Wilson
76a2ed752c Emoji: Update the Twemoji library to 15.1.0.
This version adds support for the latest emoji added in Unicode Emoji 15.1.

I will rise like a phoenix 🐦🔥 but you’re my flame 🔥.
 
Props audrasjb, azaozz, hbhalodia, jorbin, sergeybiryukov, sirlouen.
Fixes .



git-svn-id: https://develop.svn.wordpress.org/trunk@60035 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-18 02:59:09 +00:00
Adam Silverstein
6f9d8e6c69 Media: fix potentially failing Imagick PDF alpha channel test.
Only test PDF alpha functionality when supported by the server.

Props: adamsilverstein, swissspidy, antpb, sippis.
Fixes .



git-svn-id: https://develop.svn.wordpress.org/trunk@60030 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-17 17:26:41 +00:00
Peter Wilson
b98b347504 Query: Fix performance regression starting the loop for all fields.
Fixes a performance regression starting the loop after calling `WP_Query( [ 'fields' => 'all' ] )`. This changes how `WP_Query::the_post()` determines whether there is a need to traverse the posts for cache warming.

If IDs are queried, `WP_Query::$posts` is assumed to be an array of post IDs. If all fields are queried, `WP_Query::$posts` is assumed to be an array of fully populated post objects.

Follow up to [59919], [59937].

Props joemcgill, peterwilsoncc, SirLouen.
Fixes .



git-svn-id: https://develop.svn.wordpress.org/trunk@59993 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-16 22:55:11 +00:00
Joe Dolson
fc0531c4d5 Media: Add 'muted' attribute and normalize HTML attributes.
Add the 'muted' attribute to the audio shortcode. Fix boolean attributes to meet HTML5 standards. Replaces instances like `attr="1"` with `attr` for `loop`, `autoplay`, and `muted`, and improves handling of the `preload` attribute to only output valid values.

Props shub07, dmsnell, debarghyabanerjee, audrasjb, narenin, apermo, joedolson.
Fixes .

git-svn-id: https://develop.svn.wordpress.org/trunk@59987 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-16 18:49:39 +00:00
Joe Dolson
6f8d4e2b7d Media: Dismiss button not functional on upload errors.
Change the `onclick` attribute to a separate inlined script in the error message and improve the event attachment behavior.

Props vivekawsm, mijotj, adamsilverstein, parthvataliya, adhun, sarathar, peterwilsoncc, sayedulsayem, chaion07, sppramodh, indirabiswas27, aishwarryapande, dhrumilk, manojmaharrshi, ugyensupport, imranhasanraaz, pkbhatt, shailu25, joedolson.
Fixes .

git-svn-id: https://develop.svn.wordpress.org/trunk@59986 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-16 16:09:13 +00:00
Sergey Biryukov
ed2f2ecd3f Tests: Use assertSame() in some newly introduced tests.
This ensures that not only the return values match the expected results, but also that their type is the same.

Going forward, stricter type checking by using `assertSame()` should generally be preferred to `assertEquals()` where appropriate, to make the tests more reliable.

Follow-up to [59630].

See .

git-svn-id: https://develop.svn.wordpress.org/trunk@59985 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-15 23:26:50 +00:00
Sergey Biryukov
dbdeb3ccdd Docs: Correct formatting for some inline comments in unit tests.
Follow-up to [54111], [56714], [58182], [59630], [59817], [59966].

See .

git-svn-id: https://develop.svn.wordpress.org/trunk@59979 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-13 18:21:37 +00:00
Timothy Jacobs
8ae3a2642b REST API: Fix fatal error when making HEAD requests with _fields filter.
In [59889] the REST API controllers were adjusted to perform less work when responding to HEAD requests. The WP_REST_Response body would now be `null`, which caused issues with filters that expected the response body to be an array.

This commit sets the response body to be an empty array when preparing the response instead. The body will still be discarded, but this provides better backward comppatibility with code that assumes an array will be used.

See .
Props antonvlasenko, timothyblynjacobs, mamaduka, wildworks.


git-svn-id: https://develop.svn.wordpress.org/trunk@59970 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-11 14:17:41 +00:00
Jb Audras
173ee18cca Permalinks: Ensure pagination links are consistent with permalink structure.
This changeset ensures that pagination links stay consistent with the chosen permalink structure. When the permalink structure uses a trailing slash, pagination permalinks contain one as well, but when the permalink structure doesn't use trailing slash, then pagination links should not use a trailing slash.

This makes use of `user_trailingslashit()` with a `paged` value for the `type_of_url` parameter.

Props hmbashar, huzaifaalmesbah, rejaulalomkhan, mai21, rahulsprajapati, martinkrcho, ankitkumarshah, adamsilverstein, sourabhjain.
Fixes .



git-svn-id: https://develop.svn.wordpress.org/trunk@59966 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-11 11:10:00 +00:00
George Mamadashvili
5564c705b1 REST API: Add additional default template data fields for the active theme.
The active theme(s) now return two additional properties, `default_template_types` and `default_template_part_areas`, in the REST response.

Props mamaduka, joemcgill, timothyblynjacobs, audrasjb, gigitux, peterwilsoncc, youknowriad, jorbin.
Fixes .

git-svn-id: https://develop.svn.wordpress.org/trunk@59965 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-11 06:13:47 +00:00
Peter Wilson
07e3b258b5 Build/Test Tools: Update external-http group to include all network tests.
Updates the `external-http` group in the PHPUnit test suite to include all tests that rely on network requests. This is to ensure the main test suite runs do not contain any tests that can fail due to network conditions.

Props sukhendu2002, azaozz, audrasjb.
Fixes .


git-svn-id: https://develop.svn.wordpress.org/trunk@59964 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-11 00:39:10 +00:00
John Blackbourn
27181a7f3d Date/Time: Fix the recently introduced test for wp_timezone_override_offset() which failed to take into consideration daylight saving time for the America/St_Johns timezone.
Props debarghyabanerjee, johnbillion, mukesh27, audrasjb.

Fixes 

git-svn-id: https://develop.svn.wordpress.org/trunk@59959 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-10 14:57:21 +00:00
Jb Audras
f766d2602e Media: Improve HTML5 compliance of wp_video_shortcode() boolean attributes.
This changeset updates `wp_video_shortcode()` to improve boolean attributes handling in accordance with HTML5 standards. Technically, it replaces `attr="1"` with `attr` for the `loop`, `autoplay` and `muted` attributes. The `preload` attribute is also updated to accept only allowed values: `none`, `metadata`, and `auto`. If a value outside of this list is provided, it will be ignored, preventing invalid attribute outputs.

Props jongycastillo, sabernhardt, joedolson, audrasjb, shub07, debarghyabanerjee.
Fixes .



git-svn-id: https://develop.svn.wordpress.org/trunk@59954 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-09 09:14:28 +00:00
Felix Arntz
8bedbcd2a9 Editor: Fix unexpected behavior due to conflicting custom block template.
This changeset fixes both a visual and functional bug related to template selection in the editor that occurred when having a custom block template registered that was using the same slug as another block template already registered by the theme, including the default block templates.

Props aljullu, antonvlasenko, apermo, audrasjb, azaozz, ntsekouras.
Fixes .


git-svn-id: https://develop.svn.wordpress.org/trunk@59951 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-07 17:53:37 +00:00
Peter Wilson
9c2527af42 Widgets: Improve caching within get_calendar().
Improves caching of the `get_calendar()` function by:
* fixing incorrect cache collisions for different `initial` `post_type` and week values, and,
* ensuring parameter equivalents generate the same cache key, ie passing the same values in a different order.

Improves tests for the function by:
* navigating to February 2025 in test set up to ensure the correct calendar month is displayed,
* adding messages for tests with multiple assertions,
* improving the tests for the calendar captions by wrapping the expected value in the HTML tag,
* adding dedicated test for the different `initial` parameter,
* ensuring caches do not collide for different parameters, and,
* ensuring caches do collide for equivalent parameters.

Follow up to r4522, r59908, r59909, r59917 (reverted), r59918 (reverted), r59930.

Props peterwilsoncc, jorbin, audrasjb.
Fixes .


git-svn-id: https://develop.svn.wordpress.org/trunk@59939 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-05 22:36:38 +00:00
Felix Arntz
69807a52ec Editor: Fix block type and block metadata collection registration issues on Windows due to lack of path normalization.
Props flixos90, gziolo, joemcgill.
Fixes .


git-svn-id: https://develop.svn.wordpress.org/trunk@59938 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-05 22:15:09 +00:00
Peter Wilson
1cd5c21c43 Query: Ensure preview links show autosave content to logged in users.
Ensures that the global post object is populated with the autosave post when a preview link is used for a published post. This allows post authors to preview the changes to a post prior to publication.

This modifies `WP_Query::the_post()` to only call `get_post()` if `WP_Query::$posts` does not contain `WP_Post` objects. Other data types (`stdClass` or numeric) indicates partial data was queried, a `WP_Post` object indicates the full data was queried and populated.

Props peterwilsoncc, mamaduka, wildworks, audrasjb.
Fixes .


git-svn-id: https://develop.svn.wordpress.org/trunk@59937 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-05 22:12:06 +00:00
Sergey Biryukov
e641b06f0f Tests: Improve wp_timezone_override_offset() unit tests.
Includes:
* Using a data provider to reduce code repetition.
* Correcting the `group` annotation.

Follow-up to [59931].

See .

git-svn-id: https://develop.svn.wordpress.org/trunk@59936 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-05 13:13:14 +00:00
Joe Dolson
4ad0135eca Media: Tests: Remove extraneous @test annotation.
The data provider for tests added in [59902] had an @test annotation, causing it to be run as if it were a test, throwing a risky test warning. Remove the @test annotation to prevent this undesired warning.

Props johnbillion, joedolson.
Fixes .

git-svn-id: https://develop.svn.wordpress.org/trunk@59934 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-04 19:16:33 +00:00
John Blackbourn
dc21f5b889 Date/Time: Add tests that cover the wp_timezone_override_offset() function.
Props pbearne, audrasjb

Fixes 

git-svn-id: https://develop.svn.wordpress.org/trunk@59931 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-04 14:56:14 +00:00
Sergey Biryukov
87953e10e4 Tests: Move get_calendar() tests to a more appropriate place.
This aims to bring consistency with the tests for the other functions in `wp-includes/general-template.php`.

Includes correcting the test class name as per the naming conventions.

Follow-up to [59908].

See .

git-svn-id: https://develop.svn.wordpress.org/trunk@59930 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-04 14:55:38 +00:00
George Mamadashvili
13fe8be435 Block support: Add server-side processing for ariaLabel.
Adds server-side registration for `ariaLabel` block support and its required fields. Fully enabling feature support for dynamic blocks and consumers using `ServerSideRender` component.

Props wildworks, fabiankaegy, joemcgill, poena.
Fixes .

git-svn-id: https://develop.svn.wordpress.org/trunk@59925 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-04 13:04:49 +00:00
Peter Wilson
e6fa3b914c Query: Ensure secondary loops populate the full global post.
Modifies `WP_Query::the_post()` to ensure the entire global post object is populated regardless of the `fields` parameter initially set by the developer.

In secondary loops, this ensures that `get_the_content()` and other getter functions operate as documented when called without a post ID and return the appropriate data for the global post object.

This introduces consistency when starting the loop and the `fields` parameter is set to `id=>parent` to the behaviour when set to either `all` or `ids`.

There is no change to the `WP_Query::$posts` parameter nor when a query is made without starting the secondary loop, ie without calling `WP_Query::the_post()`.

Props juzar, mukesh27, oglekler, peterwilsoncc, sirlouen, joemcgill.
Fixes .



git-svn-id: https://develop.svn.wordpress.org/trunk@59919 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-03 21:43:44 +00:00
Jb Audras
9c11701d77 Widgets: Fix get_calendar() related PHPUnit tests.
This is a new fix for PHPUnit tests failures after [59908].

Follow-up to [59908], [59917].

See .



git-svn-id: https://develop.svn.wordpress.org/trunk@59918 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-03 21:29:54 +00:00
Jb Audras
d55d8dcffa Widgets: Fix get_calendar() related PHPUnit tests.
This is a temporary fix for PHPUnit tests failures after [59908].

Follow-up to [59908].

See .



git-svn-id: https://develop.svn.wordpress.org/trunk@59917 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-03 21:15:50 +00:00
Jb Audras
2b697b8f21 Widgets: Add post type support to get_calendar() function.
This changeset updates the `get_calendar()` function to allow post type filtering via the `$post_type` parameter, with backard compatibility for previous params. It also updates the related `get_calendar_args` and `get_calendar` hooks accordingly.

Props sebastianpisula, swissspidy, dwainm, moxie, sukhendu2002, audrasjb, mukesh27. 
Fixes .



git-svn-id: https://develop.svn.wordpress.org/trunk@59908 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-03 19:54:34 +00:00
Joe McGill
bc1bdb3a06 Editor: Update packages for 6.8 Beta 1.
Syncs @wordpress/* packages to the 'latest' npm tag.

Props mamaduka, joemcgill, desrosj.
See .


git-svn-id: https://develop.svn.wordpress.org/trunk@59906 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-03 18:06:16 +00:00
John Blackbourn
b5e0c16c04 Security: Reduce the length of the hash returned by wp_fast_hash() so it can be used in the user_activation_key field when a legacy database schema is still in use.
This reduces the hash length from 32 bytes to 30 so the overall length of an activation key after encoding, prefixing, and prepending a timestamp fits into 60 bytes.

A key is also introduced for domain separation. This doesn't affect the output length.

Props dd32, paragoninitiativeenterprises, peterwilsoncc, johnbillion

Fixes 

git-svn-id: https://develop.svn.wordpress.org/trunk@59904 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-03 09:49:36 +00:00
Joe Dolson
b4f0fc916e Media: Allow uploading images from URLs without extensions.
Enable `download_url()` to fetch and verify file types if the URL does not contain a file extension. This allows URL downloads to handle media endpoints like istockphoto.com that use file IDs and formatting arguments to deliver images.

Props masteradhoc, mitogh, joedolson, hellofromTonya, antpb, audrasjb, navi161, dmsnell.
Fixes .

git-svn-id: https://develop.svn.wordpress.org/trunk@59902 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-03 00:17:08 +00:00
Peter Wilson
cad2f8cff9 Users: Use editable_roles filter for multisite sub-sites.
Adds a check of the `editable_roles` filter when adding users to a multisite sub-site to ensure the role is permitted to be used on the network. If the role is blocked by the filter, attempting to add the role will trigger a `wp_die()` similar to attempting to add a user with the role on a single site install.

Props eartboard, hareesh-pillai, ideag, sukhendu2002, spacedmonkey, thomaswm.
Fixes .


git-svn-id: https://develop.svn.wordpress.org/trunk@59901 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-02 23:33:56 +00:00
Timothy Jacobs
1c2a87b294 REST API: Improve performance for HEAD requests.
By default, the REST API responds to HEAD rqeuests by calling the GET handler and omitting the body from the response. While convenient, this ends up performing needless work that slows down the API response time.

This commit adjusts the Core controllers to specifically handle HEAD requests by not preparing the response body.

Fixes .
Props antonvlasenko, janusdev, ironprogrammer, swissspidy, spacedmonkey, mukesh27, mamaduka, timothyblynjacobs.



git-svn-id: https://develop.svn.wordpress.org/trunk@59899 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-02 22:05:08 +00:00
John Blackbourn
3e56dfc905 Docs: Various improvements to inline documentation.
See 

git-svn-id: https://develop.svn.wordpress.org/trunk@59896 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-02 00:41:48 +00:00
John Blackbourn
f6b55440a6 Security: Add some test files that were missed in [59828].
See 

git-svn-id: https://develop.svn.wordpress.org/trunk@59895 602fd350-edb4-49c9-b593-d223f7449a82
2025-03-02 00:35:45 +00:00
John Blackbourn
360732e132 Security: Reintroduce support for passwords hashed with MD5.
This reinstates the ability for a user to log in to an account where the password is hashed using MD5. This means that the ability to reset a password directly in the database using an SQL query or a database administration tool will be retained without the need to implement or integrate with bcrypt or phpass.

A password hashed with MD5 will get upgraded to bcrypt at the point where a user successfully logs in, just as is the case with a phpass hash.

Props audrasjb, aaronjorbin, johnbillion, david-innes, benniledl.

See .

git-svn-id: https://develop.svn.wordpress.org/trunk@59893 602fd350-edb4-49c9-b593-d223f7449a82
2025-02-28 18:51:44 +00:00
Joe McGill
bcaaa16a1f REST API: Add support for search_columns to the user endpoint.
This adds support for passing a `search_columns` argument to the user controller so that users with `list_users` caps can specify which field is being searched.

Props youknowriad, joemcgill, ntsekouras, mreishus, mamaduka.
Fixes 62596.


git-svn-id: https://develop.svn.wordpress.org/trunk@59892 602fd350-edb4-49c9-b593-d223f7449a82
2025-02-28 18:19:21 +00:00
Peter Wilson
e7ce9bbfbf REST API: Exit gracefully for malformed URLs.
Exit gracefully for requests with a malformed `rest_route` query string parameter, ie anything that is not a string.

This prevents fatal errors from occurring with URLs such as `example.com/?rest_route[]=array` as the URL is user input so logging the data provides no benefit to developers as they are unable to resolve the issue.

Props geekofshire, dd32, timothyblynjacobs.
Fixes .


git-svn-id: https://develop.svn.wordpress.org/trunk@59886 602fd350-edb4-49c9-b593-d223f7449a82
2025-02-27 23:17:38 +00:00