Commit Graph

40381 Commits

Author SHA1 Message Date
Sergey Biryukov
209666d332 Code Modernisation: Simplify some logic in apply_filters().
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46146 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 12:03:04 +00:00
Sergey Biryukov
802c23e059 Code Modernisation: Replace call_user_func_array() in tests/phpunit/tests/db.php with dynamic function calls.
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46145 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:55:42 +00:00
Sergey Biryukov
1ace25088f Code Modernisation: Replace call_user_func_array() in various __call() methods with dynamic function calls.
The callback in these functions is always checked against a limited list of valid callbacks that can be safely changed to dynamic function calls.

Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46144 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:53:01 +00:00
Sergey Biryukov
1418bd0ffa Code Modernisation: Replace call_user_func_array() in wp-includes/class-wp-walker.php with dynamic function calls.
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46143 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:49:51 +00:00
Sergey Biryukov
927098e5aa Code Modernisation: Replace call_user_func_array() in wp-cron.php with a direct function call.
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46142 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:47:38 +00:00
Sergey Biryukov
0432a9f6b5 Code Modernisation: Remove redundant call to func_get_arg() in wp-includes/class-wp-rewrite.php.
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46141 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:46:44 +00:00
Sergey Biryukov
0521e61398 Code Modernisation: Remove redundant calls to func_get_arg() in wp-includes/class-wp-admin-bar.php.
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46140 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:45:45 +00:00
Sergey Biryukov
d4d853ee3f Code Modernisation: Replace call_user_func_array() in combination with an empty array in wp-includes/class-wp-hook.php with call_user_func().
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46139 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:44:09 +00:00
Sergey Biryukov
fd05ea0de9 Code Modernisation: Replace call_user_func_array() in wp-admin/includes/widgets.php and associated unit tests with a direct function call.
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46138 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:40:08 +00:00
Sergey Biryukov
751f69be42 Code Modernisation: Replace call_user_func_array() in wp-admin/includes/template.php with a dynamic function call.
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46137 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:34:23 +00:00
Sergey Biryukov
f16a56ca41 Code Modernisation: Replace call_user_func_array() in wp-admin/includes/ajax-actions.php with a dynamic function call.
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46136 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:33:20 +00:00
SergeyBiryukov
e17d5accc3 Code Modernisation: Replace call_user_func_array() in wp-includes/post-template.php with a dynamic function call.
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46135 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:31:02 +00:00
Sergey Biryukov
45827d6e7a Code Modernisation: Replace call_user_func_array() in wp-includes/nav-menu-template.php with a dynamic function call.
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46134 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:30:25 +00:00
Sergey Biryukov
db2bc9a167 Code Modernisation: Replace call_user_func_array() in wp-includes/class-wp-customize-*.php with direct function calls in combination with the spread operator.
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46133 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:26:16 +00:00
Sergey Biryukov
416e3d6c10 Code Modernisation: Replace call_user_func_array() in wp-includes/capabilities.php with a direct function call.
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46132 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:22:51 +00:00
Sergey Biryukov
49de2b7312 Code Modernisation: Introduce the spread operator in wp-admin/includes/media.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.

git-svn-id: https://develop.svn.wordpress.org/trunk@46131 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:11:14 +00:00
Sergey Biryukov
752c36bbf4 Code Modernisation: Introduce the spread operator in wp-admin/includes/dashboard.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.

git-svn-id: https://develop.svn.wordpress.org/trunk@46130 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:10:17 +00:00
SergeyBiryukov
24a586b97f Code Modernisation: Introduce the spread operator in wp-includes/deprecated.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.

While these functions are deprecated, they can still get a minor performance boost in case they are being called.

Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46129 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:08:02 +00:00
Sergey Biryukov
cb1f496cce 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@46128 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:05:31 +00:00
Sergey Biryukov
3ae54e84da Code Modernisation: Introduce the spread operator in tests/phpunit/*.
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.

git-svn-id: https://develop.svn.wordpress.org/trunk@46127 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:03:45 +00:00
Sergey Biryukov
516f528421 Code Modernisation: Introduce the spread operator in wp-includes/functions.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.

git-svn-id: https://develop.svn.wordpress.org/trunk@46126 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 10:44:58 +00:00
Sergey Biryukov
af246a6797 Code Modernisation: Introduce the spread operator in wp-admin/includes/class-*-upgrader-skin.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.

git-svn-id: https://develop.svn.wordpress.org/trunk@46125 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 10:41:03 +00:00
Sergey Biryukov
1431a7a39f Code Modernisation: Introduce the spread operator in wp-includes/class-wp-dependency.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.

git-svn-id: https://develop.svn.wordpress.org/trunk@46124 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 10:35:03 +00:00
Sergey Biryukov
e5a17836c7 Code Modernisation: Introduce the spread operator in wp-includes/category-template.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.

git-svn-id: https://develop.svn.wordpress.org/trunk@46123 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 10:32:54 +00:00
Sergey Biryukov
812033f092 Code Modernisation: Use the spread operator in wp_register_sidebar_widget().
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.

Missed in [45629].

Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46122 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 10:30:16 +00:00
Sergey Biryukov
355cdce6b7 Coding Standards: Fix WPCS issue in [46120].
See #47820.

git-svn-id: https://develop.svn.wordpress.org/trunk@46121 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 02:06:07 +00:00
Sergey Biryukov
7b60544cce Docs: Clarify in update_option() description that it's plugin author's responsibility to check the current user's capabilities before saving any option changes.
Props dinhtungdu, lllor.
Fixes #47820.

git-svn-id: https://develop.svn.wordpress.org/trunk@46120 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 01:28:51 +00:00
Sergey Biryukov
317da56a37 Site Health: Show a more specific fatal error message when in Recovery Mode with headers already sent.
Props garrett-eclipse, TimothyBlynJacobs, mukesh27, marybaum, afragen, Clorith, mdwolinski, SergeyBiryukov.
Fixes #47321.

git-svn-id: https://develop.svn.wordpress.org/trunk@46119 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 01:17:24 +00:00
Sergey Biryukov
7b8c666b72 Mail: Add a unit test to make sure wp_mail() does not duplicate the MIME-Version header added automatically by PHPMailer.
See #43542.

git-svn-id: https://develop.svn.wordpress.org/trunk@46118 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-14 21:34:51 +00:00
Sergey Biryukov
3ac6f6a8f8 Bundled Themes: Update the message shown when a comment is awaiting moderation.
If the commenter doesn't have cookies set, they won't see the comment preview again. Showing an expanded message will help offset any confusion if they revisit the site later, and their comment is still in moderation, but they can't see it anymore.

Props birgire, superpoincare.
Fixes #47461. See #43857.

git-svn-id: https://develop.svn.wordpress.org/trunk@46117 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-14 20:59:29 +00:00
Sergey Biryukov
65b4c64440 Coding Standards: Fix WPCS issue in [46115].
See #43542.

git-svn-id: https://develop.svn.wordpress.org/trunk@46116 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-14 20:41:48 +00:00
Sergey Biryukov
848a329478 Mail: Avoid setting duplicate MIME-Version and X-Mailer headers in wp_mail(), they are added automatically by PHPMailer.
Props lbenicio, junktrunk, danieltj, studyboi, bennemann.
Fixes #43542.

git-svn-id: https://develop.svn.wordpress.org/trunk@46115 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-14 20:13:37 +00:00
Aaron Jorbin
4a0f1f2a5a Build/Test Tools: add php info to travis output
Fixes #48041.


git-svn-id: https://develop.svn.wordpress.org/trunk@46114 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-14 19:27:46 +00:00
Aaron Jorbin
926bcf1278 Comment out magic quote functions
Follow up to r46112.

See: #47751,#47783, #48040.


git-svn-id: https://develop.svn.wordpress.org/trunk@46113 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-14 19:22:50 +00:00
Aaron Jorbin
43fd102495 Update getID3 library to fix issues with PHP7.4
Updates to trunk version that includes fixes for PHP7.4

Changelog:
https://github.com/JamesHeinrich/getID3/compare/v1.9.14...00f3fbfd77e583099ca70a3cf0bc092e113d2b20

See: #47751,#47783.
Fixes: #48040.



git-svn-id: https://develop.svn.wordpress.org/trunk@46112 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-14 19:06:09 +00:00
Jorge Costa
6444dba200 Block Editor: Backport block styles server functions from block editor.
This commit backports the block styles functionality added to the block editor in https://github.com/WordPress/gutenberg/pull/16356.

Props: youknowriad, aduth, swissspidy.
Fixes #48039.

git-svn-id: https://develop.svn.wordpress.org/trunk@46111 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-14 18:20:58 +00:00
Jorge Costa
31a2e8af87 Block Editor: Add preloading of autosaves.
With the introduction of https://github.com/WordPress/gutenberg/pull/7945, the block editor requests autosave data when the editor is loaded. This can be optimized by preloading the request server-side and then passing the request data to the client using the preloading mechanism in editor-form-blocks.php.

Props: talldanwp, aduth.

git-svn-id: https://develop.svn.wordpress.org/trunk@46110 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-14 16:46:26 +00:00
SergeyBiryukov
e4e1c7380c Bootstrap/Load: Allow charset to be passed to the wp_die() function.
Props mohsinrasool, spacedmonkey, socalchristina.
Fixes #46666.

git-svn-id: https://develop.svn.wordpress.org/trunk@46109 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-14 15:41:02 +00:00
Sergey Biryukov
a70be65d1f Coding Standards: Fix WPCS issue in [46107].
See #46631.

git-svn-id: https://develop.svn.wordpress.org/trunk@46108 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-14 15:18:10 +00:00
Sergey Biryukov
0b48fd2493 HTTP API: Add a unit test for get_status_header_desc().
Props pbearne.
Fixes #46631.

git-svn-id: https://develop.svn.wordpress.org/trunk@46107 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-14 14:53:45 +00:00
Sergey Biryukov
4f2fc80f65 Site Health: Modify the grading indicator to remove percentage score in favor of a "Good" or "Should be improved" status.
This removes arbitrary confusion about what the numbers mean.

Props Clorith, hedgefield, Cybr, arena, DavidAnderson, earnjam, daveshine, Otto42, azaozz, asadkn, KARTHOST, tigertech, maximejobin, johnbillion, raboodesign, ramiy, afragen.
Fixes #47046.

git-svn-id: https://develop.svn.wordpress.org/trunk@46106 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-14 14:28:47 +00:00
Aaron Jorbin
08df15ab58 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@46105 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-13 22:19:34 +00:00
Jonathan Desrosiers
53ec5e3fbf Correct the version number specified in [46102].
See #45361.

git-svn-id: https://develop.svn.wordpress.org/trunk@46104 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-13 18:54:06 +00:00
Adam Silverstein
96b4b1a70d Login and Registration: reset password - ensure submit button disabled when field empty.
Fix an issue where the submit button was enabled with an empty password when the user previously checked "Confirm use of weak password" for a weak password, then cleared the password field.

Props henry.wright.
Fixes #47924.



git-svn-id: https://develop.svn.wordpress.org/trunk@46103 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-13 18:29:29 +00:00
Jonathan Desrosiers
50a0d6c7a9 Menus: Nav menu locations should not be integers.
When nav menu location slugs are integers, some hard to debug results can occur. `register_nav_menus()` utilizes `array_merge()` which renumbers numeric indexes, starting from 0. Because of this, numeric menu locations will almost always be changed.

This change introduces a `_doing_it_wrong()` notice to inform developers that nav menu locations should always be strings.

Props audrasjb, desrosj, welcher.
Fixes #45361.

git-svn-id: https://develop.svn.wordpress.org/trunk@46102 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-13 17:57:57 +00:00
Sergey Biryukov
84f073cc52 REST API: Use correct parameter name in rest_validate_value_from_schema() error messages.
Props manzoorwanijk.
Fixes #47905.

git-svn-id: https://develop.svn.wordpress.org/trunk@46101 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-13 03:05:15 +00:00
Adam Silverstein
2b4cecf316 Multisite: improve sites_pre_query and networks_pre_query filters, avoiding db queries.
Improve the `pre_query` filters in multisite classes introduced in r44983. Return (non null) values immediately,
avoiding the database queries entirely, similar to other `pre_query` filters.

Props spacedmonkey, SergeyBiryukov, felipeelia.
Fixes #47599.



git-svn-id: https://develop.svn.wordpress.org/trunk@46100 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-12 22:16:08 +00:00
K. Adam White
b979a99355 REST API: Accept string path in rest_ensure_request.
Update `rest_ensure_request()` to accept a string path, permitting a string path to be passed to `rest_do_request()` as is indicated (previously inaccurately) in that method's PHPDoc.

Props TimothyBlynJacobs, kadamwhite.
Fixes #40614.


git-svn-id: https://develop.svn.wordpress.org/trunk@46099 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-12 21:46:41 +00:00
K. Adam White
ee69f54b8a REST API: Return term resources in "edit" context after PUT or POST request.
Props westonruter, dlh.
Fixes #41411.



git-svn-id: https://develop.svn.wordpress.org/trunk@46098 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-12 21:28:14 +00:00
Sergey Biryukov
1b7bba613d Mail: Update PHPMailer to 5.2.27.
The full list of changes is available here:
https://github.com/PHPMailer/PHPMailer/compare/v5.2.22...PHPMailer:v5.2.27

Props MattyRob, ayeshrajans, rogueresearch, bgermann, slaFFik, Presskopp, aaroncampbell.
Fixes #40472.

git-svn-id: https://develop.svn.wordpress.org/trunk@46097 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-12 14:36:42 +00:00