Commit Graph

40891 Commits

Author SHA1 Message Date
Andrew Ozz
a276995ff9 Upload: Run the final file name collision test in wp_unique_filename() for each existing file + 1.
Props pbiron.
See #48975.


git-svn-id: https://develop.svn.wordpress.org/trunk@46976 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-17 20:50:16 +00:00
Sergey Biryukov
a4b65bfca8 Date/Time: Ensure that get_feed_build_date() correctly handles a modified post object with invalid date.
* Clarify in the documentation that the function returns `false` on failure.
* Consistently pass the return value through the `get_feed_build_date` filter.

Props Rarst, dd32, azaozz, tellyworth.
Fixes #48957.

git-svn-id: https://develop.svn.wordpress.org/trunk@46974 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-17 20:41:09 +00:00
Sergey Biryukov
9d69e005ea Docs: Clarify that get_lastpostdate() and get_lastpostmodified() can return false on failure.
The both use `_get_last_post_time()` internally.

Props Rarst.
See #48957.

git-svn-id: https://develop.svn.wordpress.org/trunk@46973 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-17 20:24:46 +00:00
Sergey Biryukov
ed3e924683 Upgrade/Install: Remove unused global in upgrade_430_fix_comments().
Props adnan.limdi.
Fixes #41970.

git-svn-id: https://develop.svn.wordpress.org/trunk@46972 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-17 16:43:22 +00:00
Sergey Biryukov
81a54a49d4 Login/Registration: Pass the error data to the wp_login_failed action.
Props hamedmoodi, rixeo.
Fixes #49007.

git-svn-id: https://develop.svn.wordpress.org/trunk@46971 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-17 15:34:49 +00:00
Sergey Biryukov
7261695f7d Docs: Correct @type for timeout argument in WP_Http::request().
Props georgestephanis, benedictsinger.
Fixes #49005.

git-svn-id: https://develop.svn.wordpress.org/trunk@46970 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-17 15:23:33 +00:00
Sergey Biryukov
69ddf953bd Date/Time: Add a unit test for [46968].
See #48145.

git-svn-id: https://develop.svn.wordpress.org/trunk@46969 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-17 14:35:25 +00:00
Sergey Biryukov
e8c854d2ce Date/Time: In wp_insert_post(), when checking the post date to set future or publish status, use a proper delta comparison.
[3525] allowed a difference up to 59 seconds between the post date/time and the current time to consider the post published instead of scheduled, but that didn't take start of a new minute into account.

Rapidly creating post fixtures in unit tests could encounter a one-second discrepancy between `current_time( 'mysql' )` and `gmdate( 'Y-m-d H:i:s' )`, returning values like `2019-12-16 23:43:00` vs. `2019-12-16 23:42:59`, respectively, and setting the post to a `future` status instead of `publish`.

[45851], while working as intended, made the issue somewhat more likely to occur.

This caused all sorts of occasional random failures in various tests on Travis, mostly on PHP 7.1.

Fixes #48145.

git-svn-id: https://develop.svn.wordpress.org/trunk@46968 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-17 02:23:51 +00:00
Andrew Ozz
5e813adcdc Fix the colors in all color schemes for the .active class for buttons.
Props ryelle, audrasjb.
Fixes #49003 for trunk.

git-svn-id: https://develop.svn.wordpress.org/trunk@46967 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-17 00:13:47 +00:00
Andrew Ozz
99ef48a585 Upload: Fix the final file name collision test in wp_unique_filename() when uploading a file with upper case extension. Add a unit test to catch that in the future.
Fixes #48975 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@46966 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-16 23:42:34 +00:00
Andrew Ozz
735b3543db Upload:
- Fix PHP warnings in `wp_unique_filename()` when the destination directory is unreadable.
- Run the final name collision test only for files that are saved to the uploads directory.
- Update the unit tests to match.

Props eden159, audrasjb, azaozz.
Fixes #48960 for trunk.

git-svn-id: https://develop.svn.wordpress.org/trunk@46965 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-16 23:22:00 +00:00
Sergey Biryukov
8a88cfac42 Coding Standards: Use strict comparison in wp-admin/widgets.php.
Props jenilk.
Fixes #49000.

git-svn-id: https://develop.svn.wordpress.org/trunk@46964 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-16 12:53:59 +00:00
Sergey Biryukov
2a8f0cb9e0 Coding Standards: Use strict comparison in wp-admin/includes/network.php.
Props ataurr.
Fixes #48994.

git-svn-id: https://develop.svn.wordpress.org/trunk@46963 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-16 12:35:26 +00:00
Sergey Biryukov
3b25bc4362 Coding Standards: Use strict comparison in wp-admin/edit-tags.php.
Props passoniate.
Fixes #48985.

git-svn-id: https://develop.svn.wordpress.org/trunk@46962 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-15 10:44:37 +00:00
Sergey Biryukov
ee4f57d509 Coding Standards: Use strict comparison in wp-admin/term.php.
Props vinita29.
Fixes #48983.

git-svn-id: https://develop.svn.wordpress.org/trunk@46961 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-15 09:43:08 +00:00
Sergey Biryukov
49c6bc2a69 Coding Standards: Add missing braces to if conditions in js/_enqueues/wp/util.js.
Props ankitmaru.
Fixes #48980.

git-svn-id: https://develop.svn.wordpress.org/trunk@46960 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-15 08:43:42 +00:00
Sergey Biryukov
b202cb423a Formatting: Return early from wp_kses_attr_check() if the element is not in the list of allowed elements and attributes.
Props krynes, tristanleboss.
Fixes #48549.

git-svn-id: https://develop.svn.wordpress.org/trunk@46959 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-14 15:51:33 +00:00
Sergey Biryukov
1440dab429 Docs: Clarify descriptions for get_gmt_from_date() and get_date_from_gmt().
Props johnbillion, Rarst.
Fixes #48650.

git-svn-id: https://develop.svn.wordpress.org/trunk@46958 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-13 21:43:06 +00:00
Sergey Biryukov
5e840c755e I18N: Replace file names in translatable strings on Permalink Settings screen with placeholders.
Props ramiy.
Fixes #48863.

git-svn-id: https://develop.svn.wordpress.org/trunk@46957 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-13 21:25:14 +00:00
Ian Belanger
b7b29ddfc9 Bundled Themes: Bump version number and update changelog in Twenty Twenty for WordPress 5.3.1.
This bumps the Twenty Twenty version number to `1.1` and update the `readme.txt` changelog.

Props audrasjb, sinatrateam, SergeyBiryukov
Fixes #48944.

git-svn-id: https://develop.svn.wordpress.org/trunk@46902 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-12 18:24:33 +00:00
Jake Spurlock
7c38cf178a Prevent stored XSS in the block editor.
Prevent escaped unicode characters become unescaped in unsafe HTML during JSON decoding.

Props: aduth, epiqueras, 


git-svn-id: https://develop.svn.wordpress.org/trunk@46896 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-12 18:00:45 +00:00
Jake Spurlock
39a8eacb5f 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.

Props: xknown, nickdaugherty, peterwilsoncc.


git-svn-id: https://develop.svn.wordpress.org/trunk@46895 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-12 17:52:18 +00:00
Jake Spurlock
dcab984b1b Prevent stored XSS through wp_targeted_link_rel().
Props: vortfu, whyisjake, peterwilsoncc, xknown,  SergeyBiryukov, flaviozavan.



git-svn-id: https://develop.svn.wordpress.org/trunk@46894 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-12 17:51:35 +00:00
Jake Spurlock
fb952b5ce0 Ensure that a user can publish_posts before making a post sticky.
Props: danielbachhuber, whyisjake, peterwilson, xknown.



git-svn-id: https://develop.svn.wordpress.org/trunk@46893 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-12 17:50:13 +00:00
Sergey Biryukov
a69a2c241d Docs: Update description for get_categories() to avoid suggesting the deprecated type argument.
Follow-up to [13754].

Props dingo_d.
Fixes #48913.

git-svn-id: https://develop.svn.wordpress.org/trunk@46891 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-12 16:45:32 +00:00
Sergey Biryukov
2830c6869c Upgrade/Install: Improve the appearance of language selection on install:
* Remove a stray chevron.
* Improve focus and hover styles.

Props garrett-eclipse, audrasjb.
Fixes #48927.

git-svn-id: https://develop.svn.wordpress.org/trunk@46887 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-11 23:01:23 +00:00
Sergey Biryukov
3778b1eb82 Comments: Avoid a PHP notice in comment_form() if the email field is not set.
Follow-up to [46090].

Props mat-lipe.
Fixes #48943.

git-svn-id: https://develop.svn.wordpress.org/trunk@46885 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-11 22:12:09 +00:00
Andrew Ozz
c85e33c28f Fixes in admin-bar.js:
- Silence errors when a node doesn't exist similarly to jQuery.
- Add "feature testing" and fallbacks for old browsers as this may run on the front-end.
- Improve inline docs.

Props dinhtungdu, azaozz.
Fixes #47069.

git-svn-id: https://develop.svn.wordpress.org/trunk@46883 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-11 18:54:55 +00:00
Sergey Biryukov
b73180da85 Tests: Docs: Correct @param formatting in SpeedTrapListener after [35226] and [45607].
See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@46882 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-11 15:46:51 +00:00
Sergey Biryukov
2c55227995 Tests: Correct the slowThreshold option name for SpeedTrapListener.
The previous change in [45607] appears to be accidental.

Props Rarst.
Fixes #48933.

git-svn-id: https://develop.svn.wordpress.org/trunk@46881 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-11 15:40:57 +00:00
Sergey Biryukov
3575a07f4b Docs: Improve documentation for wp_dashboard_browser_nag() and dashboard_browser_nag_class().
Props grapplerulrich.
Fixes #48932.

git-svn-id: https://develop.svn.wordpress.org/trunk@46880 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-11 10:57:44 +00:00
Andrew Ozz
0566a2a5fb TinyMCE: remove CSS map reference from /tinymce/skins/lightgray/skin.min.css.
Props AlexHolsgrove.
Fixes #48577.

git-svn-id: https://develop.svn.wordpress.org/trunk@46879 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-10 18:31:46 +00:00
Sergey Biryukov
78feb00f7c Comments: Optimize the query for pending comments count in wp_notify_moderator() for better performance on large tables.
Props sgoen.
Fixes #48514.

git-svn-id: https://develop.svn.wordpress.org/trunk@46878 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-10 13:45:41 +00:00
Sergey Biryukov
7ac5a9f003 Coding Standards: Fix WPCS and JSHint issues in [46872].
See #47069.

git-svn-id: https://develop.svn.wordpress.org/trunk@46874 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-10 01:32:56 +00:00
Andrew Ozz
2133f8392e Fix the admin toolbar js when jQuery is not present and replace the jQuery based hoverIntent.js with a native implementation. Introduces the "hoverintent" (no dependencies) package.
Props dinhtungdu, audrasjb, azaozz.
Fixes #47069.

git-svn-id: https://develop.svn.wordpress.org/trunk@46872 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-10 01:01:35 +00:00
Sergey Biryukov
ada69f53ed Block Editor: Resolve @wordpress/block-directory to the expected version, 1.0.6.
Follow-up to [46860].

Props aduth, garrett-eclipse, audrasjb, azaozz.
Fixes #48884.

git-svn-id: https://develop.svn.wordpress.org/trunk@46870 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-09 22:27:41 +00:00
Sergey Biryukov
c1ab0cc974 Menus: Avoid a PHP warning in add_submenu_page() when the same value is passed for both $parent_slug and $menu_slug parameters.
Props welcher, ispreview, ayeshrajans, NextScripts, adamsilverstein, garrett-eclipse, 123host.
Fixes #48599.

git-svn-id: https://develop.svn.wordpress.org/trunk@46868 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-09 21:01:13 +00:00
Sergey Biryukov
f090f8528c Administration: Standardize form control height and alignment across the admin.
This improves the appearance of various form controls in the admin and addresses some visual inconsistencies in WordPress 5.3.

Props afercia, audrasjb, jameskoster, GDragoN, azaozz, michaelarestad, murgroland, SamuelFernandez, chetan200891, veminom, dlh.
Fixes #48420.

git-svn-id: https://develop.svn.wordpress.org/trunk@46866 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-09 20:24:17 +00:00
Sergey Biryukov
bdca31b322 Date/Time: XML-RPC: Сalculate the proper offset for GMT in wp.newPost, wp.editComment, mw.newPost, mw.editPost when post_date or comment_date is set.
Previously, `post_date` or `comment_date` was assumed to be GMT, which is only true if the timezone string for the site matches GMT.

Add unit tests.

Props Rarst, smerriman, justdaiv, wonderboymusic, noyle.
Fixes #30429.

git-svn-id: https://develop.svn.wordpress.org/trunk@46864 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-09 19:54:16 +00:00
Sergey Biryukov
50f01f47e3 Date/Time: When determining whether to decline the month name in wp_maybe_decline_date(), take word boundaries into account.
Add more unit tests.

Props Rarst, Clorith, timon33, Xendo, SergeyBiryukov.
Fixes #48606.

git-svn-id: https://develop.svn.wordpress.org/trunk@46862 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-09 18:48:50 +00:00
Sergey Biryukov
2e175cad63 Block Editor: Bug fixes targeted for WordPress 5.3.1.
The list of included fixes:

- Edge scrolling issues https://github.com/WordPress/gutenberg/pull/17707
- Intermittent JavaScript issues https://github.com/WordPress/gutenberg/pull/18559
- Remove embed CollegeHumor https://github.com/WordPress/gutenberg/pull/18591 

Updated packages:

- @wordpress/block-directory@1.0.6
- @wordpress/block-editor@3.2.5
- @wordpress/block-library@2.9.6
- @wordpress/core-data@2.7.5
- @wordpress/edit-post@3.8.6
- @wordpress/editor@9.7.6
- @wordpress/format-library@1.9.5

Props youknowriad, ellatrix, epiqueras, audrasjb, gziolo, mcsf, kyliesabra.
Fixes #48884.

git-svn-id: https://develop.svn.wordpress.org/trunk@46860 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-09 17:35:22 +00:00
Sergey Biryukov
3360da28a6 Upgrade/Install: Update sodium_compat to v1.12.1.
This includes a speedup for signature verification on most platforms and bugfixes for 32-bit platforms.

Props paragoninitiativeenterprises, lukaswaudentio.
Fixes #48371.

git-svn-id: https://develop.svn.wordpress.org/trunk@46858 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-09 16:40:11 +00:00
Sergey Biryukov
a521300d9f Media: Use consistent width for Scale and Crop inputs.
Follow-up to [46359].

Props sabernhardt, audrasjb.
Fixes #48907.

git-svn-id: https://develop.svn.wordpress.org/trunk@46856 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-09 16:21:10 +00:00
Sergey Biryukov
55de626b72 Twenty Twenty: Adjust the comment in [46851] per the documentation standards.
See #48876.

git-svn-id: https://develop.svn.wordpress.org/trunk@46854 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-09 16:16:09 +00:00
Sergey Biryukov
cb9ed875b2 Help/About: Add a hover effect for links on About pages.
* Add a color that passes WCAG color contrast criteria to every link.
* Add an underline for links in credits list only on hover/focus.

Props audrasjb, ixkaito, mukesh27, melchoyce, SergeyBiryukov.
Fixes #48582.

git-svn-id: https://develop.svn.wordpress.org/trunk@46852 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-09 15:29:47 +00:00
Ian Belanger
9b69d0f71d Bundled Themes: Misaligned input placeholder text Twenty Twenty.
This fixes placeholder misalignment in Firefox when a `height` is added as an inline style to the input field.

Props aljullu, subratamal.
Fixes #48876.

git-svn-id: https://develop.svn.wordpress.org/trunk@46851 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-09 15:08:16 +00:00
Sergey Biryukov
2de8f8b3cd Twenty Twenty: Remove redundant echo for bloginfo() call in footer.php.
Props acosmin.
Fixes #48918.

git-svn-id: https://develop.svn.wordpress.org/trunk@46849 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-09 14:58:52 +00:00
Sergey Biryukov
c96a56c223 Administration: Correct checkbox width in list tables on smaller screens.
Previously, checkboxes for pending comments were partially hidden due to an added `4px` border.

Props audrasjb, jeremyfelt, talldanwp, melchoyce, marcelo2605, waleedt93.
Fixes #48815.

git-svn-id: https://develop.svn.wordpress.org/trunk@46845 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-09 14:24:26 +00:00
Ian Belanger
868f91eec7 Bundled Themes: Make checkbox in comment form larger Twenty Twenty.
This makes the checkbox in the comment form larger and more consistent with other checkboxes.

Props kharisblank, audrasjb.
Fixes #48652.

git-svn-id: https://develop.svn.wordpress.org/trunk@46844 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-09 14:06:55 +00:00
Sergey Biryukov
9c82519c13 Accessibility: Menus: Properly disable form controls on the Menus screen that cannot be used until at least one menu is created.
This ensures that the actual UI controls state matches the visually conveyed state.

Props afercia, audrasjb, dinhtungdu, sathyapulse, simonjanin, welcher, SergeyBiryukov.
Fixes #48409.

git-svn-id: https://develop.svn.wordpress.org/trunk@46842 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-09 13:47:12 +00:00