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.5 branch.
git-svn-id: https://develop.svn.wordpress.org/branches/4.5@39834 602fd350-edb4-49c9-b593-d223f7449a82
Preserves spaces and generally creates more accurate, cleaner titles from filenames of uploaded media.
Merge of [38615] to the 4.5 branch.
Fixes#37989.
git-svn-id: https://develop.svn.wordpress.org/branches/4.5@39711 602fd350-edb4-49c9-b593-d223f7449a82
This switches event binding in `wp.media.controller.EditImage` to use `on`
instead of `listenTo` to restore rendering of the correct toolbar when the
`toolbar:render:edit-image` event fires. The existing listeners broke
when we upgraded Backbone in [36546].
Merge of [37678] to the 4.5 branch.
Props adamsilverstein.
Fixes#36861.
git-svn-id: https://develop.svn.wordpress.org/branches/4.5@37813 602fd350-edb4-49c9-b593-d223f7449a82
This changes the binding of event listeners in the Attachments Browser
to use `on` instead of `listenTo` for the `attachment:keydown:arrow` and
`attachment:details:shift-tab` events. The existing listeners broke
when we upgraded Backbone in [36546].
Merge of [37755] to the 4.5 branch.
Props adamsilverstein.
Fixes#36900.
git-svn-id: https://develop.svn.wordpress.org/branches/4.5@37804 602fd350-edb4-49c9-b593-d223f7449a82
[36510] allowed larger menus to be created in the Edit Menu screen by JSON-encoding the entire form into a single input field. However, it did not correctly handle nested arrays.
This introduces a new `_wp_expand_nav_menu_post_data()` helper function to handle this POST data which uses `array_replace_recursive()` internally. Since the latter is only available on PHP 5.3+, we add a compatibility function to ensure PHP 5.2 support.
Merge of [37748] and [37750] to the 4.5 branch.
Props ericlewis, neverything, swissspidy.
Fixes#36590. See #14134.
git-svn-id: https://develop.svn.wordpress.org/branches/4.5@37754 602fd350-edb4-49c9-b593-d223f7449a82
In order to make local debugging of travis easier, output the npm and node versions when travis runs.
[37730] for 4.5.
see #37116.
git-svn-id: https://develop.svn.wordpress.org/branches/4.5@37733 602fd350-edb4-49c9-b593-d223f7449a82
Otherwise `wp_filter_pre_oembed_result()` could erroneously return the HTML of the current post instead of the intended result.
Merge of [37729] to the 4.5 branch.
Props kraftbj.
See #36767.
git-svn-id: https://develop.svn.wordpress.org/branches/4.5@37732 602fd350-edb4-49c9-b593-d223f7449a82
Reverts [37456] to allow users to remove/change a site icon even if the attachment has corrupt/missing data about sizes.
Merge of [37724] to the 4.5 branch.
See #36749.
git-svn-id: https://develop.svn.wordpress.org/branches/4.5@37725 602fd350-edb4-49c9-b593-d223f7449a82
When the post being embedded is from the same site, there's no reason to do an HTTP request for it. The data can be fetched directly using `get_oembed_response_data()`.
Merge of [37708] to the 4.5 branch.
Fixes#36767.
git-svn-id: https://develop.svn.wordpress.org/branches/4.5@37709 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/branches/4.5@37606 602fd350-edb4-49c9-b593-d223f7449a82
The `medium_large_size_w` and `medium_large_size_h` options were added to the
`$whitelist_options['media']` in options.php in [35479], which causes both options
to be set to `0` when the media settings are changed. When this occurs, the
medium_large image size will no longer be created when an image is uploaded.
Since these options aren't meant to be updated via the settings UI, they can be
safely removed from the whitelist.
Merge of [37435] to the 4.5 branch.
Props joemcgill.
Fixes#36531.
git-svn-id: https://develop.svn.wordpress.org/branches/4.5@37457 602fd350-edb4-49c9-b593-d223f7449a82
Fixes warning related to a non-array argument for `array_merge()` in `WP_Customize_Widgets::customize_register()`.
Merge of [37352] to the 4.5 branch.
See [37166].
See #36389.
Fixes#36660.
git-svn-id: https://develop.svn.wordpress.org/branches/4.5@37453 602fd350-edb4-49c9-b593-d223f7449a82