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.
git-svn-id: https://develop.svn.wordpress.org/trunk@45587 602fd350-edb4-49c9-b593-d223f7449a82
- 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.
git-svn-id: https://develop.svn.wordpress.org/trunk@45586 602fd350-edb4-49c9-b593-d223f7449a82
`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.
git-svn-id: https://develop.svn.wordpress.org/trunk@45585 602fd350-edb4-49c9-b593-d223f7449a82
Add a new `terms_pre_query` filter which returns null by default. Return a non-null value to bypass WordPress's default `get_terms` queries.
Props jarocks, boonebgorges, spacedmonkey.
Fixes#41246.
git-svn-id: https://develop.svn.wordpress.org/trunk@45584 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@45577 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@45574 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@45573 602fd350-edb4-49c9-b593-d223f7449a82
For a number of years, the Media modal missed an explicit ARIA role and the required attributes for modal dialogs.
This was confusing for assistive technology users, since they may not realize they're inside a dialog, and that consequently the keyboard interactions may be different from the rest of the page. Lack of an explicit label for the dialog was confusing as well, since assistive technology users didn't have an immediate sense of what the dialog is for.
This change makes the Media modal meet the ARIA Authoring Practices recommendations, helping users better understand the purpose and interactions with the modal. Also, it makes sure to hide the rest of the page content from assistive technologies, until support for `aria-modal="true"` improves.
Additionally:
- moves the modal H1 heading to the beginning of the modal content
- changes the modal left menu position to make visual and DOM order match
- improves the `wp.media.view.FocusManager` documentation
Fixes#47145.
git-svn-id: https://develop.svn.wordpress.org/trunk@45572 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@45569 602fd350-edb4-49c9-b593-d223f7449a82
Add `Cache-Control` and `Expires` HTTP headers to prevent caching of requests to WP Cron on systems supporting fastcgi_finish_request().
The fastcgi_finish_request() call prevents the setting of further HTTP headers by caching plugins subsequently loaded.
Props kingkero.
Fixes 47396.
git-svn-id: https://develop.svn.wordpress.org/trunk@45560 602fd350-edb4-49c9-b593-d223f7449a82
Fix an issue where searching installed themes for an empty string resulted in matching all themes.
Props afercia, desrosj, hesyifei, evalarumbe.
Fixes#39041.
git-svn-id: https://develop.svn.wordpress.org/trunk@45557 602fd350-edb4-49c9-b593-d223f7449a82
Time calculations should not need to rely on manipulating global PHP configuration state.
Props Rarst.
Fixes#46483.
git-svn-id: https://develop.svn.wordpress.org/trunk@45556 602fd350-edb4-49c9-b593-d223f7449a82
In [42767] the quick edit button changed from a link to a button. This caused the jQuery code that selects on a link to no longer work. This commit restores the previous behavior.
Fixes#47572.
See #43382, #38677.
git-svn-id: https://develop.svn.wordpress.org/trunk@45553 602fd350-edb4-49c9-b593-d223f7449a82
This allows for blocking plugin activation if it requires a higher version of PHP or WordPress, and does not have a `readme.txt` file.
If the headers are defined in both `readme.txt` and the main plugin file, precedence is given to the plugin file.
Props afragen, Otto42, Ipstenu.
Fixes#46938.
git-svn-id: https://develop.svn.wordpress.org/trunk@45546 602fd350-edb4-49c9-b593-d223f7449a82
- Introduces `wp_get_missing_image_subsizes()` and `wp_update_image_subsizes()` to generate image sub-sizes that are missing or were not created after the upload.
- Adds a way to display errors that happened while creating sub-sizes.
- Introduces `wp_create_image_subsizes()` intended for use after an image was uploaded. It saves/updates the image metadata immediately after each sub-size is created. This fixes the (long standing) problem when some of the sub-size image files were created but there was a timeout or an error and the metadata was not saved. Until now such uploads were considered "failed" which usually resulted in the user trying to upload the same image again, creating even more "orphan" image files.
Note that the patch also includes some unrelated WPCS fixes.
Props mikeschroder, azaozz.
See #40439.
git-svn-id: https://develop.svn.wordpress.org/trunk@45538 602fd350-edb4-49c9-b593-d223f7449a82
In [38887], installing themes in the Customizer was disabled for multisite installs. However, an update link continues to be displayed when a theme update is available. Clicking the link causes a JavaScript error.
This removes that update link because updates cannot actually be performed in the Customizer in this situation.
Props desrosj, earnjam, mukesh27, audrasjb, garrett-eclipse.
Fixes#46997.
git-svn-id: https://develop.svn.wordpress.org/trunk@45527 602fd350-edb4-49c9-b593-d223f7449a82
- keeps focus management only where necessary to avoid focus losses
- removes focus management where a specific user workflow was assumed
- makes the "Attachment Details" navigation buttons really disabled when there are no next or previous attachments
- adds inline comments to clarify all the usages of focus()
Fixes#43169.
git-svn-id: https://develop.svn.wordpress.org/trunk@45524 602fd350-edb4-49c9-b593-d223f7449a82
- Move the (remaining) privacy tools related functions from `wp-admin/includes/file.php` to `wp-admin/includes/privacy-tools.php`.
- Move the `WP_User_Request` class to a separate file.
See #43895.
git-svn-id: https://develop.svn.wordpress.org/trunk@45519 602fd350-edb4-49c9-b593-d223f7449a82
Introduces the faux primitive capability `view_site_health_checks` available to single site admins and multisite super-admin to view the site health page within the admin.
The capability is mapped to the `install_plugins` capability without being dependent on the file system being writable. This fixes a bug where the feature couldn't be used by sites unable to write to the file system or managed through version control.
The capability is granted on the `user_has_cap` filter.
Props birgire, Clorith, palmiak, peterwilsoncc, spacedmonkey.
Fixes#46957.
git-svn-id: https://develop.svn.wordpress.org/trunk@45507 602fd350-edb4-49c9-b593-d223f7449a82
Making the visual and DOM order match benefits keyboard users who navigate documents sequentially and expect the focus order to be consistent with the sequential reading order.
Fixes#47458.
git-svn-id: https://develop.svn.wordpress.org/trunk@45506 602fd350-edb4-49c9-b593-d223f7449a82
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
git-svn-id: https://develop.svn.wordpress.org/trunk@45505 602fd350-edb4-49c9-b593-d223f7449a82
This means that logging and debugging functionality can access the error code and error message for erroneous responses under all conditions. The hook is not fired when a request is short-circuited with the `pre_http_request` filter, because this filter itself can be used in that situation.
Fixes#25747
git-svn-id: https://develop.svn.wordpress.org/trunk@45504 602fd350-edb4-49c9-b593-d223f7449a82
- makes the buttons visual order match the DOM order
- also, restores the focus style on the "hero" primary button after [34948]
Props vrimill, mukesh27 for reporting and testing.
Fixes#45094.
git-svn-id: https://develop.svn.wordpress.org/trunk@45503 602fd350-edb4-49c9-b593-d223f7449a82
The extra border was visible in the responsive view for smaller screens after [32844].
Props jitendrabanjara1991.
Fixes#46749.
git-svn-id: https://develop.svn.wordpress.org/trunk@45501 602fd350-edb4-49c9-b593-d223f7449a82
- changes the media views form controls to have explicitly associated labels with for/id attributes
- adds a few missing labels / aria-labels
- improves a few existing labels / aria-labels
- improves semantics in a few places, by adding visually hidden headings, fieldset + legend elements, aria-describedby attributes
- improves the image custom size input fields and their labelling
- adds `role="status"` to the "saved" indicator so that status messages are announced to assistive technologies
- swaps the columns source order in the image details template, to make visual and DOM order match
- swaps the "Replace" and "Back" buttons source order in the Replace Image view, to make visual and DOM order match
- gallery settings: move checkbox label to the right: checkboxes are supposed to have labels on the right
- merge similar strings, unified to "Drop files to upload" (removed "Drop files here", and "Drop files anywhere to upload")
- makes the "upload-ui" consistent across the media views
- hides the IE 11 "X" `::-ms-clear` button in the Insert from URL field, as it conflicts with the uploading spinner
- adds comments to all the media templates to clarify their usage
- slightly increases vertical spacing between form fields in the media sidebar
- removes some CSS selectors introduced as backwards compatibility for WordPress pre-4.4
- removes some CSS still targeting Internet Explorer 7 and 8
Fixes#47141.
Fixes#47122.
git-svn-id: https://develop.svn.wordpress.org/trunk@45499 602fd350-edb4-49c9-b593-d223f7449a82
Reverts [29264]. As we now have a build task to replace dashicons for RTL, the CSS rules no longer worked as expected and had the opposite effect.
Props ramiy, SergeyBiryukov.
Fixes#46289.
git-svn-id: https://develop.svn.wordpress.org/trunk@45495 602fd350-edb4-49c9-b593-d223f7449a82
The `.hidden` class can be used to show and hide UI elements instead.
Props birgire, pratikthink, garrett-eclipse.
Fixes#44839.
git-svn-id: https://develop.svn.wordpress.org/trunk@45490 602fd350-edb4-49c9-b593-d223f7449a82
Providing this query parameter ensures the stylesheet contains the `font-display: fallback` rule. This changeset also updates the Open Sans font used by core accordingly.
Props westonruter.
Fixes#47282.
git-svn-id: https://develop.svn.wordpress.org/trunk@45485 602fd350-edb4-49c9-b593-d223f7449a82
Remove styles for `wp-admin/update-core.php` accidentally duplicated in Media section as part of the same reorganization.
See #46530.
git-svn-id: https://develop.svn.wordpress.org/trunk@45483 602fd350-edb4-49c9-b593-d223f7449a82
The user’s locale is passed in the `$meta` parameter for `insert_user_meta`. Added in [38705].
Props tmatsuur.
Fixes#47423.
git-svn-id: https://develop.svn.wordpress.org/trunk@45479 602fd350-edb4-49c9-b593-d223f7449a82
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
git-svn-id: https://develop.svn.wordpress.org/trunk@45445 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@45424 602fd350-edb4-49c9-b593-d223f7449a82
- effectively hides the "Post locked" information from assistive technologies
- when a post is locked, reveals the "Post locked" information without CSS animation
- the height CSS animation didn't work anyways after [24906]
See #24553.
Fixes#44946.
git-svn-id: https://develop.svn.wordpress.org/trunk@45417 602fd350-edb4-49c9-b593-d223f7449a82
- adds `role="presentation"` to the edit comment table
- removes a few pointless `<fieldset>` elements
- adds a few missing `<label>` elements
- adds the CSS class `class="td-full"` to table rows spanning to multiple cells
- adds explicit `scope="row"` attribute to the table headers in `options-permalink.php`: this table is better communicated as data table
- uses consistent label association in the "Privacy Settings" page
- in the installation page "Set up your database connection": associates descriptions to their inout fields using `aria-describedby`
- improves the link to gravatar.com in the `user-edit.php` page
See #46899.
Fixes#47390.
git-svn-id: https://develop.svn.wordpress.org/trunk@45416 602fd350-edb4-49c9-b593-d223f7449a82
This introduces a link to the support page for resetting your password, and improves the error by bringing it into the login page instead of a `wp_die()`.
Props neelpatel7295, estelaris, desrosj
git-svn-id: https://develop.svn.wordpress.org/trunk@45404 602fd350-edb4-49c9-b593-d223f7449a82
Adds `role="presentation"` to the `<table>` elements used for layout purposes.
Ideally, HTML tables should be used for tabular data. When tables are used for layout purposes, it's important to remove any native semantics so that assistive technologies can correctly announce the table content in a linearized fashion.
Props greatislander, afercia.
Fixes#46899.
git-svn-id: https://develop.svn.wordpress.org/trunk@45403 602fd350-edb4-49c9-b593-d223f7449a82
This change means that users who can't read the site's current language can more easily identify controls that allow them to change either the site language or their own admin area language.
Props janak007, atlasmahesh, afercia, birgire, JoshuaWold
Fixes#43144
git-svn-id: https://develop.svn.wordpress.org/trunk@45402 602fd350-edb4-49c9-b593-d223f7449a82
* Make `site_url` filter in `wp_logout_url()` aware of the `logout` action.
* Make `network_site_url` filter in `wp_lostpassword_url()` aware of the `lostpassword` action.
Props jfarthing84.
Fixes#43407.
git-svn-id: https://develop.svn.wordpress.org/trunk@45398 602fd350-edb4-49c9-b593-d223f7449a82
Restore `$previousweekday` global usage in `the_weekday_date()`, so it could still be used simultaneously with `the_date()`.
Partially reverts [45378].
See #47354.
git-svn-id: https://develop.svn.wordpress.org/trunk@45379 602fd350-edb4-49c9-b593-d223f7449a82
* Make `the_date()` always apply the the filter and return a value.
* Use `is_new_day()` in `the_weekday_date()`.
* Add a unit test for `the_weekday_date()`.
Fixes#47354.
git-svn-id: https://develop.svn.wordpress.org/trunk@45378 602fd350-edb4-49c9-b593-d223f7449a82
The maximum modified time for a is currently being determined after an arbitrary date format is applied. Because the string sort in `max()` is being used to return the highest (most recent) modified value, the incorrect date is sometimes returned. This was introduced in [45247].
Props onlanka, Rarsr, mukesh27.
Fixes#47304.
git-svn-id: https://develop.svn.wordpress.org/trunk@45367 602fd350-edb4-49c9-b593-d223f7449a82
`wp-admin/includes/update-core.php` runs in the context of the previous WordPress version. Any calls to newly introduced functions there need to be checked via `function_exists()`.
Reviewed by desrosj, earnjam, SergeyBiryukov.
Props dd32, imath.
Fixes#47323.
git-svn-id: https://develop.svn.wordpress.org/trunk@45365 602fd350-edb4-49c9-b593-d223f7449a82
Allow `flex`, `flex-grow`, `flex-shrink` and `flex-basis` to be used in inline CSS. As of WordPress 5.3 the block editor is expected to use `flex-basis` inline to set the width in the column block.
Props aduth.
Fixes#47281.
See #37248.
git-svn-id: https://develop.svn.wordpress.org/trunk@45363 602fd350-edb4-49c9-b593-d223f7449a82
This complements the check for successful writing to the `terms` table, added in [7430].
Props mbabker.
Fixes#47313.
git-svn-id: https://develop.svn.wordpress.org/trunk@45362 602fd350-edb4-49c9-b593-d223f7449a82
Additionally, fix a regression in [44451] where the error message in `wp-admin/upgrade.php` was prepared, but never displayed.
Props afragen, netweb, hareesh-pillai, SergeyBiryukov.
Fixes#46937.
git-svn-id: https://develop.svn.wordpress.org/trunk@45357 602fd350-edb4-49c9-b593-d223f7449a82
This allows automated scripts and test suites to interpret the result correctly.
Props jrf, spacedmonkey.
Fixes#47169.
git-svn-id: https://develop.svn.wordpress.org/trunk@45350 602fd350-edb4-49c9-b593-d223f7449a82
The sodium_compat library can be very slow for certain operations on 32-bit architectures, which can lead to web server timeouts while attempting to verify an update. This adds a runtime speed check to skip signature verification on systems that would otherwise time out. Includes simple unit tests.
Props dd32, paragoninitiativeenterprises.
See #47186.
git-svn-id: https://develop.svn.wordpress.org/trunk@45345 602fd350-edb4-49c9-b593-d223f7449a82
This adds a runtime_speed_test() method for estimating if the 32-bit implementation is fast enough for expensive computations.
Props paragoninitiativeenterprises.
See #47186.
git-svn-id: https://develop.svn.wordpress.org/trunk@45344 602fd350-edb4-49c9-b593-d223f7449a82
Use an established pattern of moving additional link attributes out of the translatable string.
Props dimadin.
Fixes#47159.
git-svn-id: https://develop.svn.wordpress.org/trunk@45334 602fd350-edb4-49c9-b593-d223f7449a82