desrosj
1e5efe9093
Grouped backports to the 4.5 branch.
...
- Query: Improve sanitization within `WP_Tax_Query`.
- Query: Improve sanitization within `WP_Meta_Query`.
- Upgrade/Install: Avoid using `unserialize()` unnecessarily.
- Formatting: Correctly encode ASCII characters in post slugs.
Merges [52454-52457] to the 4.5 branch.
Props vortfu, dd32, ehtis, zieladam, whyisjake, xknown, peterwilsoncc, desrosj, iandunn.
Built from https://develop.svn.wordpress.org/branches/4.5@52478
git-svn-id: http://core.svn.wordpress.org/branches/4.5@52070 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-06 18:18:41 +00:00
Dominik Schilling
caf7ab7df5
Database: dbDelta()
will no longer try to downgrade the size of TEXT
and BLOB
columns.
...
When upgrading to `utf8mb4`, `TEXT` fields will be upgraded to `MEDIUMTEXT` (and likewise for all other `*TEXT` and `*BLOB` fields). This is to allow for the additional space requirements of `utf8mb4`.
On the subsequent upgrade, after the `utf8mb4` upgrade, `dbDelta()` would try and downgrade the fields to their original size again. At best, this it a waste of time, at worst, this could truncate any data larger than the original size. There's no harm in leaving them at their original size, so let's do that.
Merge of [37525] to the 4.5 branch.
Props pento.
See #36748 .
Built from https://develop.svn.wordpress.org/branches/4.5@37606
git-svn-id: http://core.svn.wordpress.org/branches/4.5@37574 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-01 12:59:28 +00:00
Andrew Ozz
13c885bdce
TinyMCE, inline link:
...
- Remove unused user setting for wpLink.
- Remove redundant text and variable from wp_link_dialog().
Props afercia, azaozz.
See #33301 .
Built from https://develop.svn.wordpress.org/trunk@36985
git-svn-id: http://core.svn.wordpress.org/trunk@36952 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-03-14 01:39:26 +00:00
Drew Jaynes
56fb3cc08d
Docs: Improve documentation for upgrade_450()
, introduced in [36180].
...
See #27772 , #35323 . See #35986 .
Built from https://develop.svn.wordpress.org/trunk@36825
git-svn-id: http://core.svn.wordpress.org/trunk@36792 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-03-03 09:01:26 +00:00
Dominik Schilling
c38daf6a7e
Upgrade: Bump db version for upgrade_450()
in upgrade_all()
.
...
See #23358 .
Built from https://develop.svn.wordpress.org/trunk@36686
git-svn-id: http://core.svn.wordpress.org/trunk@36653 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-24 16:34:25 +00:00
Dominik Schilling
86690daf0b
Multisite: Switch to a usermeta key for email confirmation.
...
To prevent inconsistent data across sites in a network the new email address is now stored in usermeta. Adds visual feedback for the case when an update has failed.
All existing options will be removed on a database upgrade.
Props MikeHansenMe, kovshenin, jeremyfelt, ocean90.
Fixes #23358 .
Built from https://develop.svn.wordpress.org/trunk@36679
git-svn-id: http://core.svn.wordpress.org/trunk@36646 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-24 15:34:28 +00:00
Eric Lewis
22467e840f
Networks and sites: Replace "blog" usage with "site" in docs.
...
Multisite functions use the term "blog" to refer to what we now call a "site," e.g. `get_current_blog_id()`. These functions are here to stay because of our commitment to backwards compatibility. What we can do is set the documentation straight.
See #35417 .
Built from https://develop.svn.wordpress.org/trunk@36416
git-svn-id: http://core.svn.wordpress.org/trunk@36383 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-28 03:35:27 +00:00
Dion Hulse
06a3f799e7
Background Updates: Remove the 7am/7pm background update check. This check was made redundant by [28129] as background updates are now run after a version check takes place.
...
See #27772 , #35323 .
Built from https://develop.svn.wordpress.org/trunk@36180
git-svn-id: http://core.svn.wordpress.org/trunk@36147 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-06 06:12:26 +00:00
Drew Jaynes
c9a11ae9f2
Docs: Mark the upgrade_XX()
functions to be ignored from parsing for the Code Reference.
...
There is no great value in generating reference pages for these funcitons as they explicitly serve a core-only purpose.
See #32246 .
Built from https://develop.svn.wordpress.org/trunk@35966
git-svn-id: http://core.svn.wordpress.org/trunk@35931 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-16 17:59:27 +00:00
Boone Gorges
f173cdfb18
On 4.4 upgrade, remove the unused 'add_users' cap from all roles.
...
Fixes #16719 .
Built from https://develop.svn.wordpress.org/trunk@35701
git-svn-id: http://core.svn.wordpress.org/trunk@35665 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-11-19 03:53:28 +00:00
Sergey Biryukov
db8c89cccb
Remove non-translatable HTML code from the first post content in populate_network()
and wp_install_defaults()
.
...
Add translator comment.
Props ramiy.
Fixes #34619 .
Built from https://develop.svn.wordpress.org/trunk@35614
git-svn-id: http://core.svn.wordpress.org/trunk@35578 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-11-11 20:55:26 +00:00
Gary Pendergast
c39ae3e5e2
Upgrades: Add support for FULLTEXT
indexes to dbDelta()
.
...
Props edirect24, mdawaffe, pento.
Fixes #14445 .
Built from https://develop.svn.wordpress.org/trunk@35487
git-svn-id: http://core.svn.wordpress.org/trunk@35451 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-11-01 23:10:25 +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
Sergey Biryukov
3c7b7f7133
After [34529], if a compatible termmeta
table is found on database upgrade, convert it to utf8mb4
collation.
...
Props dboulet.
Fixes #34224 .
Built from https://develop.svn.wordpress.org/trunk@34978
git-svn-id: http://core.svn.wordpress.org/trunk@34943 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-09 02:07: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
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
Boone Gorges
8b4a5d1ec0
Introduce metadata for taxonomy terms.
...
Adds a new table to the database schema (`wp_termmeta`), and a set of
`*_term_meta()` API functions. `get_terms()` and `wp_get_object_terms()`
now also support 'meta_query' parameters, with syntax identical to other
uses of `WP_Meta_Query`.
When fetching terms via `get_terms()` or `wp_get_object_terms()`, metadata for
matched terms is preloaded into the cache by default. Disable this behavior
by setting the new `$update_term_meta_cache` paramater to `false`.
To maximize performance, within `WP_Query` loops, the termmeta cache is *not*
primed by default. Instead, we use a lazy-loading technique: metadata for all
terms belonging to posts in the loop is loaded into the cache the first time
that `get_term_meta()` is called within the loop.
Props boonebgorges, sirzooro.
See #10142 .
Built from https://develop.svn.wordpress.org/trunk@34529
git-svn-id: http://core.svn.wordpress.org/trunk@34493 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-25 03:59:27 +00:00
Gary Pendergast
0d85038ce6
Schema: Increase the length of wp_options.option_name
.
...
It's pretty easy to run over the `option_name` length, which causes undefined behaviour when inserting and retrieving options. Increasing the length from `VARCHAR(64)` to `VARCHAR(191)` significantly reduces the risk of this occurring.
Because `option_name` has a `UNIQUE` index, we can only increase it to 191 characters, rather than 255. The index can only use a prefix of 191 characters, so will incorrectly restrict long different strings that have the same prefix, if we make the column longer.
Props scribu, OriginalEXE, khromov, MikeHansenMe, netweb, pento.
Fixes #13310 .
Built from https://develop.svn.wordpress.org/trunk@34030
git-svn-id: http://core.svn.wordpress.org/trunk@33999 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-11 01:26:24 +00:00
Scott Taylor
ef87172270
foreach
is a statement, not a function.
...
See #33491 .
Built from https://develop.svn.wordpress.org/trunk@33734
git-svn-id: http://core.svn.wordpress.org/trunk@33702 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-25 20:28:22 +00:00
Dion Hulse
4f8ce1c232
Term Splitting: Switch to a faster cron unschedule process to benefit sites with thousands of affected jobs. Fix the cron hook name in the failsafe rescheduler.
...
Props Otto42, dd32, peterwilsoncc
See #33423
Built from https://develop.svn.wordpress.org/trunk@33727
git-svn-id: http://core.svn.wordpress.org/trunk@33695 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-25 04:32:21 +00:00
Scott Taylor
e9305edbce
When createing "Sample Page" on install, comments should be closed
.
...
Props macmanx.
Fixes #33490 .
Built from https://develop.svn.wordpress.org/trunk@33693
git-svn-id: http://core.svn.wordpress.org/trunk@33660 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-21 17:42:25 +00:00
Dion Hulse
25c5d372d3
Term Splitting: Fix a reversal of parameters to wp_schedule_single_event() introduced in [33621].
...
The existing invalid cron entries will not be purged automatically (as the 'timestamp' is never matched) so we do this ourselves.
Props mechter for noticing!
See #30261 .
Fixes #33423 for trunk.
Built from https://develop.svn.wordpress.org/trunk@33646
git-svn-id: http://core.svn.wordpress.org/trunk@33613 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-19 11:31:26 +00:00
Dominik Schilling
96a6f0ac1f
Pinking shears.
...
Built from https://develop.svn.wordpress.org/trunk@33627
git-svn-id: http://core.svn.wordpress.org/trunk@33594 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-17 21:39:25 +00:00
Boone Gorges
dba7c50d29
Don't run term-splitting routine on new installations.
...
Props pento.
Fixes #30261 .
Built from https://develop.svn.wordpress.org/trunk@33621
git-svn-id: http://core.svn.wordpress.org/trunk@33588 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-17 14:29:25 +00:00
Boone Gorges
151d27369d
Term splitting routine should be run in a separate process, triggered via wp-cron.
...
[32814] introduced a routine to split shared terms, which was run during the
regular WP database upgrade. This turned out to be problematic because plugins
are not loaded during the db upgrade (due to `WP_INSTALLING`), with the result
that plugins were not able to hook into the 'split_shared_term' action during
the bulk split. We work around this limitation by moving the term splitting
routine to a separate process, triggered by a wp-cron hook.
Props boonebgorges, Chouby, peterwilsoncc, pento, dd32.
Fixes #30261 .
Built from https://develop.svn.wordpress.org/trunk@33615
git-svn-id: http://core.svn.wordpress.org/trunk@33582 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-14 03:59:26 +00:00
Andrew Ozz
3bfd096440
Fix paste typos in upgrade.php.
...
Props tellyworth. Fixes #33206 .
Built from https://develop.svn.wordpress.org/trunk@33609
git-svn-id: http://core.svn.wordpress.org/trunk@33576 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-11 23:44:24 +00:00
Dion Hulse
e2b10dad49
Upgrade: Skip the sitecategories table when it doesn't exist (Global Terms is disabled).
...
Props nofearinc, obenland, SergeyBiryukov, and pento.
Fixes #33206
Built from https://develop.svn.wordpress.org/trunk@33597
git-svn-id: http://core.svn.wordpress.org/trunk@33564 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-09 02:22:26 +00:00
Drew Jaynes
e4ecc7e5c4
Fix summaries and add missing @global
descriptions to the upgrade_430_fix_comments()
and split_all_shared_terms()
functions added in 4.3.
...
See [33020], [32643]. See #32891 .
Built from https://develop.svn.wordpress.org/trunk@33212
git-svn-id: http://core.svn.wordpress.org/trunk@33184 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-13 19:56:24 +00:00
Dion Hulse
36de491d68
Don't upgrade global tables to utf8mb4 when wp_should_upgrade_global_tables()
says not to.
...
Additionally fixes an incorrect conditional in [33057] which would result in the usermeta index being altered twice on Multisite updates.
See #32154
Built from https://develop.svn.wordpress.org/trunk@33058
git-svn-id: http://core.svn.wordpress.org/trunk@33029 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-03 05:44:24 +00:00
Dion Hulse
d651de0dac
Introduce wp_should_upgrade_global_tables()
to determine if global tables should be upgraded automatically. Use it throughout the existing upgrade routines.
...
Props johnjamesjacoby for initial patch
Fixes #32154 for trunk
Built from https://develop.svn.wordpress.org/trunk@33057
git-svn-id: http://core.svn.wordpress.org/trunk@33028 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-03 04:34:24 +00:00
Dion Hulse
cbacb92dae
Enable utf8mb4 for MySQL extension users. Previously utf8mb4 was limited to MySQLi users only unintentionally.
...
This change does the following things
* Allows utf8mb4 for the MySQL extension
* Re-runs the utf8->utf8mb4 conversion for single sites, this will do nothing for tables already converted
* Re-runs the utf8->utf8mb4 conversion for global tables in multisite when the environment supports utf8mb4
* Removes upgrade_420() calling as upgrade_430() will perform those changes now instead
The index shortenings should have still taken place on utf8 sites previously, so there's no need to run those again.
Props kovshenin, pento, dd32
Fixes #32127 for trunk.
Built from https://develop.svn.wordpress.org/trunk@33055
git-svn-id: http://core.svn.wordpress.org/trunk@33026 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-03 03:26:24 +00:00
Dion Hulse
ebb6aa1d4a
Split upgrade_430()
into two so that split_all_shared_terms()
runs when upgrade_430_fix_comments()
bails early.
...
See [32814], #30261 , [32364], #32165
Built from https://develop.svn.wordpress.org/trunk@33020
git-svn-id: http://core.svn.wordpress.org/trunk@32991 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-01 07:35:24 +00:00
Dion Hulse
a21f890abb
Remove a redundant index drop, it'll be dropped and re-created a few lines further down.
...
Fixes a warning during updating from 4.0 or earlier.
Fixes #31388 for trunk
Built from https://develop.svn.wordpress.org/trunk@32852
git-svn-id: http://core.svn.wordpress.org/trunk@32823 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-19 03:18:26 +00:00
Boone Gorges
f62bf61b2c
Bail out of 4.3 term splitting routine when no shared terms are found.
...
Props dd32.
See #30261 .
Built from https://develop.svn.wordpress.org/trunk@32819
git-svn-id: http://core.svn.wordpress.org/trunk@32790 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-17 11:40:24 +00:00
Boone Gorges
290044ef15
Split all shared taxonomy terms on upgrade to 4.3.
...
Dear Shared Terms, Welcome to Splitsville. Population: You.
See #30261 .
Built from https://develop.svn.wordpress.org/trunk@32814
git-svn-id: http://core.svn.wordpress.org/trunk@32785 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-17 01:53:26 +00:00
Andrew Nacin
e7f618d86e
Tweak the first post/page content to get with the times.
...
props chriscct7.
fixes #22474 .
Built from https://develop.svn.wordpress.org/trunk@32768
git-svn-id: http://core.svn.wordpress.org/trunk@32739 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-14 18:56:50 +00:00
Scott Taylor
c6a4512b1b
Add missing doc blocks to wp-admin/includes/*
.
...
Fix some egregious uses of tabbing.
Some functions can simply return `apply_filters(...)` instead of setting a variable that is immediately returned.
See #32444 .
Built from https://develop.svn.wordpress.org/trunk@32654
git-svn-id: http://core.svn.wordpress.org/trunk@32624 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-29 20:17:26 +00:00
Scott Taylor
282e28ad81
Add @global
annotations to (the rest of the?) wp-admin/*
files.
...
Does not include list table file changes.
See #32444 .
Built from https://develop.svn.wordpress.org/trunk@32643
git-svn-id: http://core.svn.wordpress.org/trunk@32613 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-29 02:06:31 +00:00
Gary Pendergast
02621f2a14
Upgrades: If a table has already been converted to utf8mb4
, there's no need to try and convert it again.
...
Props gabrielperezs for the initial patch.
See #32310 .
Built from https://develop.svn.wordpress.org/trunk@32456
git-svn-id: http://core.svn.wordpress.org/trunk@32426 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-08 12:22:25 +00:00
Michael Adams
a3807c1d34
Upgrade: Since MySQL may auto-expand column widths when changing a column's character set, we must do our length-based comment checks prior to the character set changes.
...
Props jorbin, et alii.
See #32165 .
Built from https://develop.svn.wordpress.org/trunk@32440
git-svn-id: http://core.svn.wordpress.org/trunk@32410 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-07 01:11:29 +00:00
Michael Adams
26c3c6d9cb
Upgrade: $wpdb->get_col_length()
sanity check: bail on unexpected return value.
...
See #32165 .
Built from https://develop.svn.wordpress.org/trunk@32429
git-svn-id: http://core.svn.wordpress.org/trunk@32399 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-06 23:11:26 +00:00
Michael Adams
0640526e72
Upgrade: Ensure unintelligible DB schemas don't result in content loss.
...
See #32165 .
Built from https://develop.svn.wordpress.org/trunk@32417
git-svn-id: http://core.svn.wordpress.org/trunk@32387 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-06 21:46:26 +00:00
Gary Pendergast
4e615fb9ff
Fix an incorrect version number check in [32378].
...
See #32099 .
Built from https://develop.svn.wordpress.org/trunk@32379
git-svn-id: http://core.svn.wordpress.org/trunk@32349 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-06 07:41:24 +00:00
Gary Pendergast
3a6e79c409
Upgrades: When converting to utf8mb4
, we were trying to change the wrong index on wp_signups
, causing the conversion to later fail.
...
Props kovshenin, pento.
See #32099 .
Built from https://develop.svn.wordpress.org/trunk@32378
git-svn-id: http://core.svn.wordpress.org/trunk@32348 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-06 07:34:24 +00:00
Gary Pendergast
364886a5be
WPDB: When checking that a string can be sent to MySQL, we shouldn't use mb_convert_encoding()
, as it behaves differently to MySQL's character encoding conversion.
...
Props mdawaffe, pento, nbachiyski, jorbin, johnjamesjacoby, jeremyfelt.
See #32165 .
Built from https://develop.svn.wordpress.org/trunk@32364
git-svn-id: http://core.svn.wordpress.org/trunk@32335 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-06 03:00:25 +00:00
Gary Pendergast
44b56d9393
When deleting suspicious comments, do so permanently.
...
Built from https://develop.svn.wordpress.org/trunk@32310
git-svn-id: http://core.svn.wordpress.org/trunk@32281 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-27 16:11:26 +00:00
Gary Pendergast
b89fc65951
[32308] was for 4.3, not 4.2.1.
...
Built from https://develop.svn.wordpress.org/trunk@32309
git-svn-id: http://core.svn.wordpress.org/trunk@32280 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-27 16:08:27 +00:00
Gary Pendergast
51402dc520
When upgrading to 4.2.1, delete suspicious comments.
...
Built from https://develop.svn.wordpress.org/trunk@32308
git-svn-id: http://core.svn.wordpress.org/trunk@32279 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-27 16:04:25 +00:00
Gary Pendergast
0179958273
When dbDelta()
is checking whether an index is defined in a CREATE TABLE
statement, don't worry if MySQL has a subpart defined on an index, but the CREATE TABLE
doesn't.
...
Fixes #31869 .
Built from https://develop.svn.wordpress.org/trunk@32108
git-svn-id: http://core.svn.wordpress.org/trunk@32087 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-11 10:40:31 +00:00
Sergey Biryukov
443760252b
wp_install_maybe_enable_pretty_permalinks()
should have a consistent @return
value.
...
props DrewAPicture.
fixes #6481 . see #31888 .
Built from https://develop.svn.wordpress.org/trunk@32027
git-svn-id: http://core.svn.wordpress.org/trunk@32006 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-05 14:49:53 +00:00