Commit Graph

38454 Commits

Author SHA1 Message Date
Andrew Ozz b33deaf1b5 Privacy: Don't replace comment author URL and email with anything.
Props TZ-Media, desrosj, birgire.
Fixes #44141.

git-svn-id: https://develop.svn.wordpress.org/trunk@43467 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-17 08:59:30 +00:00
Gary Pendergast 6c8c2aeaf9 Streams: Return early from `wp_is_stream()` for paths that aren't streams.
Some versions of PHP appear to have a memory leak that is occasionally triggered by calling `stream_get_wrappers()`. In order to avoid calling this, we can return early from `wp_is_stream()` when `$path` doesn't contain `://`.

Props pbiron, JPry, dontstealmyfish.
Fixes #44532.



git-svn-id: https://develop.svn.wordpress.org/trunk@43466 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-17 07:53:18 +00:00
Gary Pendergast 8c55028c90 Privacy: Remove some unnecessary code comments.
[42967] introduced some WPCS-related comments, probably accidentally saved by an IDE.

Props burhandodhy.
Fixes #44590.



git-svn-id: https://develop.svn.wordpress.org/trunk@43465 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-17 07:42:23 +00:00
Gary Pendergast 93af027510 Editor: Use `apply_filters_deprecated()` for some deprecated filters.
The `htmledit_pre` and `richedit_pre` filters have been deprecated since 4.3.0, since before `apply_filters_deprecated()` existed. They're now correctly run using `apply_filters_deprecated()`.

Props sebastienthivinfocom, lbenicio, ianbelanger.
Fixes #44341.



git-svn-id: https://develop.svn.wordpress.org/trunk@43464 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-17 07:37:29 +00:00
Gary Pendergast 98fd60fc67 REST API: Fix some incorrect `@since` tags.
[43437] included some new methods, which were incorrectly tagged as being `@since 4.9.7`. This updates them to `4.9.8`.

Props danielbachhuber.
Fixes 44287.



git-svn-id: https://develop.svn.wordpress.org/trunk@43463 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-17 07:26:20 +00:00
Gary Pendergast 66f537e702 REST API: Attachments controller should respect upload limits.
When the REST API is in use on WordPress multisite, the `WP_REST_Attachments_Controller` should respect the "Max upload file size" and "Site upload space" site options.

Props flixos90, danielbachhuber.
Fixes #43751.



git-svn-id: https://develop.svn.wordpress.org/trunk@43462 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-17 07:21:50 +00:00
Sergey Biryukov 018779aca1 Docs: Change `@since` entry for `add_inline_data` action added in [42676] to 4.9.8.
See #36085.

git-svn-id: https://develop.svn.wordpress.org/trunk@43460 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-16 15:26:57 +00:00
Sergey Biryukov 2b539c3a91 Login and Registration: Set a better default value for `$wp_error` parameter in `login_header()`.
To prevent someone from passing a string (which would not be added to a new `WP_Error` instance), check for `is_wp_error()` explicitly.

Props desrosj, chetan200891, spyderbytes, lbenicio, sebastien@thivinfo.com, abdullahramzan.
Fixes #44052.

git-svn-id: https://develop.svn.wordpress.org/trunk@43457 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-16 14:09:22 +00:00
Sergey Biryukov dec7594a9b Privacy: Change `@since` entry for `_wp_privacy_settings_filter_draft_page_titles()` added in [43376] to 4.9.8.
See #44100.

git-svn-id: https://develop.svn.wordpress.org/trunk@43454 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-16 13:47:36 +00:00
Sergey Biryukov 83e8e6c003 Privacy: Change `@since` entry for `user_request_confirmed_email_subject` filter added in [43373] to 4.9.8.
See #44382.

git-svn-id: https://develop.svn.wordpress.org/trunk@43451 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-16 12:11:14 +00:00
Andrew Ozz facf361e88 TinyMCE: update to 4.8.0, changelog: https://www.tiny.cloud/docs/changelog/#version480july112018
Fixes #44134.

git-svn-id: https://develop.svn.wordpress.org/trunk@43447 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-16 08:06:32 +00:00
Aaron Jorbin f673d1851c Privacy: Silence is golden and invisible.
"Be more discrete." declared matt in [3155], and since then, "Silence is Golden" has been the calling card of placeholder index files. Historically, these have been php files, but [43012] changed that and added index.html files for privacy export generated folders.

The php silence files produce no visible content. This adds consistency with these new html files in that there will be no visible content. Silence will fall when the question is asked.

Fixes #44195.
Props audrasjb, rafsuntaskin, Ov3rfly, johnbillion, pento



git-svn-id: https://develop.svn.wordpress.org/trunk@43446 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-15 23:38:14 +00:00
Gary Pendergast 4c8daa87bd REST API: Update the test fixture generator following [43439]
As [43439] added data that contains object IDs, it can cause `wp-api-generated.js` to be unnecessarily regenerated.

Regenerating our list of fixtures that need normalising rectifies this.

See #44321.



git-svn-id: https://develop.svn.wordpress.org/trunk@43441 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-13 04:45:35 +00:00
Gary Pendergast 46c238ca78 REST API: Tweak permission checks for taxonomy and term endpoints
To match behaviour in the Classic Editor, we need to slightly loosen permissions on taxonomy and term endpoints. This allows users to create terms to assign to a post that they're editing.

Props danielbachhuber.
Fixes #44096.



git-svn-id: https://develop.svn.wordpress.org/trunk@43440 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-13 04:23:35 +00:00
Gary Pendergast 585c862faf REST API: Expose revision count and last revision ID on Post response
So that REST API clients can show appropriate UI for a post's revisions, it needs to know how many revisions the post has, and what the latest revision ID is.

Props kadamwhite, danielbachhuber, birgire, TimothyBlynJacobs.
Fixes #44321.



git-svn-id: https://develop.svn.wordpress.org/trunk@43439 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-13 04:06:23 +00:00
Gary Pendergast 81d2390d29 REST API: Declare user capabilities using JSON Hyper Schema's "targetSchema".
There are a variety of operations a WordPress user can only perform if they have the correct capabilities. A REST API client should only display UI for one of these operations if the WordPress user can perform the operation.

Rather than requiring REST API clients to calculate whether to display UI based on potentially complicated combinations of user capabilities, `targetSchema` allows us to expose a single flag to show whether the corresponding UI should be displayed.

This change also includes flags on post objects for the following actions:

- `action-publish`: The current user can publish this post.
- `action-sticky`: The current user can make this post sticky, and the post type supports sticking.
- `action-assign-author': The current user can change the author on this post.
- `action-assign-{$taxonomy}`: The current user can assign terms from the "$taxonomy" taxonomy to this post.
- `action-create-{$taxonomy}`: The current user can create terms int the "$taxonomy" taxonomy.

Props TimothyBlynJacobs, danielbachhuber.
Fixes #44287.



git-svn-id: https://develop.svn.wordpress.org/trunk@43437 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-11 06:22:10 +00:00
Sergey Biryukov 7569772234 Plugins: Disable "Install Now" button for plugins that require a higher version of PHP or WordPress.
Display a notice with an explanation and the steps required to resolve the issue.

Props afragen, schlessera, flixos90, nerrad, melchoyce, boemedia, hedgefield, joyously, johnalarcon, lakenh, afercia, acirujano, ibantxillo, SergeyBiryukov.
Fixes #43986.

git-svn-id: https://develop.svn.wordpress.org/trunk@43436 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-09 13:44:53 +00:00
Felix Arntz 3d85e311ef Privacy: Fix a further inconsistency of site name and URL usage in notification emails.
This is a follow-up to [43388].

Props desrosj.
Fixes #44396.


git-svn-id: https://develop.svn.wordpress.org/trunk@43435 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-08 13:54:02 +00:00
John Blackbourn f584b5755a Date/Time: Add support for the `c` and `r` shorthand formats in `date_i18n()`.
Props Rarst, pbearne

Fixes #20973


git-svn-id: https://develop.svn.wordpress.org/trunk@43434 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-05 23:10:01 +00:00
John Blackbourn adbec850ef Media: Update the `@since` tag for `wp_normalize_path()` as this has been backported to th 3.9 (and all other) branches.
See #42837


git-svn-id: https://develop.svn.wordpress.org/trunk@43406 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-05 15:20:46 +00:00
John Blackbourn 0f5488c3fc Media: Limit thumbnail file deletions to the same directory as the original file.
git-svn-id: https://develop.svn.wordpress.org/trunk@43392 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-05 14:31:24 +00:00
Anton Timmermans ec9d77b103 Docs: Fix default values for `customize/controls.js`.
The old values cannot be parsed by JSDoc.

Props herregroen.
Fixes #44520.


git-svn-id: https://develop.svn.wordpress.org/trunk@43391 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-05 14:06:01 +00:00
Felix Arntz b4d8e87464 Tests: Fix failing test after [43388].
Fixes #44396.


git-svn-id: https://develop.svn.wordpress.org/trunk@43390 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-05 08:52:06 +00:00
Felix Arntz 21190f2eac Date/Time: Fix usage of `$gmt` parameter in `date_i18n()` and clarify its behavior.
The docs for `date_i18n()` and its filter now correctly state that the `$gmt` parameter is only taken into account if no timestamp is provided. Furthermore, a bug with that parameter is fixed, as it is now ensured that the timezone used with it is `UTC`.

Props Rarst.
Fixes #38771.


git-svn-id: https://develop.svn.wordpress.org/trunk@43389 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-04 23:42:59 +00:00
Felix Arntz 97cacadc50 Privacy: Use consistent values for the site name and URL used in notification emails.
The functions `send_confirmation_on_profile_email()`, `_wp_privacy_send_request_confirmation_notification()`, `_wp_privacy_send_erasure_fulfillment_notification()`, and `wp_send_user_request()` all include a title and URL indicating the current site. However, so far they have dealt with those values inconsistently, sometimes using the site values, other times using the network values if in a multisite. This changeset ensures that only the current site is taken into account in all cases and that special characters in the site name are consistently decoded.

Props subrataemfluence, desrosj.
Fixes #44396.


git-svn-id: https://develop.svn.wordpress.org/trunk@43388 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-03 16:59:36 +00:00
Felix Arntz d448c448ca Date/Time: Add support for `gmt_offset` to `date_i18n()`.
Prior to this change, `date_i18n()` only supported the `timezone_string` option, causing incorrect timezones to appear in formatted dates on sites that still rely on the `gmt_offset` option.

Props Rarst.
Fixes #34835.


git-svn-id: https://develop.svn.wordpress.org/trunk@43387 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-03 15:58:58 +00:00
Felix Arntz d3a198df34 Taxonomy: Introduce `is_taxonomy_viewable()`.
This utility function allows for easy detection whether terms for a taxonomy are considered publicly viewable.

Props andizer.
Fixes #44466.


git-svn-id: https://develop.svn.wordpress.org/trunk@43386 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-03 10:28:39 +00:00
Sergey Biryukov 8e96abbcc2 Docs: Add missing backtick in `delete_metadata()` DocBlock.
Props dilipbheda, cliffpaulick.
Fixes #44433.

git-svn-id: https://develop.svn.wordpress.org/trunk@43385 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-02 17:58:00 +00:00
Sergey Biryukov 0e7ed499e0 Date/Time: Simplify `mysql_to_rfc3339()`.
Erasing timezone with a regular expression is redundant, the date could be just formatted in the respective format instead.

Props Rarst.
Fixes #42542.

git-svn-id: https://develop.svn.wordpress.org/trunk@43384 602fd350-edb4-49c9-b593-d223f7449a82
2018-06-26 18:00:58 +00:00
Sergey Biryukov 63aab770eb Docs: Correct description for `mysql_to_rfc3339()`.
Despite historical function name, the output does not conform to RFC3339 format, which must contain timezone.

Props Rarst.
See #42542.

git-svn-id: https://develop.svn.wordpress.org/trunk@43383 602fd350-edb4-49c9-b593-d223f7449a82
2018-06-26 17:52:58 +00:00
Felix Arntz 0a9c044283 Multisite: Count users in a more performant way when listing sites in the network admin.
Props spacedmonkey.
Fixes #44368.


git-svn-id: https://develop.svn.wordpress.org/trunk@43382 602fd350-edb4-49c9-b593-d223f7449a82
2018-06-26 16:29:33 +00:00
Felix Arntz d399bcce30 Role/Capability: Rename `upgrade_php` capability to more suitable `update_php`.
This brings the name in line with user-facing language and similar names of existing related capabilities. Since the capability has not been part of any WordPress release, it can be renamed without any backward-compatibility implications.

Also missing props benhuberman for [43006].

Fixes #44457.


git-svn-id: https://develop.svn.wordpress.org/trunk@43381 602fd350-edb4-49c9-b593-d223f7449a82
2018-06-26 15:04:26 +00:00
Sergey Biryukov efe9a3eb21 Docs: Improve documentation for `date_i18n()`'s second argument.
Despite previously being labeled as a Unix timestamp, in reality it's a sum of Unix timestamp and timezone offset in seconds.

Props Rarst.
See #38771.

git-svn-id: https://develop.svn.wordpress.org/trunk@43380 602fd350-edb4-49c9-b593-d223f7449a82
2018-06-26 13:18:13 +00:00
Andrew Ozz 6b366c6620 Privacy: use `wp_login_url()` for the link in the user confirmation email.
Props desrosj, usmankhalid.
Fixes #44353.

git-svn-id: https://develop.svn.wordpress.org/trunk@43379 602fd350-edb4-49c9-b593-d223f7449a82
2018-06-25 15:01:29 +00:00
K. Adam White a830dbcab3 REST API: Support meta registration for specific object subtypes.
Introduce an `object_subtype` argument to the args array for `register_meta()` which can be used to limit meta registration to a single subtype (e.g. a custom post type or taxonomy, vs all posts or taxonomies).

Introduce `register_post_meta()` and `register_term_meta()` wrapper methods for `register_meta` to provide a convenient interface for the common case of registering meta for a specific taxonomy or post type. These methods work the way plugin developers have often expected `register_meta` to function, and should be used in place of direct `register_meta` where possible.

Props flixos90, tharsheblows, spacedmonkey.
Fixes #38323.



git-svn-id: https://develop.svn.wordpress.org/trunk@43378 602fd350-edb4-49c9-b593-d223f7449a82
2018-06-21 21:06:50 +00:00
Gary Pendergast cdd9910f01 Emoji: Update Twemoji to version 11.0.
🦹

Props kraftbj,
Fixes #44339.



git-svn-id: https://develop.svn.wordpress.org/trunk@43377 602fd350-edb4-49c9-b593-d223f7449a82
2018-06-20 04:20:32 +00:00
Andrew Ozz 1ebcb33c3c Privacy: append `(Draft)` to draft page titles in the page drop-down on the Privacy Settings screen.
Props allendav, desrosj.
Fixes #44100.

git-svn-id: https://develop.svn.wordpress.org/trunk@43376 602fd350-edb4-49c9-b593-d223f7449a82
2018-06-19 12:11:46 +00:00
Andrew Ozz 2972f7c220 Privacy: add user request type to the admin notification email subject.
Props birgire, desrosj.
Fixes #44099.

git-svn-id: https://develop.svn.wordpress.org/trunk@43375 602fd350-edb4-49c9-b593-d223f7449a82
2018-06-19 08:17:44 +00:00
Andrew Ozz b2830c15e6 Privacy: on the Privacy Settings screen change `view` to `preview` when a draft page is selected for the privacy policy.
Props garrett-eclipse, desrosj.
Fixes #44131.

git-svn-id: https://develop.svn.wordpress.org/trunk@43374 602fd350-edb4-49c9-b593-d223f7449a82
2018-06-18 16:36:18 +00:00
Andrew Ozz 5168c31084 Privacy: filter the email subject in `_wp_privacy_send_request_confirmation_notification()`.
Props garrett-eclipse, birgire, desrosj.
Fixes #44382.

git-svn-id: https://develop.svn.wordpress.org/trunk@43373 602fd350-edb4-49c9-b593-d223f7449a82
2018-06-18 16:23:37 +00:00
Andrew Ozz acbbd28d0e Privacy: add `esc_html` to assertion in test_wp_comments_personal_data_exporter.
Props mermel, 1naveengiri.
Fixes #44113.

git-svn-id: https://develop.svn.wordpress.org/trunk@43371 602fd350-edb4-49c9-b593-d223f7449a82
2018-06-18 16:09:55 +00:00
Andrew Ozz 819626ce83 Privacy: do not show the comment cookies opt-in checkbox (on the front-end comments form) when comment cookies are disabled.
Props felipeelia, johnbillion.
Fixes #44342.

git-svn-id: https://develop.svn.wordpress.org/trunk@43370 602fd350-edb4-49c9-b593-d223f7449a82
2018-06-18 15:01:27 +00:00
John Blackbourn 1e88432e34 Build/Test Tools: Introduce support for a `WP_TESTS_CONFIG_FILE_PATH` constant to override the test suite config file location.
This can be used in phpunit.xml:

{{{
<php>
	<const name="WP_TESTS_CONFIG_FILE_PATH" value="/path/to/wp-tests-config.php" />
</php>
}}}

Props clarinetlord

Fixes #39734


git-svn-id: https://develop.svn.wordpress.org/trunk@43369 602fd350-edb4-49c9-b593-d223f7449a82
2018-06-16 14:21:18 +00:00
John Blackbourn 102422679d Security: Harden the random aspect of the hash used for user profile and admin email address changes.
Props BjornW

Fixes #43771


git-svn-id: https://develop.svn.wordpress.org/trunk@43367 602fd350-edb4-49c9-b593-d223f7449a82
2018-06-16 14:09:58 +00:00
John Blackbourn e42ce4a603 Options, Meta APIs: Use the correct escaping function when outputting the meta box context.
Props khaihong, abdullahramzan, leanderiversen, aryamaaru, lbenicio, palmiak

Fixes #44274


git-svn-id: https://develop.svn.wordpress.org/trunk@43365 602fd350-edb4-49c9-b593-d223f7449a82
2018-06-16 13:49:23 +00:00
Sergey Biryukov c8cbd26cb3 Docs: Correct inline comment added in [43361] for consistency with other comments.
See #44142.

git-svn-id: https://develop.svn.wordpress.org/trunk@43363 602fd350-edb4-49c9-b593-d223f7449a82
2018-06-16 13:09:46 +00:00
Sergey Biryukov 3de54cc930 Docs: Add missing `@return` value for `save_mod_rewrite_rules()` and `iis7_save_url_rewrite_rules()`.
See #44142.

git-svn-id: https://develop.svn.wordpress.org/trunk@43362 602fd350-edb4-49c9-b593-d223f7449a82
2018-06-16 13:03:39 +00:00
Sergey Biryukov d99d403030 Privacy: Make sure `wp_add_privacy_policy_content()` does not cause a fatal error by unintentionally flushing rewrite rules outside of the admin context.
Add a `_doing_it_wrong()` message describing the correct usage of the function.

Props kraftbj, azaozz, SergeyBiryukov, YuriV.
Fixes #44142.

git-svn-id: https://develop.svn.wordpress.org/trunk@43361 602fd350-edb4-49c9-b593-d223f7449a82
2018-06-16 13:01:42 +00:00
Anton Timmermans 885cd0fb44 Docs: Improve JSDoc for `emoji.js`.
Props lisannekluitmans, hansjovisyoast, igorsch, nicollle.
Fixes #44367.


git-svn-id: https://develop.svn.wordpress.org/trunk@43360 602fd350-edb4-49c9-b593-d223f7449a82
2018-06-16 12:53:07 +00:00
John Blackbourn 5aa5e5c131 I18N: Introduce unit tests for the Japanese language in order to facilitate future improvements.
Props ryotsun

Fixes #43829


git-svn-id: https://develop.svn.wordpress.org/trunk@43359 602fd350-edb4-49c9-b593-d223f7449a82
2018-06-16 12:44:46 +00:00