2926 Commits

Author SHA1 Message Date
Sergey Biryukov
e1e1748542 Tests: Use an image on WordPress.org CDN in external HTTP tests.
Due to some changes on the WP.com side to compress the requested images on the fly, the exact image size in the response could be different between platforms.

This commit aims to make the affected tests more reliable.

Follow-up to [139/tests], [31258], [34568], [47142], [57903], [57904], [57924].

Merges [57931] to the 5.0 branch.

Props peterwilsoncc, jorbin.
See #60865.

git-svn-id: https://develop.svn.wordpress.org/branches/5.0@58001 602fd350-edb4-49c9-b593-d223f7449a82
2024-04-15 13:43:40 +00:00
Sergey Biryukov
bd4ccab986 Grouped backports to the 5.0 branch.
- Media: Prevent CSRF setting attachment thumbnails.
- Embeds: Add protocol validation for WordPress Embed code.
- I18N: Introduce sanitization function for locale.
- Editor: Ensure block comments are of a valid form.

Merges [55760-55764] to the 5.0 branch
Props dd32, isabel_brison, martinkrcho, matveb, ocean90, paulkevan, peterwilsoncc, timothyblynjacobs, xknown, youknowriad.

git-svn-id: https://develop.svn.wordpress.org/branches/5.0@55791 602fd350-edb4-49c9-b593-d223f7449a82
2023-05-16 16:02:16 +00:00
Peter Wilson
03eb35cd9e Built/Test tools, HTTP API: Refactor test for multiple location headers.
Remove wordpress.org as an external dependency testing `WP_HTTP::handle_redirects()`.

This refactors and reenables an existing test to call the `WP_HTTP::handle_redirects()` method directly with a mocked array of HTTP headers containing multiple location headers.

The test is moved from the external-http group to the http test group as it no longer makes an HTTP request.

Follow up to [54955].

Props SergeyBiryukov, dd32, peterwilsoncc.
Merges [54968] to the 5.0 branch.
Fixes #57306.
See #56793.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@54985 602fd350-edb4-49c9-b593-d223f7449a82
2022-12-15 04:40:35 +00:00
Sergey Biryukov
7c5fab1f9c Grouped backports to the 5.0 branch.
- Posts, Post types: Apply KSES to post-by-email content,
- General: Validate host on "Are you sure?" screen,
- Posts, Post types: Remove emails from post-by-email logs,
- Media: Refactor search by filename within the admin,
- Pings/trackbacks: Apply KSES to all trackbacks,
- Comments: Apply kses when editing comments,
- Customize: Escape blogname option in underscores templates,
- REST API: Lockdown post parameter of the terms endpoint,
- Mail: Reset PHPMailer properties between use,
- Query: Validate relation in `WP_Date_Query`,
- Widgets: Escape RSS error messages for display.

Merges [54521], [54522], [54523], [54524], [54525], [54526], [54527], [54528], [54529], [54530], [54541] to the 5.0 branch.
Props voldemortensen, johnbillion, paulkevan, peterwilsoncc, xknown, dd32, audrasjb, martinkrcho, vortfu, davidbaumwald, tykoted, timothyblynjacobs, johnjamesjacoby, ehtis, matveb, talldanwp.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@54571 602fd350-edb4-49c9-b593-d223f7449a82
2022-10-17 18:13:25 +00:00
Jonathan Desrosiers
fdad53e8ae Grouped merges for 5.0.12.
* REST API: Allow authors to read their own password protected posts.
* About page update.

Merges [50717] to the 5.0 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@50731 602fd350-edb4-49c9-b593-d223f7449a82
2021-04-15 01:10:18 +00:00
Jonathan Desrosiers
676c22e235 Build/Test Tools: Support NodeJS 14.x in the 5.0 branch.
This updates the 5.0 branch to support the latest LTS version of NodeJS (currently 14.x), allowing the same version to be used across all WordPress branches that receive security updates as a courtesy.

In addition to backporting the package updates that happened after branching 5.0, dependencies that were removed in future releases have also been updated to their latest versions.

Props desrosj, dd32, netweb, jorbin.
Merges [44233,44728,45321,45765,45826,46403-46404,46408,46409,47404,47867-47869,47872-47873,48705,49636,49933,49937,49939,49940,49983,49989,50017,50126,50176,50185,50192] to the 5.0 branch.
See #52341.

git-svn-id: https://develop.svn.wordpress.org/branches/5.0@50201 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-05 04:03:45 +00:00
Sergey Biryukov
4b924e3341 Tests: Skip test_readme() if the HTTP request to secure.php.net or dev.mysql.com failed on timeout.
Move `skipTestOnTimeout()` to `WP_UnitTestCase_Base` to avoid duplication.

Merges [46682] and [46996] to the 5.0 branch.
See #51669.

git-svn-id: https://develop.svn.wordpress.org/branches/5.0@50095 602fd350-edb4-49c9-b593-d223f7449a82
2021-01-30 14:51:08 +00:00
Jonathan Desrosiers
34dfe45cb8 Build/Test Tools: Backport the local Docker environment to the 5.0 branch.
This commit introduces the Docker-based local WordPress development environment to the 5.0 branch and converts the Travis test jobs to utilize this environment for easier and more consistent testing.

Until existing blockers with the PHP 5.2 Docker container can be solved, the PHP 5.2 test job will remain using the Travis `precise` image.

Merges [45745,45762,45783-45784,45800,45819,45885,46320,46999,47225,47912,48121,49335,49358,49360,49362] to the 5.0 branch.
See #48301, #47767.

git-svn-id: https://develop.svn.wordpress.org/branches/5.0@49529 602fd350-edb4-49c9-b593-d223f7449a82
2020-11-06 17:29:16 +00:00
Jonathan Desrosiers
61afa63543 Tests: Fix an incorrect variable name in PDF tests.
This causes a PHP error when running the test suite with PDF rendering supported.

See #50573, #48301.

git-svn-id: https://develop.svn.wordpress.org/branches/5.0@49523 602fd350-edb4-49c9-b593-d223f7449a82
2020-11-06 17:02:03 +00:00
Jonathan Desrosiers
83f29fe880 Media: Improve and fix rotate/flip image tests.
Fix off-by-one error in pixel color checks for rotate and flip image tests. Change to using PNG with single pixel to ensure that errors are caught in the future, rather than lost in JPEG noise.

Props Fuegas, mikeschroder.
Merges [45067] to the 5.0 branch.
See #46073, #48301.

git-svn-id: https://develop.svn.wordpress.org/branches/5.0@49518 602fd350-edb4-49c9-b593-d223f7449a82
2020-11-06 16:46:12 +00:00
Jake Spurlock
f04772a072 General: WordPress updates
* XML-RPC: Improve error messages for unprivileged users.
* External Libraries: Disable deserialization in Requests_Utility_FilteredIterator
* Embeds: Disable embeds on deactivated Multisite sites.
* Coding standards: Modify escaping functions to avoid potential false positives.
* XML-RPC: Return error message if attachment ID is incorrect.
* Upgrade/install: Improve logic check when determining installation status.
* Meta: Sanitize meta key before checking protection status.
* Themes: Ensure that only privileged users can set a background image when a theme is using the deprecated custom background page.

Brings the changes from [49380,49382-49388] to the 5.0 branch.

Props xknown, zieladam, peterwilsoncc, whyisjake, desrosj, dd32.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@49396 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-29 18:50:55 +00:00
Sergey Biryukov
b00c8bf95e Tests: Temporarily skip PDF tests if they fail due to ImageMagick permission errors.
Merges [48338], [48341] to the 5.0 branch.

See #50573.

git-svn-id: https://develop.svn.wordpress.org/branches/5.0@48486 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-14 21:33:30 +00:00
Jake Spurlock
e3356d8c96 Editor: Ensure latest comments can only be viewed from public posts.
This brings the changes from [47984] to the 5.0 branch.

Props: poena, xknown.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@47988 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-10 19:31:08 +00:00
Jake Spurlock
e65e7a3bd9 Customize: Add additional filters to Customizer to prevent JSON corruption.
User: Invalidate `user_activation_key` on password update.
Query: Ensure that only a single post can be returned on date/time based queries.
Cache API: Ensure proper escaping around the stats method in the cache API.
Formatting: Expand `sanitize_file_name` to have better support for utf8 characters.

Brings the changes in [47633], [47634], [47635], [47636], [47637], and [47638] to the 5.0 branch.

Props: aduth, batmoo, ehti, ellatrix, jorgefilipecosta, nickdaugherty, noisysocks, pento, peterwilsoncc, sergeybiryukov, sstoqnov, talldanwp, westi, westonruter, whyisjake, whyisjake, xknown.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@47647 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-29 16:13:02 +00:00
Sergey Biryukov
18cdae1f9d Build/Test Tools: Remove unused ::assertPostHasTerms() method from tests/term.php.
The associated test was removed in [30241].

Merges [47341] to 3.7+ branches.
See #49485.

git-svn-id: https://develop.svn.wordpress.org/branches/5.0@47489 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-22 14:29:03 +00:00
Jake Spurlock
a31a90deb4 Ensure that a user can publish_posts before making a post sticky.
Props: danielbachhuber, whyisjake, peterwilson, xknown.
Prevent  stored XSS through wp_targeted_link_rel().
Props: vortfu, whyisjake, peterwilsoncc, xknown,  SergeyBiryukov, flaviozavan.
Update wp_kses_bad_protocol() to recognize : on uri attributes,
wp_kses_bad_protocol() makes sure to validate that uri attributes don't contain invalid/or not allowed protocols. While this works fine in most cases, there's a risk that by using the colon html5 named entity, one is able to bypass this function.
Brings r46895 to the 5.3 branch.
Props: xknown, nickdaugherty, peterwilsoncc.
Prevent stored XSS in the block editor.
Brings r46896 to the 5.3 branch.
Prevent escaped unicode characters become unescaped in unsafe HTML during JSON decoding.
Props: aduth, epiqueras.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@46915 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-12 18:51:11 +00:00
Jake Spurlock
a44cc358e4 Backporting several bug fixes.
- Query: Remove the static query property.
- HTTP API: Protect against hex interpretation.
- Filesystem API: Prevent directory travelersals when creating new folders.
- Administration: Ensure that admin referer nonce is valid.
- REST API: Send a Vary: Origin header on GET requests.

Backports [46474], [46475], [46476], [46477], [46478], [46483], [46485] to the 5.0 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@46492 602fd350-edb4-49c9-b593-d223f7449a82
2019-10-14 18:26:01 +00:00
Jonathan Desrosiers
810fd45115 Fix for URL sanitization in wp_kses_bad_protocol_once().
Merges [45997] to the 5.0 branch.

Props irsdl, sstoqnov, whyisjake.

git-svn-id: https://develop.svn.wordpress.org/branches/5.0@46004 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-04 18:10:34 +00:00
Sergey Biryukov
9ab36e0122 Improve handling the existing rel attribute in wp_rel_nofollow_callback().
Merges [45990] to the 5.0 branch.
Props xknown, sstoqnov.

git-svn-id: https://develop.svn.wordpress.org/branches/5.0@45993 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-04 17:46:02 +00:00
Jake Spurlock
8ff16f0bdd Remove _convert_urlencoded_to_entities() from the get_the_content() callback.
Merges [45937] to the 5.0 branch.

Props vortfu, whyisjake, peterwilsoncc


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@45945 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-04 16:31:20 +00:00
Joe McGill
d9a6440ca2 Upload: Fix upload failures of common text file types.
This adds some special case handling in 'wp_check_filetype_and_ext()' that prevents some common file types from being blocked based on mismatched MIME checks, which were made more strict in WordPress 5.0.1.

Merges [44438], [44439], [44441], and [44442] to the 4.9 branch.

Props Kloon, birgire, tellyworth, joemcgill.
See #45615.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@44443 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-07 22:22:03 +00:00
Jonathan Desrosiers
f95257f204 General: Introduce wp_unique_id(), a PHP implementation of Underscore's uniqueId method.
A static variable contains an integer that is incremented with each call. This number is returned with the optional prefix.
As such the returned value is not universally unique, but it is unique across the life of the PHP process.

Props westonruter, dlh.

Merges [43658] and [44406] to the 5.0 branch.
See #44883.

git-svn-id: https://develop.svn.wordpress.org/branches/5.0@44407 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-06 20:07:34 +00:00
Dominik Schilling (ocean90)
2acbb2a7e4 I18N/Script Loader: Support text domains other than "messages".
The inline JavaScript added by `WP_Scripts::print_translations()` should check whether `locale_data.$text_domain` exists and fall back to `locale_data.messages` otherwise.

Merge of [44403] to the 5.0 branch.

Props swissspidy.
Fixes #45441.

git-svn-id: https://develop.svn.wordpress.org/branches/5.0@44404 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-06 17:05:24 +00:00
herregroen
902af362f8 I18N: Fix JavaScript translations for subdirectory installations.
Fixes the `load_script_textdomain` function not resolving the md5 hash based on the relative path for WordPress installations in a subdirectory. Also adds a filter to allow sites using CDNs or other alternative asset locations to filter the relative path resolution.

Props akirk, fierevere, swissspidy, mypacecreator, babaevan, tmatsuur, ocean90.
Fixes #45528.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@44209 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-15 12:54:54 +00:00
Jeremy Felt
db9c4258f6 Media: Improve verification of MIME file types.
git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43988 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-12 23:00:06 +00:00
Miguel Fonseca
81e0366e57 Update sidebars_widgets to match Twenty Nineteen's single widget area
* Also update the customizer tests to match it.

Props SergeyBiryukov, pento.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43954 602fd350-edb4-49c9-b593-d223f7449a82
2018-11-30 20:24:42 +00:00
Gary Pendergast
48500bf839 WPDB: Check that $wpdb->last_result is countable before counting with it.
`wpdb::get_col()` iterates over `$wpdb->last_result`, which can be a non-countable value, should the preceeding query have failed.

Props spacedmonkey, desrosj.
See #45299.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43934 602fd350-edb4-49c9-b593-d223f7449a82
2018-11-22 03:58:19 +00:00
Peter Wilson
e55da18ea2 Formatting: Revert pre-save filter adding rel="noopener".
Removes filters adding `rel="noopener"` to links targeting `_blank`.

Previous implementation could introduce blank `rel` attributes and could corrupt JSON data when saving via the customizer.

See #43187.
Reverts [43732] and [43733] from the 5.0 branch.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43930 602fd350-edb4-49c9-b593-d223f7449a82
2018-11-22 00:24:01 +00:00
Daniel Bachhuber
9ee7a34c9f REST API: Preserve unknown, respect null in server-side block rendering.
* Skips validation where there is no attribute definition, but keeps the attribute value. Previously, the attribute would be omitted from the attributes passed to `render_callback`. Notably, this resolves an issue where `render_callback` cannot receive a block's `align` and `customClassName` attribute values, since these are defined as a client-side filter.
* Validates `null` as a proper value in its own right. Previously, a client implementation of a block could track `{"attribute":null}` as an explicitly empty value, and the server would wrongly initiate defaulting behavior. The new behavior will now only populate a default value if the attribute is not defined at all, including when unset in its being invalid per the attribute schema.

Props aduth, noisysocks, youknowriad.
See #45145 for the patch, #45098 for the original ticket.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43918 602fd350-edb4-49c9-b593-d223f7449a82
2018-11-21 14:43:33 +00:00
Daniel Bachhuber
8ef1b05bfe REST API: Always include title.raw/content.raw for Blocks in context=view.
Demarcations for reusable blocks are always expected to be accessible by clients.

Props noisysocks, youknowriad.
See #45145 for the patch, #45098 for the original ticket.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43917 602fd350-edb4-49c9-b593-d223f7449a82
2018-11-21 14:34:09 +00:00
Daniel Bachhuber
9ea3656e1e REST API: Include fields with null schema in get_fields_for_response().
In [43736], we prevented rendering fields when not present in `?_fields=`. However, because `get_fields_for_response()` is dependent on `get_item_schema()`, any custom fields registered with a null schema would be incorrectly excluded from the response. Because the REST API permits a null schema for `register_rest_field()`, those fields should be included in the available fields for a response.

Fixes #45220.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43908 602fd350-edb4-49c9-b593-d223f7449a82
2018-11-19 14:09:07 +00:00
Gary Pendergast
3d4b1f1229 Tests: Update a test that relied on the Hello Dolly plugin version.
[43900] changed the plugin version, causing a unit test failure.

See #45345.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43902 602fd350-edb4-49c9-b593-d223f7449a82
2018-11-16 00:01:47 +00:00
Gary Pendergast
61ee6d9fa7 Nav Menus: Fix a PHP 7.3 error when switching themes.
When switching themes, `wp_map_nav_menu_locations()` is used to ensure nav menus are placed in the relevant menu location. Occasionally, menus are registered to locations with numeric slugs, rather than strings. `wp_map_nav_menu_locations()` assumed it would be the latter, and ran `stripos()` on those numeric slugs. This behaviour is deprecated in PHP 7.3.

As this is the last known PHP 7.3 incompatibility, this commit also removes PHP 7.3 from Travis' `allowed_failures` list.

Props desrosj, jorbin.
See #45018.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43899 602fd350-edb4-49c9-b593-d223f7449a82
2018-11-15 23:19:40 +00:00
herregroen
07736dc37c I18N: Fix warnings in JavaScript translations.
Fixes an undefined index PHP warning in the load_script_textdomain function and a non-interrupting JS error when registering a domain which has no translations.

Props omarreiss, ocean90, georgestephanis.
Fixes #45256.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43898 602fd350-edb4-49c9-b593-d223f7449a82
2018-11-15 14:36:39 +00:00
Daniel Bachhuber
4b791ecf5f REST API: Avoid using 'parent' as path argument name for autosaves.
When 'parent' is set as the path argument name, it gets passed down through to the `create_item()` method and can erroneously reset the 'parent' value on the post itself. Instead, we rename the argument to 'id' and replicate the revision controller's `get_items_permissions_check()` to instead reference 'id'.

Also ensures revision query params (of which there are many) aren't exposed as the query params for autosaves (of which there are two).

Props TimothyBlynJacobs.
See #43316.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43897 602fd350-edb4-49c9-b593-d223f7449a82
2018-11-15 12:56:54 +00:00
Gary Pendergast
26414eec37 Block Editor: Update @wordpress dependencies to the latest version.
Changes of note:
- Includes the new Annotations API package.
- `wp-polyfill-ecmascript.js` is renamed to `wp-polyfill.js`.
- `strip_dynamic_blocks()` has been removed in favour of `excerpt_remove_blocks()`.
- The PHP block parser is now syncing from the `block-serialization-default-parser` package.
- `do_blocks()` uses the new parser.
- The `do_block` filter has been removed from `do_blocks()`, in favour of a `render_block` filter in `render_block()`.

See #45145, #45190, #45264, #45282.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43884 602fd350-edb4-49c9-b593-d223f7449a82
2018-11-12 02:26:18 +00:00
Gary Pendergast
e2c2c1bd25 Tests: Fix a failing test after [43879].
See #45290.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43881 602fd350-edb4-49c9-b593-d223f7449a82
2018-11-09 08:55:50 +00:00
Gary Pendergast
55ccd0f2ee Formatting: Ensure wpautop() isn't run on content generated from blocks.
As `do_blocks()` is run before `wpautop()` in `the_content` filter, we can remove in a Just In Time fashion, before that filter is run.

After `wpautop()`s original priority has passed, we can re-add it in a Just Too Late fashion, to ensure it's available if `the_content` filter is run multiple times on a page load.

Props pento, nerrad.
Fixes #45290.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43879 602fd350-edb4-49c9-b593-d223f7449a82
2018-11-09 08:28:40 +00:00
herregroen
7138832595 I18N: Set translations for all WordPress packages scripts.
Calls `wp_set_script_translations` for all packages scripts that have translations. Also correctly sets the domain on the translations.

Props omarreiss, pento, ocean90.
Fixes #45161.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43878 602fd350-edb4-49c9-b593-d223f7449a82
2018-11-08 11:33:46 +00:00
Gary Pendergast
1f4c84c65d Tests: Skip symlinked theme file tests if the links could not be created, or if symlink() is not available
Merges [42812,42819] to the 5.0 branch.

Props SergeyBiryukov.
Fixes #43508.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43866 602fd350-edb4-49c9-b593-d223f7449a82
2018-11-05 02:46:14 +00:00
Daniel Bachhuber
a4b6ac656f REST API: Prevent duplicate firing of rest(_after)?_insert_attachment actions.
Props danielbachhuber, peterwilsoncc.
Fixes #45269.
See #42864.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43862 602fd350-edb4-49c9-b593-d223f7449a82
2018-11-03 14:13:16 +00:00
herregroen
c4bffce143 I18N: Improve JavaScript translation support.
Improves upon [43825] by adding unit tests to cover additional use-cases and changes loading translations to only occur when outputting the script to allow setting translations on dependencies.

Props atimmer, omarreiss, nerrad, swissspidy, ocean90.
Fixes #45103.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43859 602fd350-edb4-49c9-b593-d223f7449a82
2018-11-01 13:50:59 +00:00
Daniel Bachhuber
7818e29cc5 REST API: Fix array syntax after [43851].
I thought I was writing JavaScript. Alas.

See #45196.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43852 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-31 14:02:45 +00:00
Daniel Bachhuber
fcd9381149 REST API: Regenerate fixure schema after introduction of new endpoints.
This fixture schema ensures `wp-api-generated.js` doesn't change when running tests in local dev environments.

Fixes #45196.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43851 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-31 13:25:28 +00:00
Gary Pendergast
1a826d1f31 Tests: Fix failing unit tests caused by [43840].
See #45145.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43841 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-29 08:00:56 +00:00
Daniel Bachhuber
b5e73f7e7f Block Editor: Preload wp/v2/media with OPTIONS for caps check.
Also introduces a `block_editor_preload_paths` filter for plugins and themes to preload additional data.

Props imath, mattheu.
Fixes #45194.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43833 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-29 00:23:11 +00:00
Sergey Biryukov
845f569b46 Tests: Use DIR_TESTDATA in test_wp_set_script_translation().
`__DIR__` is not available in PHP 5.2.x.

See #45103.

git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43828 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-26 03:54:02 +00:00
herregroen
4f05bb81f6 I18N: Add JavaScript translation support.
Adds the `wp_set_script_translations` function which registers translations for a JavaScript file. This function takes a handle, domain and optionally a path and ensures JavaScript translation files are loaded if they exist.

Props atimmer, omarreiss, nerrad, swissspidy, ocean90.
Fixes #45103.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43825 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-25 13:59:51 +00:00
Aaron Jorbin
5a3ad21aeb php7.3 compatibility: Fix compact throwing notices
In PHP 7.3, the compact() function has been changed to issue an E_NOTICE level error if a passed string refers to an unset variable. In previous versions of PHP, this notice was silently skipped. The full RFC can be viewed here: https://wiki.php.net/rfc/compact

This fixes all unit tested code that uses compact.

Props desrosj.
Fixes #44416.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43819 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-24 16:32:29 +00:00
Gary Pendergast
52beb9c65d KSES: Allow the download attribute on <a> tags.
To avoid this being a vector for bypassing the filetypes that are allowed to be uploaded, this attribute is only allowed to be added without a value.

Props kalpshit, arshidkv12, welcher, peterwilsoncc, marina_wp, pento.
See #44724.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43813 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-24 01:18:38 +00:00