Commit Graph

36563 Commits

Author SHA1 Message Date
Jeremy Felt 0dd638a2e7 Multisite: Check only valid looking emails against banned domain list.
If an email address is missing an `@`, we can't assume enough to check it against a list of domain names.

Additional validation of email should happen in `is_email()` before being passed to `is_email_address_unsafe()`.

Fixes #39915.


git-svn-id: https://develop.svn.wordpress.org/trunk@40595 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-09 16:54:52 +00:00
Jeremy Felt 3e9c46812c Multisite: Validate email before checking against banned domains.
Previously, an invalid email could result in an undefined index when attempting to determine the email domain.

Props ocean90.
See #39915.


git-svn-id: https://develop.svn.wordpress.org/trunk@40594 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-09 16:32:53 +00:00
Felix Arntz 4678a2c00e Multisite: Add `$network_id` parameter to `wp_maybe_update_network_user_counts()`.
This allows calling the function for a specific network correctly, for example after a user has been created for it or been removed from it.

Fixes #40385. See #38699.


git-svn-id: https://develop.svn.wordpress.org/trunk@40593 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-09 16:07:46 +00:00
Felix Arntz a78b5259c6 Multisite: Add missing documentation for new `$network_id` parameter of `wp_maybe_update_network_site_counts()`.
This was overlooked in [40591].

See #40384.


git-svn-id: https://develop.svn.wordpress.org/trunk@40592 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-09 16:01:49 +00:00
Felix Arntz 28d82148db Multisite: Add `$network_id` parameter to `wp_maybe_update_network_site_counts()`.
This allows calling the function for a specific network correctly, for example after a site has been created for it or been removed from it.

Fixes #40384. See #38699.


git-svn-id: https://develop.svn.wordpress.org/trunk@40591 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-09 15:59:39 +00:00
Felix Arntz 1515787d31 Multisite: Add `$network_id` parameter to `wp_is_large_network()`.
Now that `get_blog_count()` and `get_user_count()` both support passing a `$network_id` parameter (see [40370] and [40371]), similar functionality is now available for `wp_is_large_network()`. In addition, the filter `wp_is_large_network` now accepts the network ID as its fourth parameter.

This changeset furthermore introduces unit tests for the `wp_is_large_network()` function and its filter.

Fixes #40489.


git-svn-id: https://develop.svn.wordpress.org/trunk@40590 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-09 15:50:04 +00:00
Felix Arntz 48661c4b00 Multisite: Introduce `minimum_site_name_length` filter.
Prior to this change, the minimum site name length checked in `wpmu_validate_blog_signup()` was set to a fixed value of 4. The new filter allows tweaking this value, as there may be cases where shorter site names may be required.

Fixes #39676.


git-svn-id: https://develop.svn.wordpress.org/trunk@40589 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-09 14:58:39 +00:00
Andrew Ozz 4469ab9d66 Editor: Add `wp.editor.remove()` for editors that were dynamically instantiated from JS.
Fixes: #35760

git-svn-id: https://develop.svn.wordpress.org/trunk@40588 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-09 03:40:30 +00:00
Andrew Ozz 3d2137f1b4 TinyMCE: improve adding of custom UI to the MCE Factory.
Props iseulde.
Fixes #40690.

git-svn-id: https://develop.svn.wordpress.org/trunk@40587 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-09 01:39:49 +00:00
Andrea Fercia 6e868eed6e Themes: Fix missing search field in the Theme Install screen after [40572].
Props desrosj, cristianozanca for reporting.
Fixes #34881.


git-svn-id: https://develop.svn.wordpress.org/trunk@40586 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-08 15:58:52 +00:00
Andrew Ozz 656718a645 Fix linting errors in tinymce-obsolete.js.
See #40690.

git-svn-id: https://develop.svn.wordpress.org/trunk@40585 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-08 06:05:39 +00:00
Andrew Ozz 1727d6fbef TinyMCE: remove the pre-4.6.0 tests. Move regression testing for obsolete tags and attributes to the default QUnit tests.
See #40690.

git-svn-id: https://develop.svn.wordpress.org/trunk@40584 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-08 05:35:41 +00:00
Andrew Ozz f4d3513802 TinyMCE: update to 4.6.0. Has many new features and bug fixes, changelog: https://www.tinymce.com/docs/changelog/#version460-may42017.
Fixes #40690.

git-svn-id: https://develop.svn.wordpress.org/trunk@40583 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-08 05:31:08 +00:00
pento 491f14540e Emoji: Make the UN flag test more accurate.
Previously, the UN flag test relied on the image being produced to be quite small. Unfortunately, the Chrome PNG encoder seems to have changed recently, and it now produces a relatively large image.

For a better test, we can compare the rendering of [U] + [N] against [U] + zero width space + [N].

Fixes #40616.



git-svn-id: https://develop.svn.wordpress.org/trunk@40582 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-08 05:00:29 +00:00
John Blackbourn 45b183ea79 Users: Correct a permission check when showing the User item in the `+ New` admin toolbar menu.
Props dlh
Fixes #39252


git-svn-id: https://develop.svn.wordpress.org/trunk@40581 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-07 17:41:24 +00:00
John Blackbourn d87cc35a5c Users: Clear the user settings cookies when clearing auth cookies.
This prevents lingering cookies when logging out and when switching between user accounts.

Props soulseekah, shanee
Fixes #32567


git-svn-id: https://develop.svn.wordpress.org/trunk@40580 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-07 16:53:51 +00:00
Andrea Fercia df479ac58e Administration: Restore missing spinner when installing a new language.
Fixes #40478.


git-svn-id: https://develop.svn.wordpress.org/trunk@40579 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-07 12:00:45 +00:00
Andrea Fercia cd239819b9 Accessibility: Make the Get Shortlink button be a real button.
Worth noting, as of WordPress 4.4, the Get Shortlink button is hidden by default
but it can be restored via filters.

Props Cheffheid.
See #26504.
Fixes #40448.


git-svn-id: https://develop.svn.wordpress.org/trunk@40578 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-07 11:46:52 +00:00
Joe Hoyle cc661013cf REST API: WP_REST_Request::remove_header() should canonicalize header names.
When headers are stored in WP_REST_Request internally they are canonicalized. This step already happens on setting / getting headers in any way, but was missed when implementing remove_header().

Props TimothyBlynJacobs.
Fixes #40347.


git-svn-id: https://develop.svn.wordpress.org/trunk@40577 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-07 04:08:42 +00:00
Pascal Birchler 09fad66ae4 Administration: Remove unit and prefixed version from a CSS declaration.
The prefixed version gets added by Autoprefixer already.

Props MatheusFD.
Fixes #35358.


git-svn-id: https://develop.svn.wordpress.org/trunk@40576 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-06 14:36:17 +00:00
swissspidy fd211c9a2e Cron API: Add a new `wp_doing_cron()` helper function.
This replaces `DOING_CRON` checks via the constant.

Props tfrommen.
Fixes #39591.


git-svn-id: https://develop.svn.wordpress.org/trunk@40575 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-06 14:29:01 +00:00
Pascal Birchler 9a2188dd56 Embeds: Add screencast.com to oEmbed provider whitelist.
Props ENDif Media.
Fixes #38367.


git-svn-id: https://develop.svn.wordpress.org/trunk@40574 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-06 14:24:37 +00:00
Andrea Fercia f0b0147985 Accessibility: Improve the suggested image size text in the media views.
Adds `pixels` as unit, avoiding abbreviation for a clearer pronunciation by screen
readers. Also, adds the word `by` instead of the special character `times`.

Props Presskopp, stormrockwell.
Fixes #38932.


git-svn-id: https://develop.svn.wordpress.org/trunk@40573 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-05 23:28:41 +00:00
Andrea Fercia 3f6a8f2ca8 Accessibility: Wrap the installed themes search field within a form element.
Valid code is important not just to formally meet the specification, but also to
ensure user agents, including assistive technologies, can accurately interpret
and parse content. When HTML elements are not used in the recommended way,
user agents may render them in unexpected ways. It can also become a problem for
compatibility with older or even future browsers, devices, or other software.
See W3C WCAG 4.1.1.

Props takayukister, aryamaaru.
Fixes #34881.


git-svn-id: https://develop.svn.wordpress.org/trunk@40572 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-05 19:01:12 +00:00
Adam Silverstein c5595574d7 REST API: Improve strings added after 4.7 string freeze.
Clarify the `rest_orderby_include_missing_include` error message.

Props PranaliPatel.
Fixes #39178.


git-svn-id: https://develop.svn.wordpress.org/trunk@40571 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-05 18:48:09 +00:00
Andrea Fercia e49e372671 Accessibility: Improve the color contrast ratio of the dismiss notice buttons.
Props chris_dev.
Fixes #39970.


git-svn-id: https://develop.svn.wordpress.org/trunk@40570 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-04 22:31:17 +00:00
Andrea Fercia 859c3551ac Customize: Fix a visual glitch on the widget control animation introduced in [40480].
Also, restores the original design intent that was meant to "compact widget-tops
on smaller laptops, but not tablets".

See #27112.
Fixes #31476.


git-svn-id: https://develop.svn.wordpress.org/trunk@40569 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-03 22:38:26 +00:00
Andrea Fercia 2dec345a1b Accessibility: Avoid a keyboard trap on the date and time custom format settings.
Using the `focus` event on the date and time custom format fields made impossible
to navigate through all the form fields using only the keyboard without actually
selecting the custom format setting. Instead, using `click` and `input` preserves
the original functionality when using any kind of pointing or input device.

Fixes #40515.


git-svn-id: https://develop.svn.wordpress.org/trunk@40568 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-02 20:02:49 +00:00
Weston Ruter 7f3f93c1d1 Customize: Allow `select` dropdowns to stretch full width in widened controls pane.
Props timmydcrawford.
Amends [40511].
Fixes #32296.


git-svn-id: https://develop.svn.wordpress.org/trunk@40567 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-02 19:29:06 +00:00
Sergey Biryukov 9e07667864 Menus: Introduce `page_menu_link_attributes` filter in `Walker_Page::start_el()` for the HTML attributes applied to a page menu item's anchor element.
This complements the `nav_menu_link_attributes` filter used in `Walker_Nav_Menu::start_el()`.

Props pbiron.
Fixes #40359.

git-svn-id: https://develop.svn.wordpress.org/trunk@40565 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-01 23:31:16 +00:00
John Blackbourn c759785cea Build/Test Tools: Automatically skip tests in the `ms-required` and `ms-excluded` groups.
This removes the need to manually call `$this->skipWithMultisite()` and `$this->skipWithoutMultisite()` from within the test when the test only runs without Multisite or only runs on Multisite, respectively.

Props jdgrimes for the suggestion.

Fixes #40531


git-svn-id: https://develop.svn.wordpress.org/trunk@40564 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-01 20:34:10 +00:00
John Blackbourn f72ce6dc6e Users: Add two missing special cases to the capability tests for non-logged-in users.
Also updates a `expectedIncorrectUsage` notation.

See #37405


git-svn-id: https://develop.svn.wordpress.org/trunk@40563 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-01 16:18:19 +00:00
John Blackbourn 34207d7aeb Build/Test Tools: Pin the WordPress Importer plugin to version 0.6.3 when testing on Travis.
Fixes #40620


git-svn-id: https://develop.svn.wordpress.org/trunk@40562 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-01 11:29:29 +00:00
John Blackbourn 46fab9de51 Build/Test Tools: Add object-cache.php to the unit test suite.
This removes an unnecessary external dependency from the Travis tests.

Fixes #40619


git-svn-id: https://develop.svn.wordpress.org/trunk@40561 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-01 11:20:30 +00:00
John Blackbourn c2fd41759c Users: Ensure user counts remain accurate if users are added to or removed from the `users` table without corresponding `usermeta` entries being added or removed.
This has a slight performance impact on sites with a large number of users when the `time` strategy is used for counting users. Hopefully this impact will be negated by enhancements proposed in #38741.

Props psoluch, dots, boonebgorges, ptbello, tharsheblows

Fixes #29785


git-svn-id: https://develop.svn.wordpress.org/trunk@40560 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-30 13:02:50 +00:00
John Blackbourn 7c1d20422f Posts, Post Types: Revert [40558] pending investigation.
See #18375


git-svn-id: https://develop.svn.wordpress.org/trunk@40559 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-30 11:18:43 +00:00
John Blackbourn 0940f8396c Posts, Post Types: Correct the attachment post type template unit test introduced in [38951].
Also adds additional assertions for the templates.

See #18375


git-svn-id: https://develop.svn.wordpress.org/trunk@40558 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-29 21:15:34 +00:00
Boone Gorges 7c4248b5e0 Fix broken `check_comment()` test.
The test `Tests_Comment_CheckComment::test_should_return_true_when_content_does_not_match_moderation_keys()`
did not, in fact, test for a `true` value, but for a false one.
Switching to `assertTrue()` caused a failure, because the test comment
triggered the 'comment_moderation' test. As in other tests in the file,
the solution is to force 'comment_moderation' to 0 for the purposes of
the test.

Introduced in [32519].

Props stephdau.
Fixes #40584.

git-svn-id: https://develop.svn.wordpress.org/trunk@40557 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-27 16:22:36 +00:00
Andrea Fercia 5d027d64fd Widgets: Improve the News dashboard widget no-js notice.
In the rare case this notice was displayed, it was unstyled. Uses the notice 
error style to make it prettier and consistent with other no-js notices.
Also, some CSS clean-up.

Fixes #40529.


git-svn-id: https://develop.svn.wordpress.org/trunk@40556 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-25 16:41:26 +00:00
John Blackbourn 626547e9cf Feeds: Remove an incorrect usage of `sizeof()` in a helper class used during unit testing of XML element handling.
This also helps tidy up the test output when running PHP 7.2.

See #40109


git-svn-id: https://develop.svn.wordpress.org/trunk@40555 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-24 01:22:39 +00:00
John Blackbourn 127b1592f7 Build/Test Tools: Remove HHVM from the test infrastructure on Travis.
Fixes #40548


git-svn-id: https://develop.svn.wordpress.org/trunk@40546 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-24 00:27:28 +00:00
John Blackbourn 4602012570 REST API: Remove a useless unit test.
See #35907, #38373


git-svn-id: https://develop.svn.wordpress.org/trunk@40545 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-23 22:19:29 +00:00
John Blackbourn a16ada6d31 Build/Test Tools: Remove more unnecessary test skipping when erroneous situations occur.
See #40533


git-svn-id: https://develop.svn.wordpress.org/trunk@40544 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-23 22:11:52 +00:00
John Blackbourn 64f8351da1 Build/Test Tools: Introduce `skipWithoutMultisite()` and `skipWithMultisite`() methods into the test suite.
This brings much needed uniformity to test skipping when a test requires Multisite or when a test should be excluded from running when Multisite is enabled.

Used in conjunction with the `@group ms-required` and `@group ms-excluded` notation, this removes a significant number of skipped tests from the default test suite run.

Fixes #40531


git-svn-id: https://develop.svn.wordpress.org/trunk@40543 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-23 21:57:31 +00:00
John Blackbourn e3a9d87083 Build/Test Tools: More tweaks to the deprecated calls assertion. This needs to be triggered when there are unexpected deprecated calls or wrongdoings too.
See #40538


git-svn-id: https://develop.svn.wordpress.org/trunk@40542 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-23 21:34:37 +00:00
John Blackbourn 21ce4e90d3 Build/Test Tools: Only perform an assertion for deprecated calls and wrongdoings if any are expected.
This avoids masking risky tests that don't otherwise perform an assertion.

See #40538


git-svn-id: https://develop.svn.wordpress.org/trunk@40541 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-23 21:28:44 +00:00
Sergey Biryukov 1eb45efa86 Help/About: Fix typo in help text on Reading Settings screen.
Props Arena94, bhargavbhandari90.
Fixes #40530.

git-svn-id: https://develop.svn.wordpress.org/trunk@40540 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-23 14:33:37 +00:00
John Blackbourn f5bf5ba8b8 Build/Test Tools: Move the `setExpectedException()` method into the `WP_Ajax_UnitTestCase` class to avoid a fatal error when PHPUnit 3.6 is in use.
This needs more investigation but it gets the test suite on PHP 5.2 passing again.

See #39822


git-svn-id: https://develop.svn.wordpress.org/trunk@40539 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-23 11:45:46 +00:00
John Blackbourn 06391f0872 Build/Test Tools: Add Composer files to the cache on Travis.
The Travis cache is specific to the branch and language version (PHP version), so this should speed up each subsequent build once the cache is primed.

Props netweb

Fixes #40539


git-svn-id: https://develop.svn.wordpress.org/trunk@40538 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-23 11:39:43 +00:00
Peter Wilson 1345e33a21 Menus: Add filter to sub-menu class in nav menus.
Add new filter `nav_menu_submenu_css_class` to the `Walker_Nav_Menu::start_el()` method, allowing themers to modify the sub menu classes output by `wp_nav_menu()`.

Props: csloisel, darthaud, raisonon.
Fixes: #36163.


git-svn-id: https://develop.svn.wordpress.org/trunk@40537 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-23 07:15:47 +00:00