This adds a new function `wp_get_image_mime()` which is used by
`wp_check_filetype_and_ext()` to validate image files using
`exif_imagetype()` if available instead of `getimagesize()`.
`getimagesize()` is less performant than `exif_imagetype()` and is
dependent on GD. If `exif_imagetype()` is not available, it falls back to
`getimagesize()` as before.
If `wp_check_filetype_and_ext()` can't validate the filetype, we now return
`false` for ext/MIME values.
Merges [39831] to the 4.6 branch.
Built from https://develop.svn.wordpress.org/branches/4.6@39833
git-svn-id: http://core.svn.wordpress.org/branches/4.6@39771 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Merges [38727] to the 4.6 branch.
Fixes#38070, #37733 by reverting part of [38429] and using the fix in Requests.
Fixes#37992 allowing for connecting to SSL resources on ports other than 443.
Fixes#37991 by not sending default ports in the `Host:` header.
Fixes#37839 to match and decode Chunked responses correctly.
Fixes#38232 allowing a SSL connection to ignore the hostname of the certificate when verification is disabled.
Built from https://develop.svn.wordpress.org/branches/4.6@38728
git-svn-id: http://core.svn.wordpress.org/branches/4.6@38671 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Sometimes, `DB_CHARSET` will be set to `utf8mb4`, even if the current setup doesn't support `utf8mb4`. After [38442], this can cause significant character set failures, causing the connection to fall back to `latin1`.
Instead of doing this, we now check that the connection supports `utf8mb4` before trying to use it, and fall back to `utf8` when we need to.
Merge of [38580] to the 4.6 branch.
Fixes#37982.
Built from https://develop.svn.wordpress.org/branches/4.6@38581
git-svn-id: http://core.svn.wordpress.org/branches/4.6@38524 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The SQL query was built using the clauses compiled when querying for
top-level comments. But in cases where the top-level comment query
results are already in the cache, the SQL clauses are not built, and
so are unavailable for `fill_descendants()`. Instead, we call
`get_comments()`, using modified versions of the parameters passed
to the main `WP_Comment_Query` class.
Merge of [38446] to the 4.6 branch.
Props boonebgorges, Akeif, Rarst for testing.
Fixes#37696.
Built from https://develop.svn.wordpress.org/branches/4.6@38497
git-svn-id: http://core.svn.wordpress.org/branches/4.6@38438 1a063a9b-81f0-0310-95a4-ce76da25c4cd
After [38118], when previewing a page with a secondary loop, all post
thumbnails would be filtered to display the post thumbnail for the
page being previewed. This ensures `_wp_preview_post_thumbnail_filter()`
is only applied if the `$post_id` of the post meta being filtered is
equal to the post or page being previewed.
Merge of [38433] to the 4.6 branch.
Props swissspidy, joemcgill.
Fixes#37697.
Built from https://develop.svn.wordpress.org/branches/4.6@38476
git-svn-id: http://core.svn.wordpress.org/branches/4.6@38417 1a063a9b-81f0-0310-95a4-ce76da25c4cd
`wp_version_check()`, `wp_update_plugins()` and `wp_update_themes()` are all originally hooked to the `upgrader_process_complete` action with zero arguments passed to them. Zero arguments should be passed when re-adding them after translation updates, otherwise the sky will fall.
Merge of [38415] to the 4.6 branch.
Props ionutst, gitlost, swissspidy.
Fixes#37731.
Built from https://develop.svn.wordpress.org/branches/4.6@38475
git-svn-id: http://core.svn.wordpress.org/branches/4.6@38416 1a063a9b-81f0-0310-95a4-ce76da25c4cd
[37320] corrected some behaviour in how PHP and MySQL character sets are matched up. This was correct, but had the side effect of causing some incorrectly configured sites to start failing.
Prior to [37320], if `DB_CHARSET` was set to `utf8mb4`, but the PHP version didn't support `utf8mb4`, it would fall back to the default character set - usually `latin1`. After [37320], the `SET NAMES` query would force MySQL to treat the connection character set as `utf8mb4`, even if PHP wasn't able to understand it.
By checking if `mysqli_set_charset()` succeeded, we can simulate the old behaviour, while maintaining the fix in [37320].
Merge of [38441] to the 4.6 branch.
Props danielkanchev fo helping to diagnose this issue.
Fixes#37689.
Built from https://develop.svn.wordpress.org/branches/4.6@38442
git-svn-id: http://core.svn.wordpress.org/branches/4.6@38383 1a063a9b-81f0-0310-95a4-ce76da25c4cd
WordPress maintains the minified version of jquery.masonry.js since there is no official build, however it has been excluded from grunt's minification process. This adds a minification task to grunt, adds it to the precommit hook for JS, minifies the file, and bumps the version on jquery.masonry.min.js. The change to the non minified version was introduced in [38261].
Merge of [38276] and [38281] to the 4.6 branch.
Fixes#37720. See #37666.
Built from https://develop.svn.wordpress.org/branches/4.6@38339
git-svn-id: http://core.svn.wordpress.org/branches/4.6@38280 1a063a9b-81f0-0310-95a4-ce76da25c4cd
[38058] changed `wp_mail()` so that it used PHPMailer's `setFrom()`
method rather than setting the From and FromName headers directly. See
behavior of setting the `Sender` field. This causes `mail` to be
called with the `-f` flag, which causes outgoing email to fail on some
server environments.
Merges [38286] to the 4.6 branch.
Props Clorith, iandunn, DrewAPicture.
Fixes#37736.
Built from https://develop.svn.wordpress.org/branches/4.6@38287
git-svn-id: http://core.svn.wordpress.org/branches/4.6@38228 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Allow to add/remove a featured image to `attachment:audio` and `attachment:video` post types, see [27657].
* Change conditionals to check for theme OR post type support.
* Add tests for #12922.
Broken in [37658].
Merge of [38263] to the 4.6 branch.
Props flixos90, joemcgill, DrewAPicture, wonderboymusic.
See #12922.
See #37658.
Built from https://develop.svn.wordpress.org/branches/4.6@38264
git-svn-id: http://core.svn.wordpress.org/branches/4.6@38205 1a063a9b-81f0-0310-95a4-ce76da25c4cd