Commit Graph

792 Commits

Author SHA1 Message Date
Sergey Biryukov
897f004a9c General: Replace older-style PHP type conversion functions with type casts.
This improves performance, readability, and consistency throughout core.

* `intval()` → `(int)`
* `strval()` → `(string)`
* `floatval()` → `(float)`

Props ayeshrajans.
Fixes #42918.
Built from https://develop.svn.wordpress.org/trunk@49108


git-svn-id: http://core.svn.wordpress.org/trunk@48870 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-08 21:15:13 +00:00
Sergey Biryukov
ac00862f44 Formatting: Make sure links_add_target() adds the target attribute to the correct tag.
Previously, the attribute could unintentionally be added to a tag that starts with the same characters, e.g. `<aside>` instead of `<a>`.

Props antonlukin.
Fixes #51313.
Built from https://develop.svn.wordpress.org/trunk@48983


git-svn-id: http://core.svn.wordpress.org/trunk@48745 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-17 10:14:07 +00:00
Sergey Biryukov
13647464a5 Formatting: Make the check for empty text in wp_trim_excerpt() more resilient.
This addresses a regression in [47808], which caused excerpts to be generated from post content if an empty string is passed, but not for other values considered empty, e.g. `null` or `false`.

Props riaanlom, laxman-prajapati, SergeyBiryukov.
Fixes #51042.
Built from https://develop.svn.wordpress.org/trunk@48817


git-svn-id: http://core.svn.wordpress.org/trunk@48579 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-18 15:10:04 +00:00
Sergey Biryukov
101d00601e Media: Remove accents in sanitize_file_name().
This brings some consistency with `sanitize_title()` and `sanitize_user()`.

Props tar.gz, NumidWasNotAvailable, juliobox, p_enrique, cristovaov, zodiac1978, mikeschroder, markoheijnen, chriscct7, swissspidy, DrProtocols, pento, gitlost, joemcgill, dustinbolton, programmin, Vayu, MaximeCulea, lucasbustamante, nilovelez, RavanH, audrasjb, SergeyBiryukov.
See #22363.
Built from https://develop.svn.wordpress.org/trunk@48603


git-svn-id: http://core.svn.wordpress.org/trunk@48365 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-24 18:03:02 +00:00
Sergey Biryukov
544fbefffa Media: Filter out a few more special characters in sanitize_file_name().
Props audrasjb.
Fixes #50231.
Built from https://develop.svn.wordpress.org/trunk@48596


git-svn-id: http://core.svn.wordpress.org/trunk@48358 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-24 00:59:07 +00:00
Sergey Biryukov
e1830a8182 Formatting: Filter out the bullet character in sanitize_title_with_dashes().
Props roytanck, deepaklalwani, veromary.
Fixes #49791.
Built from https://develop.svn.wordpress.org/trunk@48593


git-svn-id: http://core.svn.wordpress.org/trunk@48355 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-24 00:03:05 +00:00
John Blackbourn
9bc7d0a776 Docs: Another pass at some inline docs fixes mostly made by PHPCBF.
See #49572, #50744
Built from https://develop.svn.wordpress.org/trunk@48590


git-svn-id: http://core.svn.wordpress.org/trunk@48352 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-23 21:11:05 +00:00
Aaron Jorbin
6cab8cce22 General: Update code for readability and inclusion
There are two pieces in here:

1) The update to change blacklist to blocklist is moved to disallowed_list. "Block" has a meaning in our code, and there could be ambiguity between this code and code related to blocks.

2) This improves backwards compatibility for code that was accessing the now deprecated code.

Previously: [48477], [48405], [48400], [48121], [48122], [48124], [48142], [48566]

Props: desrosj, SergeyBiryukov, johnjamesjacoby
Fixes: #50413


Built from https://develop.svn.wordpress.org/trunk@48575


git-svn-id: http://core.svn.wordpress.org/trunk@48337 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-23 03:14:06 +00:00
Sergey Biryukov
81a001117c Docs: Improve documentation for sanitize_user(), sanitize_title(), sanitize_title_with_dashes().
See #49572.
Built from https://develop.svn.wordpress.org/trunk@48444


git-svn-id: http://core.svn.wordpress.org/trunk@48213 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-12 01:13:02 +00:00
Sergey Biryukov
c38f99df9a Docs: Synchronize @since notes for add_magic_quotes() and wp_slash().
Follow-up to [48205], [48433].

See #49572.
Built from https://develop.svn.wordpress.org/trunk@48441


git-svn-id: http://core.svn.wordpress.org/trunk@48210 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-11 22:48:07 +00:00
whyisjake
7448ce4839 Formatting: Prevent wp_slash from returning non-strings as strings.
If a bool/float/int is passed into wp_slash it will be coerced into a string.

This changes the behavior to only slash strings. At the same time, handles recursion a little nicer by calling array_map for arrays.

Fixes #42195, #24106.

Props johnbillion, andizer, jrf, ryotasakamoto, SergeyBiryukov, donmhico, TobiasBg, markoheijnen, ryan, nacin, devesine, whyisjake.


Built from https://develop.svn.wordpress.org/trunk@48433


git-svn-id: http://core.svn.wordpress.org/trunk@48202 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-11 00:13:04 +00:00
whyisjake
919729508c Formatting: Improve the docblock for sanitize_title().
Since sanitize title is largely used for html attributes, or post slugs, make note that accents will be removed and that the string will be limited to alphanumeric characters, underscores, and dashes.

Fixes #33756.
Props ericlewis, swissspidy, wonderboymusic, psdtohtmlguru, DrewAPicture, SergeyBiryukov, sjmur, gma992, shulard, ebinnion, whyisjake.


Built from https://develop.svn.wordpress.org/trunk@48432


git-svn-id: http://core.svn.wordpress.org/trunk@48201 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-10 23:28:04 +00:00
Sergey Biryukov
3336009e34 Docs: Replace "html" and "xhtml" instances in DocBlocks and comments with "HTML" and "XHTML".
This ensures consistent capitalization where appropriate.

Props navidos, desrosj.
Fixes #50473.
Built from https://develop.svn.wordpress.org/trunk@48199


git-svn-id: http://core.svn.wordpress.org/trunk@47968 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-06-28 14:02:06 +00:00
Sergey Biryukov
40c389c95e Docs: Standardize on "Returning a value from the filter" vs. "Passing a value to the filter".
The filter is the callback function added with `add_filter()`, therefore the hook passes a value to the filter, and the filter returns a value to change its behaviour.

The documentation is referring to the latter.

Props johnbillion.
See #49572, #16557.
Built from https://develop.svn.wordpress.org/trunk@48185


git-svn-id: http://core.svn.wordpress.org/trunk@47954 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-06-26 18:49:09 +00:00
Sergey Biryukov
a55c84380a Docs: Spell "line breaks" in a consistent way.
See #49572.
Built from https://develop.svn.wordpress.org/trunk@48175


git-svn-id: http://core.svn.wordpress.org/trunk@47944 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-06-26 09:30:11 +00:00
Sergey Biryukov
a659c36414 Docs: Add a note that the $br parameter of wpautop() does not affect line breaks within <script>, <style>, and <svg> tags.
Props stevenlinx.
Fixes #50477.
Built from https://develop.svn.wordpress.org/trunk@48174


git-svn-id: http://core.svn.wordpress.org/trunk@47943 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-06-26 09:20:11 +00:00
desrosj
4b60af1a6a General: Remove “whitelist” and “blacklist” in favor of more clear and inclusive language.
“The WordPress open source community cares about diversity. We strive to maintain a welcoming environment where everyone can feel included.”

With this commit, all occurrences of “whitelist” and “blacklist” (with the single exception of the `$new_whitelist_options` global variable) are removed. A new ticket has been opened to explore renaming the `$new_whitelist_options` variable (#50434).

Changing to more specific names or rewording sentences containing these terms not only makes the code more inclusive, but also helps provide clarity. These terms are often ambiguous. What is being blocked or allowed is not always immediately clear. This can make it more difficult for non-native English speakers to read through the codebase.

Words matter. If one contributor feels more welcome because these terms are removed, this was worth the effort.

Props strangerstudios, jorbin, desrosj, joemcgill, timothyblynjacobs, ocean90, ayeshrajans, davidbaumwald, earnjam.
See #48900, #50434.
Fixes #50413.
Built from https://develop.svn.wordpress.org/trunk@48121


git-svn-id: http://core.svn.wordpress.org/trunk@47890 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-06-22 17:26:13 +00:00
Sergey Biryukov
b16368c268 Docs: Remove @staticvar tags from core.
The tag was supported in phpDocumentor 1.x, but is no longer supported in 2.x and 3.x.

Usage of static variables is considered an internal implementation detail and has no information value for someone reading the docs.

Props alishanvr, jrf.
Fixes #50426.
Built from https://develop.svn.wordpress.org/trunk@48109


git-svn-id: http://core.svn.wordpress.org/trunk@47878 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-06-20 12:40:12 +00:00
John Blackbourn
1a77bb81d8 Docs: Remove unnecessary variables names from @return tags.
See #49572.
Built from https://develop.svn.wordpress.org/trunk@48100


git-svn-id: http://core.svn.wordpress.org/trunk@47869 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-06-19 22:55:12 +00:00
John Blackbourn
37234874a5 Docs: Misc improvements to inline docs.
See #49572.
Built from https://develop.svn.wordpress.org/trunk@48099


git-svn-id: http://core.svn.wordpress.org/trunk@47868 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-06-19 22:28:13 +00:00
Sergey Biryukov
99d49a0cc3 Build/Test Tools: Replace the banner text from wp-emoji-loader.min.js in formatting.php during build process.
This ensures that `/*! This file is auto-generated */` comment is not included on front end as part of the inline Emoji detection script.

Follow-up to [41271], [46589].

Props superpoincare, SergeyBiryukov.
Fixes #49861.
Built from https://develop.svn.wordpress.org/trunk@48096


git-svn-id: http://core.svn.wordpress.org/trunk@47865 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-06-19 22:08:08 +00:00
Pascal Birchler
609dd1d14f Sitemaps: Add XML sitemaps functionality to WordPress.
While web crawlers are able to discover pages from links within the site and from other sites, XML sitemaps supplement this approach by allowing crawlers to quickly and comprehensively identify all URLs included in the sitemap and learn other signals about those URLs using the associated metadata.

See https://make.wordpress.org/core/2020/06/10/merge-announcement-extensible-core-sitemaps/ for more details.

This feature exposes the sitemap index via `/wp-sitemap.xml` and exposes a variety of new filters and hooks for developers to modify the behavior. Users can disable sitemaps completely by turning off search engine visibility in WordPress admin.

This change also introduces a new `esc_xml()` function to escape strings for output in XML, as well as XML support to `wp_kses_normalize_entities()`.

Props Adrian McShane, afragen, adamsilverstein, casiepa, flixos90, garrett-eclipse, joemcgill, kburgoine, kraftbj, milana_cap, pacifika, pbiron, pfefferle, Ruxandra Gradina, swissspidy, szepeviktor, tangrufus, tweetythierry.
Fixes #50117.
See #3670. See #19998.

Built from https://develop.svn.wordpress.org/trunk@48072


git-svn-id: http://core.svn.wordpress.org/trunk@47839 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-06-17 15:24:07 +00:00
desrosj
4cdd79af25 Emoji: Upgrade Twemoji to version 13.0.0.
🥸

Props kraftbj, desrosj, otto42.
Fixes #50148.
Built from https://develop.svn.wordpress.org/trunk@48048


git-svn-id: http://core.svn.wordpress.org/trunk@47815 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-06-15 18:04:26 +00:00
Sergey Biryukov
b9751d4efe Coding Standards: Use strict comparison for count() calls.
See #49542.
Built from https://develop.svn.wordpress.org/trunk@47848


git-svn-id: http://core.svn.wordpress.org/trunk@47624 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-05-23 11:38:08 +00:00
Sergey Biryukov
7932193708 Coding Standards: Use strict comparison where static strings are involved.
This reduces the number of `WordPress.PHP.StrictComparisons.LooseComparison` issues in half, from 1897 to 890.

Includes minor code layout fixes for better readability.

See #49542.
Built from https://develop.svn.wordpress.org/trunk@47808


git-svn-id: http://core.svn.wordpress.org/trunk@47584 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-05-16 18:42:12 +00:00
Sergey Biryukov
2517abb4bd Docs: Add a note that the $protocols parameter of esc_url_raw() defaults to return value of wp_allowed_protocols().
This complements already existing note in `esc_url()`.

Props audrasjb.
Fixes #50147.
Built from https://develop.svn.wordpress.org/trunk@47783


git-svn-id: http://core.svn.wordpress.org/trunk@47559 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-05-11 20:34:13 +00:00
whyisjake
fd21a9346c Formatting: Expand sanitize_file_name to have better support for utf8 characters.
Props: xknown, peterwilsoncc.

Built from https://develop.svn.wordpress.org/trunk@47638


git-svn-id: http://core.svn.wordpress.org/trunk@47413 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-04-29 15:40:07 +00:00
Sergey Biryukov
38676936ba Coding Standards: Use strict type check for in_array() and array_search() where strings are involved.
This reduces the number of `WordPress.PHP.StrictInArray.MissingTrueStrict` issues from 486 to 50.

Includes minor code layout fixes for better readability.

See #49542.
Built from https://develop.svn.wordpress.org/trunk@47550


git-svn-id: http://core.svn.wordpress.org/trunk@47325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-04-05 03:02:11 +00:00
John Blackbourn
7004afe4f4 Docs: Various docblock corrections and improvements.
See #49572
Built from https://develop.svn.wordpress.org/trunk@47461


git-svn-id: http://core.svn.wordpress.org/trunk@47248 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-03-16 18:40:07 +00:00
Sergey Biryukov
f82fd2c436 Docs: Use more specific type in parameter description for wp_unslash().
Props marekdedic.
See #48303.
Built from https://develop.svn.wordpress.org/trunk@47400


git-svn-id: http://core.svn.wordpress.org/trunk@47187 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-03-01 16:26:05 +00:00
Sergey Biryukov
641c632b0c Coding Standards: Use Yoda conditions where appropriate.
See #49222.
Built from https://develop.svn.wordpress.org/trunk@47219


git-svn-id: http://core.svn.wordpress.org/trunk@47019 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-02-09 16:55:09 +00:00
Sergey Biryukov
001ffe81fb Docs: Improve inline comments per the documentation standards.
Includes minor code layout fixes for better readability.

See #48303.
Built from https://develop.svn.wordpress.org/trunk@47122


git-svn-id: http://core.svn.wordpress.org/trunk@46922 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-01-29 00:45:18 +00:00
Sergey Biryukov
2900bb8ea7 Docs: Update links to https://secure.php.net/, they now redirect to https://www.php.net/.
See #48303.
Built from https://develop.svn.wordpress.org/trunk@47088


git-svn-id: http://core.svn.wordpress.org/trunk@46888 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-01-20 03:14:06 +00:00
Sergey Biryukov
8260786e64 Docs: Clarify descriptions for get_gmt_from_date() and get_date_from_gmt().
Props johnbillion, Rarst.
Fixes #48650.
Built from https://develop.svn.wordpress.org/trunk@46958


git-svn-id: http://core.svn.wordpress.org/trunk@46757 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-12-13 21:45:02 +00:00
whyisjake
317465e2fe Prevent stored XSS in the block editor.
Prevent escaped unicode characters become unescaped in unsafe HTML during JSON decoding.

Props: aduth, epiqueras, 

Built from https://develop.svn.wordpress.org/trunk@46896


git-svn-id: http://core.svn.wordpress.org/trunk@46696 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-12-12 18:02:03 +00:00
whyisjake
80eab318eb Prevent stored XSS through wp_targeted_link_rel().
Props: vortfu, whyisjake, peterwilsoncc, xknown,  SergeyBiryukov, flaviozavan.


Built from https://develop.svn.wordpress.org/trunk@46894


git-svn-id: http://core.svn.wordpress.org/trunk@46694 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-12-12 17:54:02 +00:00
John Blackbourn
f545bb3f63 Docs: Improve documentation of known return types, plus other docs fixes.
See #48303

Built from https://develop.svn.wordpress.org/trunk@46660


git-svn-id: http://core.svn.wordpress.org/trunk@46460 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-11-05 21:23:02 +00:00
John Blackbourn
c8f91f77ac Docs: Correct invalid hook docblocks.
See #48303

Built from https://develop.svn.wordpress.org/trunk@46603


git-svn-id: http://core.svn.wordpress.org/trunk@46400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-10-27 19:11:02 +00:00
John Blackbourn
3caaa40fc6 Docs: Switch more docs over to typed array notation, plus some fixes.
See #48303, #41756

Built from https://develop.svn.wordpress.org/trunk@46596


git-svn-id: http://core.svn.wordpress.org/trunk@46393 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-10-26 21:09:04 +00:00
Sergey Biryukov
ac3ff7eb1a Docs: Improve documentation for wptexturize().
Props atachibana.
Fixes #48397.
Built from https://develop.svn.wordpress.org/trunk@46592


git-svn-id: http://core.svn.wordpress.org/trunk@46389 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-10-26 00:58:04 +00:00
Sergey Biryukov
49007e52bc Build/Test Tools: Add banner to RTL CSS and minified JS files.
Patches occasionally come in on generated files. We should be kind to new contributors and give them a hint that these files are auto-generated.

This is a follow-up to [41271], which added the banner to minified CSS files.

Fixes #48424. See #30666.
Built from https://develop.svn.wordpress.org/trunk@46589


git-svn-id: http://core.svn.wordpress.org/trunk@46386 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-10-26 00:17:07 +00:00
Sergey Biryukov
654c413990 Comments: Add rel="nofollow ugc" attribute when converting plain URLs to <a> tags in comments via make_clickable().
Introduce `make_clickable_rel` filter for the `rel` value that is added to URL matches converted to links.

This is a follow-up to [46349], which added the `rel="nofollow ugc"` attribute to existing `<a>` tags in comments via `wp_rel_ugc()`.

UGC stands for User Generated Content, and the `ugc` attribute value is recommended for links within user generated content, such as comments and forum posts.

See https://webmasters.googleblog.com/2019/09/evolving-nofollow-new-ways-to-identify.html.

Props blogginglife, SergeyBiryukov.
Reviewed by desrosj, audrasjb.
Fixes #48022.
Built from https://develop.svn.wordpress.org/trunk@46564


git-svn-id: http://core.svn.wordpress.org/trunk@46361 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-10-21 20:41:04 +00:00
Peter Wilson
5d6cd13597 Docs: Correct documentation typo in print_emoji_detection_script().
Props itowhid06.
Fixes #48298. See #47110.

Built from https://develop.svn.wordpress.org/trunk@46470


git-svn-id: http://core.svn.wordpress.org/trunk@46268 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-10-13 02:48:01 +00:00
K. Adam White
55560a708f REST API: Do not addslash when receiving meta arrays of non-string values.
Slashing non-string data caused PUT requests containing unmodified meta arrays of integers to fail the check against the existing stored meta value, causing a 500 when posting an unmodified response body back to the server.

Props TimothyBlynJacobs, augustuswm.
Fixes #48264.

Built from https://develop.svn.wordpress.org/trunk@46454


git-svn-id: http://core.svn.wordpress.org/trunk@46252 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-10-09 17:36:01 +00:00
Sergey Biryukov
8d1e51e9c7 Docs: Add a @since note about new parameters with the spread operator added to function signatures.
Props jrf.
See #47678.
Built from https://develop.svn.wordpress.org/trunk@46451


git-svn-id: http://core.svn.wordpress.org/trunk@46249 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-10-09 04:28:02 +00:00
Aaron Jorbin
0e21d32900 Build/Test: Bump devDependencies for WordPress 5.3
This upgrades a number of devDependencies.  Some of these include changes to how the tasks are configured.

Uglify: There are deprecated options from 2.x to 4.x, see: https://github.com/gruntjs/grunt-contrib-uglify#options

Autoprefixer: Browserslist now warns when passing in the browser list, so that is put into package.json

As with most changes to uglify, this changes every minified JS file.

Fixes #48203.



Built from https://develop.svn.wordpress.org/trunk@46408


git-svn-id: http://core.svn.wordpress.org/trunk@46206 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-10-05 19:49:10 +00:00
Sergey Biryukov
f1e54593f0 Comments: Remove a one-time variable in wp_rel_nofollow() and wp_rel_ugc().
See #48022.
Built from https://develop.svn.wordpress.org/trunk@46396


git-svn-id: http://core.svn.wordpress.org/trunk@46195 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-10-05 00:56:57 +00:00
Sergey Biryukov
2afdc64723 Comments: Add rel="nofollow ugc" attribute to links in comments.
UGC stands for User Generated Content, and the `ugc` attribute value is recommended for links within user generated content, such as comments and forum posts.

See https://webmasters.googleblog.com/2019/09/evolving-nofollow-new-ways-to-identify.html.

Props audrasjb, joostdevalk, dkarfa, SergeyBiryukov.
Fixes #48022.
Built from https://develop.svn.wordpress.org/trunk@46349


git-svn-id: http://core.svn.wordpress.org/trunk@46148 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-30 01:30:58 +00:00
John Blackbourn
e36d1bcbd8 Docs: Docblock corrections and improvements, mostly related to various pre_* filters.
See #47110

Built from https://develop.svn.wordpress.org/trunk@46232


git-svn-id: http://core.svn.wordpress.org/trunk@46044 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-21 17:41:57 +00:00
Sergey Biryukov
eb3f420848 Code Modernization: Remove all code using a version_compare() with a PHP version older than PHP 5.6.
Props jrf.
Fixes #48074.
Built from https://develop.svn.wordpress.org/trunk@46214


git-svn-id: http://core.svn.wordpress.org/trunk@46026 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-20 22:02:57 +00:00
Sergey Biryukov
252628652e Script Loader: Introduce HTML5 support for scripts and styles.
When a theme declares HTML5 support for script and styles via `add_theme_support( 'html5', array( 'script', 'style' ) )`, the `type="text/javascript"` and `type="text/css"` attributes are omitted.

These attributes are unnecessary in HTML5 and cause warnings in the W3C Markup Validation Service.

Props sasiddiqui, swissspidy, knutsp, SergeyBiryukov.
See #42804.
Built from https://develop.svn.wordpress.org/trunk@46164


git-svn-id: http://core.svn.wordpress.org/trunk@45976 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-18 14:50:56 +00:00
Sergey Biryukov
6a039a5731 Code Modernisation: Introduce the spread operator in wp-includes/formatting.php.
Rather than relying `func_get_args()` to retrieve arbitrary function arguments, we can now use the spread operator to assign them directly to a variable.

Props jrf.
See #47678.
Built from https://develop.svn.wordpress.org/trunk@46128


git-svn-id: http://core.svn.wordpress.org/trunk@45940 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-15 11:06:55 +00:00
Aaron Jorbin
dd3ad3ac51 GENERAL: Remove magic quote functions
The path to magic quote sanity took a fun and exciting turn: PHP core removed it and WordPress updated the minimum version.

For the formally external pclzip, the code is commented out to make investigating easier and in case we ever need to merge upstream (if that still exists) changes.

Props ayeshrajans, jrf, jorbin.
See #47783.
Fixes #18322.

Built from https://develop.svn.wordpress.org/trunk@46105


git-svn-id: http://core.svn.wordpress.org/trunk@45917 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-13 22:21:01 +00:00
Sergey Biryukov
62b22b86a7 Improve handling the existing rel attribute in wp_rel_nofollow_callback().
Props xknown, sstoqnov.
Built from https://develop.svn.wordpress.org/trunk@45990


git-svn-id: http://core.svn.wordpress.org/trunk@45801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-04 17:37:55 +00:00
Sergey Biryukov
e199663322 I18N: Capitalize translator comments consistently, add trailing punctuation.
Includes minor code layout fixes.

See #44360.
Built from https://develop.svn.wordpress.org/trunk@45932


git-svn-id: http://core.svn.wordpress.org/trunk@45743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-03 00:41:05 +00:00
Felix Arntz
4089fad5fb Formatting: Improve accuracy of force_balance_tags() and add support for custom element tags.
This changeset includes a major iteration on the regular expression used to balance tags, with comprehensive test coverage to ensure that all scenarios are supported or unsupported as expected.

Props dmsnell, westonruter, birgire.
Fixes #47014.

Built from https://develop.svn.wordpress.org/trunk@45929


git-svn-id: http://core.svn.wordpress.org/trunk@45740 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-02 10:25:56 +00:00
Sergey Biryukov
9672302e04 Date/Time: Rewrite and simplify get_gmt_from_date(), get_date_from_gmt(), and iso8601_to_datetime() using wp_timezone().
Improve unit test coverage.

Props Rarst, goodevilgenius.
Fixes #31809.
Built from https://develop.svn.wordpress.org/trunk@45887


git-svn-id: http://core.svn.wordpress.org/trunk@45698 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-23 11:03:56 +00:00
Sergey Biryukov
c03a0bea8d Posts, Post Types: In wp_trim_words() make sure the $num_words parameter is always an integer, as documented, to avoid a PHP warning.
Props donmhico, pikamander2.
Fixes #47867.
Built from https://develop.svn.wordpress.org/trunk@45796


git-svn-id: http://core.svn.wordpress.org/trunk@45607 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-14 17:18:55 +00:00
Gary Pendergast
638bae9392 Emoji: Upgrade Twemoji to 12.1.2.
This upgrade adds support for the transgender flag: 🏳️‍⚧️

There's some additional housekeeping in this commit:

- Twemoji recently rearranged their repository and package, so `Gruntfile.js` needed tweaking to allow for that.
- As only new files were added in this Twemoji release, the CDN version didn't need updating.

Fixes #47852.


Built from https://develop.svn.wordpress.org/trunk@45769


git-svn-id: http://core.svn.wordpress.org/trunk@45580 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-08 04:05:55 +00:00
Sergey Biryukov
fec01b0685 Docs: Correct parameter type and description for is_email filter.
Props jenkoian.
Fixes #47793.
Built from https://develop.svn.wordpress.org/trunk@45703


git-svn-id: http://core.svn.wordpress.org/trunk@45514 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-31 01:26:54 +00:00
Sergey Biryukov
a186dbcb65 I18N: Update translator comments after [45674].
See #47771.
Built from https://develop.svn.wordpress.org/trunk@45676


git-svn-id: http://core.svn.wordpress.org/trunk@45487 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-25 22:52:56 +00:00
Sergey Biryukov
8e85299a00 General: First pass at replacing Codex URLs with a corresponding HelpHub or DevHub article.
Props ianbelanger, tobifjellner, SergeyBiryukov.
See #47771.
Built from https://develop.svn.wordpress.org/trunk@45674


git-svn-id: http://core.svn.wordpress.org/trunk@45485 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-25 22:45:57 +00:00
Gary Pendergast
abcbee954f Coding Standards: Fix instances of WordPress.PHP.NoSilencedErrors.Discouraged.
Noteable changes:
- The `magic_quotes_runtime` and `magic_quotes_sybase` settings were removed in PHP 5.4, so no longer need to be set.
- Some functions that use external libraries can generate errors that can't be tested for, so are globally allowed to silence errors.
- Quite a few functions would cause errors if `safe_mode` was set. This setting was removed in PHP 5.4.
- Only a handful of `header()` calls needed corresponding `headers_sent()` checks for unit tests to pass, but more may need to be added as the nightlies builds are tested.

See #46732.

Built from https://develop.svn.wordpress.org/trunk@45611


git-svn-id: http://core.svn.wordpress.org/trunk@45422 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-09 05:45:58 +00:00
Gary Pendergast
87675d288b Coding Standards: Fix all WordPress.WhiteSpace.PrecisionAlignment issues.
See #47632.


Built from https://develop.svn.wordpress.org/trunk@45602


git-svn-id: http://core.svn.wordpress.org/trunk@45413 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-05 05:21:56 +00:00
Gary Pendergast
4803fc405e Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in wp-includes.
See #47632.


Built from https://develop.svn.wordpress.org/trunk@45590


git-svn-id: http://core.svn.wordpress.org/trunk@45401 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-02 23:42:58 +00:00
Gary Pendergast
55b2d94cca Formatting: Revert the changes to wpautop() in [45585,45587].
See #27350.

Built from https://develop.svn.wordpress.org/trunk@45589


git-svn-id: http://core.svn.wordpress.org/trunk@45400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-02 11:22:56 +00:00
Gary Pendergast
b57d185bb1 Formatting: Improve performance of wpautop() on large paragraphs.
Following [45585], older versions of PHP could segfault when attempting to autop paragraphs with 10,000+ characters.

Rather than having to negative lookahead for every character in the paragraph (which could run into recursion limits), we can quickly jump ahead to the next tag and start checking from there.

See #27350.


Built from https://develop.svn.wordpress.org/trunk@45587


git-svn-id: http://core.svn.wordpress.org/trunk@45398 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-02 03:29:55 +00:00
Gary Pendergast
d7b95b1a86 Docs: Update some function docs and signatures.
- Update the `_wp_specialchars()` docs to match the function signature.
- Update the `human_time_diff()` function signature to match the docs.

Props subrataemfluence.
Fixes #46845.


Built from https://develop.svn.wordpress.org/trunk@45586


git-svn-id: http://core.svn.wordpress.org/trunk@45397 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-02 01:45:58 +00:00
Gary Pendergast
23de362563 Clean up stray <p> tags added by wpautop() inside block level tags.
`autop()` can sometimes get confused and not clean up stray `<p>` or `</p>` tags inside block level elements, which produces sub-optimal HTML. While browsers can generally handle it, there's no need to make things harder for them if we don't have to.

Props pento, ayubi, pbearne, jond, azaozz, 1994rstefan, dionysous, MikeHansenMe, jorbin, miqrogroove, niallkennedy.
Fixes #27350.



Built from https://develop.svn.wordpress.org/trunk@45585


git-svn-id: http://core.svn.wordpress.org/trunk@45396 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-02 01:31:56 +00:00
Gary Pendergast
55af0f0d0a Coding Standards: Fix/ignore the WordPress.NamingConventions.ValidFunctionName violations.
See #47632


Built from https://develop.svn.wordpress.org/trunk@45580


git-svn-id: http://core.svn.wordpress.org/trunk@45391 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-01 08:01:57 +00:00
Gary Pendergast
abc0f7dd32 Formatting: Trim leading whitespace in esc_url().
Props toszcze.
Fixes #36369.


Built from https://develop.svn.wordpress.org/trunk@45578


git-svn-id: http://core.svn.wordpress.org/trunk@45389 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-01 03:29:57 +00:00
Gary Pendergast
f3ece5149f Formatting: Don't add <p> tags inside <svg> tags.
Inline `<svg>`s should generally work, as browsers should just ignore `<p>` or `<br/>` tags that shouldn't be inside the `<svg>`. To keep things neat, however, it's better not add them in the first place.

Props jared_smith, nacin, pento.
Fixes #9437.


Built from https://develop.svn.wordpress.org/trunk@45577


git-svn-id: http://core.svn.wordpress.org/trunk@45388 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-01 03:19:58 +00:00
Gary Pendergast
691ffce019 Formatting: Add correct <p> tags near <hr> tags.
It can be tricky to know when `wpautop()` should add `<p>` tags, but one thing we can be certain about is that they really shouldn't be anywhere near `<hr>` tags.

Now they aren't.

Props solarissmoke, MattyRob, pento.
Fixes #14674.


Built from https://develop.svn.wordpress.org/trunk@45574


git-svn-id: http://core.svn.wordpress.org/trunk@45385 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-06-28 07:16:56 +00:00
Gary Pendergast
dd38e9cc0b Formatting: Add support for seconds to human_time_diff().
The web has gotten so much faster since `human_time_diff()` was created, we need to be able to measure time differences with much finer granularity. Now, we can.

Props johnjamesjacoby, pento.
Fixes #35655.


Built from https://develop.svn.wordpress.org/trunk@45573


git-svn-id: http://core.svn.wordpress.org/trunk@45384 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-06-28 06:44:57 +00:00
Gary Pendergast
d2a64fdabd Formatting: Don't convert smilies in ignored tags that have attributes.
Smilies in ignored tags are not supposed to be converted to emoji, but this can malfunction if the tag has attributes. For example, the Preformatted block with add a `class` to the `<pre>` tag.

Props pento, jikamens.
Fixes #47489.


Built from https://develop.svn.wordpress.org/trunk@45569


git-svn-id: http://core.svn.wordpress.org/trunk@45380 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-06-27 02:05:52 +00:00
John Blackbourn
c9b51df3d0 I18N: Allow the length of automatically generated excerpts to be localized.
This introduces three new strings that can be used to control the maximum length of automatically generated excerpts for posts, comments, and draft post previews in the dashboard. Optionally combined with the existing word count type control this allows languages which include many multibyte characters to specify more appropriate maximum excerpt lengths.

Props miyauchi, birgire, johnbillion

Fixes #44541

Built from https://develop.svn.wordpress.org/trunk@45505


git-svn-id: http://core.svn.wordpress.org/trunk@45316 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-06-08 18:42:52 +00:00
John Blackbourn
27365c4ec4 Build/Test Tools: Remove the dependency on a globally installed Grunt.
The existing `"grunt": "grunt"` script in `package.json` allows for the use of `npm run grunt ...` which uses the local `grunt` binary in the project's `node_modules`.

Fixes #47380

Built from https://develop.svn.wordpress.org/trunk@45445


git-svn-id: http://core.svn.wordpress.org/trunk@45256 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-05-26 19:35:51 +00:00
Sergey Biryukov
c77e771c84 Date/Time: Replace all instances of date() with gmdate().
Use of `date()` in core depends on PHP timezone set to UTC and not changed by third party code (which cannot be guaranteed).

`gmdate()` is functionally equivalent, but is not affected by PHP timezone setting: it's always UTC, which is the exact behavior the core needs.

Props nielsdeblaauw, Rarst.
Fixes #46438. See #44491.
Built from https://develop.svn.wordpress.org/trunk@45424


git-svn-id: http://core.svn.wordpress.org/trunk@45235 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-05-26 00:12:54 +00:00
John Blackbourn
9c6393e967 Docs: Switch to the more common syntax for variadic function documentation.
See #37402

Built from https://develop.svn.wordpress.org/trunk@45418


git-svn-id: http://core.svn.wordpress.org/trunk@45229 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-05-25 21:59:51 +00:00
Sergey Biryukov
a81dfbdf0e Formatting: Don't run wp_targeted_link_rel() on entirely serialized content.
Props birgire, elliotcondon.
Fixes #46402.
Built from https://develop.svn.wordpress.org/trunk@45408


git-svn-id: http://core.svn.wordpress.org/trunk@45219 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-05-25 12:05:52 +00:00
Sergey Biryukov
c1f6c6877c Formatting: Adjust wp_targeted_link_rel() to ensure JSON format is preserved and correct quotes are used when adding the missing rel attribute.
Props birgire, TobiasBg, fierevere, audrasjb, SergeyBiryukov.
Fixes #46316, #47244.
Built from https://develop.svn.wordpress.org/trunk@45348


git-svn-id: http://core.svn.wordpress.org/trunk@45159 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-05-17 12:10:02 +00:00
Gary Pendergast
699f028f21 Emoji: Upgrade Twemoji to 12.0.1.
As this point release doesn't modify any images, only adding a few missing ones, we don't need to change the CDN location.

Props earnjam.
Fixes #46805.


Built from https://develop.svn.wordpress.org/trunk@45240


git-svn-id: http://core.svn.wordpress.org/trunk@45049 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-04-18 02:11:52 +00:00
Sergey Biryukov
3ab2803af2 Docs: Add missing @since tags for wp_targeted_link_rel() and wp_targeted_link_rel_callback().
See #43187, #46543.
Built from https://develop.svn.wordpress.org/trunk@45163


git-svn-id: http://core.svn.wordpress.org/trunk@44972 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-04-11 21:16:51 +00:00
Gary Pendergast
a125989772 Emoji: Update Twemoji to version 12.0.0.
Props pento, superpoincare.
Fixes #46404, #46805.

Built from https://develop.svn.wordpress.org/trunk@45134


git-svn-id: http://core.svn.wordpress.org/trunk@44943 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-04-08 05:22:51 +00:00
Boone Gorges
05fa2363ab Posts: Avoid the use of globals in get_the_content() and related functions.
This changeset introduces `$post` parameters to `get_the_content()` and
`wp_trim_excerpt()`. When a `$post` object is passed to one of these functions,
the functions will operate on the data from that object, rather than from the
post globals (`$authordata`, `$page`, etc). This ensures that the functions work
in a predictable manner when used outside of the regular post loop.

The global-mismatch problem is surfaced in cases where `get_the_excerpt()` is
called outside of the post loop, on posts that don't have a defined excerpt. In
these cases, the post globals - used to generate a fallback excerpt - may refer
to the incorrect object, resulting in PHP notices or other unpredictable
behavior. See #36934 for a related issue.

Props spacedmonkey, kraftbj, Shital Patel.
Fixes #42814.
Built from https://develop.svn.wordpress.org/trunk@44941


git-svn-id: http://core.svn.wordpress.org/trunk@44772 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-20 15:49:49 +00:00
Sergey Biryukov
c4f8bc468d PHPCS: Fix errors introduced in [44833].
Built from https://develop.svn.wordpress.org/trunk@44858


git-svn-id: http://core.svn.wordpress.org/trunk@44690 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-12 22:56:49 +00:00
Sergey Biryukov
2504efcf94 Formatting: Improve rel="nofollow" handling in comments.
Built from https://develop.svn.wordpress.org/trunk@44833


git-svn-id: http://core.svn.wordpress.org/trunk@44665 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-12 22:15:50 +00:00
Gary Pendergast
cddee8b72e Formatting: Loosen the type checking in _sanitize_text_fields().
[44618] added strict type checking to `_sanitize_text_fields()`, which has caused some compat issues with plugins.

We can loosen the type checking to only reject objects and arrays, and cast other types to string.

Props Nick_theGeek, pento.
Fixes #41450.


Built from https://develop.svn.wordpress.org/trunk@44731


git-svn-id: http://core.svn.wordpress.org/trunk@44562 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-02-07 23:35:49 +00:00
Peter Wilson
d9a1f99d9c Customize: Remove wp_targeted_link_rel pre-save filter from change-sets.
The pre-save filters added to links in [43732] could invalidate JSON data when saving Customizer change-sets.

This removes the filters when saving and publishing change-sets.

Props peterwilsoncc, nikeo for testing.
See #45292.


Built from https://develop.svn.wordpress.org/trunk@44714


git-svn-id: http://core.svn.wordpress.org/trunk@44545 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-29 21:29:50 +00:00
Peter Wilson
24e8467c6f Formatting: Prevent wp_targeted_link_rel() adding an empty attribute.
Bypass adding a `rel` attribute when the `wp_targeted_link_rel` filter returns an empty string or other falsy result.

Props mcmwebsol, spartank, meatman89fs.
Fixes #45352.

Built from https://develop.svn.wordpress.org/trunk@44691


git-svn-id: http://core.svn.wordpress.org/trunk@44522 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-22 21:55:51 +00:00
Gary Pendergast
0ee053758e Emoji: Upgrade Twemoji to 11.2.0.
This upgrade includes general improvements to the style of a variety of emoji.

Full changelog: https://github.com/twitter/twemoji/compare/v11.0.0...v11.2.0

Props desrosj, pento.
Fixes #45133.


Built from https://develop.svn.wordpress.org/trunk@44644


git-svn-id: http://core.svn.wordpress.org/trunk@44475 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-18 01:42:50 +00:00
Gary Pendergast
dcdfd7f412 Docs: Fix the last handful of incorrect @since 5.0.0 docblock tags.
Props peterwilsoncc.
Fixes #45543.


Built from https://develop.svn.wordpress.org/trunk@44635


git-svn-id: http://core.svn.wordpress.org/trunk@44466 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-17 06:46:50 +00:00
Gary Pendergast
077af6e47d Docs: Improve the sanitize_email filter.
- Remove duplicate parameter names.
- Fix the wrong value being passed in the second parameter.
- Correct the type of the `$message` parameter.

Props ChriCo.
Fixes #45595.


Built from https://develop.svn.wordpress.org/trunk@44620


git-svn-id: http://core.svn.wordpress.org/trunk@44451 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-16 06:16:49 +00:00
Gary Pendergast
0bbb277ee4 Formatting: Add type checking to _sanitize_text_fields().
When a non-string value is passed, return an empty string.

Props Mte90.
Fixes #41450.


Built from https://develop.svn.wordpress.org/trunk@44618


git-svn-id: http://core.svn.wordpress.org/trunk@44449 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-16 06:05:49 +00:00
Gary Pendergast
10c66fb426 Formatting: Remove soft hyphens when sanitising titles.
Props andg.
Fixes #45378.


Built from https://develop.svn.wordpress.org/trunk@44579


git-svn-id: http://core.svn.wordpress.org/trunk@44410 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-14 05:39:51 +00:00
Gary Pendergast
4f861b9548 Coding Standards: Fix the Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace violations.
See #45934.


Built from https://develop.svn.wordpress.org/trunk@44566


git-svn-id: http://core.svn.wordpress.org/trunk@44397 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-11 06:40:50 +00:00
Gary Pendergast
8e623691c0 Emoji: Fix a code formatting error introduced in [44554].
See #45930.


Built from https://develop.svn.wordpress.org/trunk@44556


git-svn-id: http://core.svn.wordpress.org/trunk@44387 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-10 23:40:49 +00:00
Gary Pendergast
92146fe52b Emoji: Improve performance when encoding or staticizing emoji.
Both `wp_encode_emoji()` and `wp_staticize_emoji()` perform a PHP version check when deciding how to apply their behaviour, but this check only needs to happen once, rather than every time in their internal looks.

Moving the check outside of the loop reduces processing time by 50%.

Props johnbillion.
Fixes #45930.


Built from https://develop.svn.wordpress.org/trunk@44554


git-svn-id: http://core.svn.wordpress.org/trunk@44385 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-10 23:20:52 +00:00
desrosj
9d7aa3436e Block Editor: Update @wordpress dependencies.
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 favor 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 favor of a `render_block` filter in `render_block()`.

Also, a little cleanup to `render_block()`. Always normalize `$block['attrs’]` to array in `’render_block’` filter.
Props pento, azaozz.

Merges [43884] and [43888] to trunk.

See #45145, #45190, #45264, #45282.
Built from https://develop.svn.wordpress.org/trunk@44261


git-svn-id: http://core.svn.wordpress.org/trunk@44091 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 04:52:00 +00:00
Jeremy Felt
7509965a56 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.

Merges [43879] and [43881] from the 5.0 branch to trunk.

Props pento, nerrad.
Fixes #45290.

Built from https://develop.svn.wordpress.org/trunk@44226


git-svn-id: http://core.svn.wordpress.org/trunk@44056 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 03:06:12 +00:00