Commit Graph

281 Commits

Author SHA1 Message Date
John Blackbourn
55bbcf0391 Networks and Sites: Clarify the docblock for get_current_site() so it's clear that it returns the current network object, not anything to do with the current site. As a further exercise, the reader is invited to fix the nomenclature surrounding blogs, sites, and networks in WordPress.
Props ericlewis
Fixes #35414

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


git-svn-id: http://core.svn.wordpress.org/trunk@36260 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-14 00:02:25 +00:00
John Blackbourn
a5d44337b2 Docs: @param fixes for a variety of docblocks.
See #32246

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


git-svn-id: http://core.svn.wordpress.org/trunk@36199 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-09 01:45:26 +00:00
John Blackbourn
1402c3d8b4 Docs: Miscellaneous docblock corrections.
See #32246

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


git-svn-id: http://core.svn.wordpress.org/trunk@36034 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-23 06:31:27 +00:00
Sergey Biryukov
bc1e479fd0 After [35718], update the location of some files in This filter is documented in docs.
Partially reverts [33954].

Fixes #33413.
Built from https://develop.svn.wordpress.org/trunk@35725


git-svn-id: http://core.svn.wordpress.org/trunk@35689 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-11-22 03:51:28 +00:00
Sergey Biryukov
95c55ca251 Cast 'illegal_user_logins' filter result to array.
See #27317.
Built from https://develop.svn.wordpress.org/trunk@35630


git-svn-id: http://core.svn.wordpress.org/trunk@35594 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-11-12 16:34:27 +00:00
Sergey Biryukov
b08ae1d60b Users: After [35189], make 'illegal_user_logins' check case-insensitive.
Props juliobox.
Fixes #27317.
Built from https://develop.svn.wordpress.org/trunk@35629


git-svn-id: http://core.svn.wordpress.org/trunk@35593 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-11-12 16:30:28 +00:00
Drew Jaynes
81524f3bfc Filesystem: Following the introduction of the KB|MB|GB|TB_IN_BYTES constants in [35286], use them in various places in core.
Props sudar.
Fixes #22405.

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


git-svn-id: http://core.svn.wordpress.org/trunk@35291 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-21 14:03:25 +00:00
Sergey Biryukov
7f08716c16 Users: Add 'illegal_user_logins' filter to allow certain usernames to be blacklisted.
Props danielbachhuber, chriscct7, crazycoolcam, SergeyBiryukov.
Fixes #27317.
Built from https://develop.svn.wordpress.org/trunk@35189


git-svn-id: http://core.svn.wordpress.org/trunk@35155 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-15 05:43:26 +00:00
Drew Jaynes
217b661703 Docs: Add missing descriptions for the $wpdb global in DocBlocks all the places.
See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@35136 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-14 23:44:25 +00:00
Drew Jaynes
a0bbd154d9 Multisite: Improve two error strings specifying allowed characters in usernames and site names.
Also removes two error strings that were likely never being triggered anyway due to the stricter character matching higher up.

Props atomicjack, bjornjohansen, DrewAPicture.
Fixes #33336.

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


git-svn-id: http://core.svn.wordpress.org/trunk@35108 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-13 17:33:24 +00:00
Jeremy Felt
092478579a MS: Adjust _network_option() parameter order, $network_id is first.
This better aligns with expectations and matches the structure used by `_blog_option()`. The `_site_option()` functions remain as an appropriate method for working with the current network.

See #28290.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34989 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-11 22:44:27 +00:00
Jeremy Felt
49ce208880 MS: Allow for a blog_upload_space setting of 0 to restrict uploads.
Previously, an value matching `empty()` would have been bypassed in favor of the default setting for 100MB.

Related #19538, r19639, r19652, where we saw the bug, fixed the bug, and then unfixed the bug so that it was not a surprise in a point release.

See #34037.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34981 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-10 23:15:26 +00:00
John Blackbourn
9daa848297 Correctly set the scheme of the home and siteurl options when creating a new site on multisite that uses some combination of HTTPS in the admin area or on the front end.
Fixes #33620
Props tryon, johnbillion

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


git-svn-id: http://core.svn.wordpress.org/trunk@34881 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-07 21:46:25 +00:00
Jeremy Felt
9926983b66 Revert [34778], continue using _site_option() for the current network.
The `_network_option()` parameter order will be changing to accept `$network_id` first. The `_site_option()` functions will remain in use throughout core as our way of retrieving a network option for the current network.

See #28290.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34877 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-07 17:11:25 +00:00
Drew Jaynes
65133a89c1 Multisite: Introduce get_subdirectory_reserved_names(), which returns a filterable list of reserved subdirectory site names.
The function encapsulates the existing `subdirectory_reserved_names` filter and reduces the maintenance burden of keeping the value of (currently) two instances of the same hook in sync.

See #33615.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34819 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 04:35:25 +00:00
Scott Taylor
2003bc15ba Multisite: in wpmu_validate_blog_signup(), pass embed to the array passed to subdirectory_reserved_names.
See #32522.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34818 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 04:05:24 +00:00
Boone Gorges
0e7c1d3b14 Use wp_installing() instead of WP_INSTALLING constant.
The `WP_INSTALLING` constant is a flag that WordPress sets in a number of
places, telling the system that options should be fetched directly from the
database instead of from the cache, that WP should not ping wordpress.org for
updates, that the normal "not installed" checks should be bypassed, and so on.

A constant is generally necessary for this purpose, because the flag is
typically set before the WP bootstrap, meaning that WP functions are not yet
available.  However, it is possible - notably, during `wpmu_create_blog()` -
for the "installing" flag to be set after WP has already loaded. In these
cases, `WP_INSTALLING` would be set for the remainder of the process, since
there's no way to change a constant once it's defined. This, in turn, polluted
later function calls that ought to have been outside the scope of site
creation, particularly the non-caching of option data. The problem was
particularly evident in the case of the automated tests, where `WP_INSTALLING`
was set the first time a site was created, and remained set for the rest of the
suite.

The new `wp_installing()` function allows developers to fetch the current
installation status (when called without any arguments) or to set the
installation status (when called with a boolean `true` or `false`). Use of
the `WP_INSTALLING` constant is still supported; `wp_installing()` will default
to `true` if the constant is defined during the bootstrap.

Props boonebgorges, jeremyfelt.
See #31130.
Built from https://develop.svn.wordpress.org/trunk@34828


git-svn-id: http://core.svn.wordpress.org/trunk@34793 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-05 15:06:28 +00:00
Jeremy Felt
54512d64cb MS: Use *_network_option() functions throughout core.
Replaces all uses of `*_site_option()` with the corresponding "network" function.

This excludes one usage in `wp-admin/admin-footer.php` that needs more investigation.

Props spacedmonkey.
See #28290.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-02 19:08:26 +00:00
John Blackbourn
ea28454867 Deprecate get_admin_users_for_domain(). This function has never been used in core.
Fixes #34122

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


git-svn-id: http://core.svn.wordpress.org/trunk@34720 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 22:27:24 +00:00
John Blackbourn
f33c6a6650 This function is blessed.
Built from https://develop.svn.wordpress.org/trunk@34754


git-svn-id: http://core.svn.wordpress.org/trunk@34719 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 22:24:24 +00:00
John Blackbourn
d0d9e4c8d8 Deprecate create_empty_blog(). This function has never been used in core.
Fixes #34120

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


git-svn-id: http://core.svn.wordpress.org/trunk@34718 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 22:10:26 +00:00
Jeremy Felt
d5b2929dbb Docs: Clarify $user parameter documentation in wpmu_validate_blog_signup.
See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34640 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-29 01:33:27 +00:00
Scott Taylor
2c30a11518 After [34577], alter wp_xmlrpc_server::mw_newMediaObject() to check upload space in multisite.
See #21292.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34567 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-26 19:49:25 +00:00
Boone Gorges
9d7a685a20 Multisite: Don't limit site titles to 50 chars.
This restriction dates from ye olden times, ie https://mu.trac.wordpress.org/changeset/1140.
It is no longer relevant.

Props chriscct7, theode.
Fixes #33973.
Built from https://develop.svn.wordpress.org/trunk@34455


git-svn-id: http://core.svn.wordpress.org/trunk@34419 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-23 14:24:24 +00:00
Drew Jaynes
c5fede78e0 Docs: Include 'wp-json' in the 4.4.0 changelog entry for the subdirectory_reserved_names filter.
'wp-json' was appended to the reserved names list in [34375].

See #33789. See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34348 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-22 09:44:27 +00:00
Scott Taylor
c60b00fc20 Multisite: as a precaution, make wp-json a reserved subdirectory name.
Props austinginder.
Fixes #33789.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34339 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-22 04:21:25 +00:00
Drew Jaynes
fd60f500c3 Docs: Add a changelog entry for the addition of 'wp-admin', 'wp-content', and 'wp-includes' as reserved names for the subdirectory_reserved_names filter docs.
The new names were introduced in [33952].

See #33615. See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34199 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-16 13:26:26 +00:00
Boone Gorges
49803a45f3 Send multisite site/user signup emails via hooked functions.
Site and user signup notifications are moved to the new actions
`'after_signup_site'` and `'after_signup_user'`. Site and user activation
notifications are moved to the existing actions `'wpmu_activate_blog'` and
`'wpmu_activate_user'`.

Props dshanske, thomaswm, jeremyfelt.
See #33587..
Built from https://develop.svn.wordpress.org/trunk@34112


git-svn-id: http://core.svn.wordpress.org/trunk@34080 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 03:28:24 +00:00
Scott Taylor
3d8199c4eb Multisite: Don't allow sites to be created with the following reserved slugs: wp-admin, wp-content, wp-includes
Props austinginder.
Fixes #33615.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33921 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-08 19:32:24 +00:00
Jeremy Felt
c122491c70 Exclude individual site directories when calculating space used for the main site.
* Add an `$exclude` parameter to `recurse_dirsize()`.
* Use this parameter in `get_dirsize()` to exclude `/sites` when on the main site.
* Add tests for main site and switched site.

Props @earnjam, @jeremyfelt.
Fixes #30202.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33156 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-13 00:07:24 +00:00
Jeremy Felt
eee4049c92 Usernames in multisite should be restricted to 60 characters or fewer.
Only 60 characters can be stored in the database for a username, which could cause lookup issues when attempting to use similar usernames of extreme length.

Props @DJPaul.
See #17904, Fixes #26784.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33054 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-04 05:53:24 +00:00
Dion Hulse
4df2bd0b2a Remove an undeeded space concatenation from wpmu_validate_user_signup().
This was previously used to prevent `strpos()` returning 0, which is not needed after r32942.
See #32444

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


git-svn-id: http://core.svn.wordpress.org/trunk@32921 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-26 01:39:25 +00:00
Scott Taylor
aaa99969e4 wpmu_validate_user_signup() should strictly check against false when using strpos().
See #32444.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32913 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-25 16:57:26 +00:00
Scott Taylor
5c6b63d3a6 if is a statment, not a function.
See #32444.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32771 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-16 20:01:25 +00:00
Scott Taylor
f888767c73 $status shouldn't be loosely compared to true in wp_xmlrpc_server::wp_deleteComment().
`$initial` shouldn't be loosely compared to `true` in `get_calendar()`.
`current_user_can()` shouldn't be loosely compared to `false` in `kses_init()`
`$get_all` shouldn't be loosely compared to `true` in `get_blog_details()`.
`is_array()` and `in_array()` shouldn't be loosely compared in `wpmu_validate_user_signup()`.
`$result` should by strictly compared in `check_ajax_referer()`.
`wp_verify_nonce()` should by strictly compared in `_show_post_preview()`.
`is_user_logged_in()` should not be loosly compared against `false` in `wp-signup.php`.

See #32444.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32704 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-12 17:48:26 +00:00
Jeremy Felt
93ff65e677 Improve information displayed in a network's sites list table
* Better support for arbitrary domain/path combinations by displaying the URL in the primary column rather than Path or Domain.
* Show a cached count of total users per site as a more useful data point rather than the first 5 users.
* Clear that cached count of users for a site when a user is added to the site via `add_user_to_blog()`.

Props @ocean90.
Fixes #32434.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32688 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-10 06:50:25 +00:00
Scott Taylor
19a3aacc94 Add @static* annotations where they are missing.
Initialize all static vars that are not, most to `null`.

See #32444.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32620 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-29 15:43:29 +00:00
Scott Taylor
4d26d999ce Fix doc blocks for ms-*.php files.
A few functions can return a conditional instead of an `if`/`else` of `true`/`false`.

See #32444.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32581 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-26 21:51:31 +00:00
Sergey Biryukov
77572cf024 Multisite: Add translator comments to default email messages with non-typical placeholders.
props yoavf.
fixes #32263.
Built from https://develop.svn.wordpress.org/trunk@32381


git-svn-id: http://core.svn.wordpress.org/trunk@32351 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-06 09:12:25 +00:00
Jeremy Felt
e4bfbcd9c1 Avoid an unexpected object error when syncing global terms
Pass the expected single value, rather than object, when recursively calling `global_terms()`.

Props hauvong.

See #31914, Fixes #31149.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32043 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-07 04:14:26 +00:00
Jeremy Felt
5ac75b3b0a Use response code 200 when an existing network user joins a site via invitation.
Pass a response code of 200 to `wp_die()` when a user is successfully added to an individual site after using the `/newbloguser/` URL from an invite email. This is a user facing success message.

Props MikeHansenMe.

Fixes #31224.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31495 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-22 22:30:25 +00:00
Sergey Biryukov
12f4004989 Replace generic "Dear user" greeting in email notifications with a more personalized one.
props Ipstenu.
fixes #31217.
Built from https://develop.svn.wordpress.org/trunk@31403


git-svn-id: http://core.svn.wordpress.org/trunk@31384 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-10 07:47:27 +00:00
Drew Jaynes
9a17233ca1 Fix an inaccurate summary and description in the DocBlock for wpmu_validate_user_signup().
Props ericlewis.
Fixes #31141.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31277 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-29 11:46:22 +00:00
Scott Taylor
0f6d0b84d1 Remove unused local vars in delete_plugins(), delete_theme(), WP_Date_Query->validate_date_values(), global_terms(), and WP_Text_Diff_Renderer_Table->_changed().
This will clear out the "Unused Code" label in the next Scrutinizer report.

See #30799.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31198 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 21:19:22 +00:00
Scott Taylor
fe6b5983df In PHP 5.0.0, is_a() became deprecated in favour of the instanceof operator. Calling is_a() would result in an E_STRICT warning.
In PHP 5.3.0, `is_a()` is no longer deprecated, and will therefore no longer throw `E_STRICT` warnings.

To avoid warnings in PHP < 5.3.0, convert all `is_a()` calls to `$var instanceof WP_Class` calls.

`instanceof` does not throw any error if the variable being tested is not an object, it simply returns `false`.

Props markoheijnen, wonderboymusic.
Fixes #25672.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31169 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 01:06:24 +00:00
Scott Taylor
fc843ce4d0 There are some random add_action() and add_filter() calls littered around some files in wp-includes/. These should be moved to wp-includes/default-filters.php with the rest of the registered hooks. It seems like this was the best practice for awhile and then we randomly stopped. This file loads way before any of the includes, so the hooks will be registered for any request that loads WordPress, even SHORTINIT - a lot of the hooks registered won't run anyways (that's already the case).
See #30947.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31149 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-12 16:40:23 +00:00
Andrew Nacin
1cf7a49ffd Adjust [29806] and revert [29807] to restore placeholder and email copy order.
Avoids unnecessarily changing a (large, carefully formatted) translated string from 4.0.

fixes #21089.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30732 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-12-05 01:15:26 +00:00
Scott Taylor
a0df295f5c Improve various @param docs.
See #30224.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30664 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-30 23:24:25 +00:00
John Blackbourn
3a4f742175 Remove the wp_is_trusted_network() function pending further discussion on terminology and behaviour.
See #30145

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


git-svn-id: http://core.svn.wordpress.org/trunk@30567 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-26 19:27:23 +00:00
Jeremy Felt
c47552dc6d Create new $wp_roles object in install_blog() to avoid protected _init() call
Our call to `$wp_roles->_init()` relied on the `__call()` method in `WP_Roles` to handle the link to the protected method. This works back to PHP 5.2.9, when a bug was fixed allowing access to protected methods through this exact approach.

`install_blog()` needs a fresh `$wp_roles` object after `populate_roles()` resets everything in its path. We can create this new object from scratch, effectively doing the same thing with the call to `_init()` via the constructor.

Fixes #29692 for trunk.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30242 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-05 05:12:22 +00:00