summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--package-lock.json87
-rw-r--r--package.json1
-rw-r--r--src/wp-admin/includes/class-wp-screen.php2
-rw-r--r--src/wp-admin/includes/class-wp-upgrader.php5
-rw-r--r--src/wp-admin/includes/comment.php2
-rw-r--r--src/wp-admin/includes/misc.php2
-rw-r--r--src/wp-admin/includes/ms.php2
-rw-r--r--src/wp-admin/includes/schema.php2
-rw-r--r--src/wp-admin/includes/template.php2
-rw-r--r--src/wp-admin/includes/upgrade.php41
-rw-r--r--src/wp-content/themes/twentyseventeen/functions.php10
-rw-r--r--src/wp-content/themes/twentyseventeen/template-parts/post/content-audio.php1
-rw-r--r--src/wp-content/themes/twentyseventeen/template-parts/post/content-video.php1
-rw-r--r--src/wp-content/themes/twentytwentyfive/functions.php2
-rw-r--r--src/wp-includes/class-wp-phpmailer.php2
-rw-r--r--src/wp-includes/class-wp-user-meta-session-tokens.php2
-rw-r--r--src/wp-includes/functions.php2
-rw-r--r--src/wp-includes/interactivity-api/class-wp-interactivity-api-directives-processor.php2
-rw-r--r--src/wp-includes/interactivity-api/class-wp-interactivity-api.php2
-rw-r--r--src/wp-includes/media.php26
-rw-r--r--src/wp-includes/script-loader.php2
-rw-r--r--src/wp-includes/version.php2
-rw-r--r--tests/phpunit/tests/media.php47
-rw-r--r--tests/phpunit/tests/option/sanitizeOption.php1
24 files changed, 146 insertions, 102 deletions
diff --git a/package-lock.json b/package-lock.json
index 8fdb7c0c44..3387f2438e 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -108,7 +108,6 @@
"@pmmmwh/react-refresh-webpack-plugin": "0.5.15",
"@wordpress/babel-preset-default": "8.19.1",
"@wordpress/dependency-extraction-webpack-plugin": "6.19.1",
- "@wordpress/e2e-test-utils": "11.19.1",
"@wordpress/e2e-test-utils-playwright": "1.19.1",
"@wordpress/prettier-config": "4.19.1",
"@wordpress/scripts": "30.12.1",
@@ -7491,30 +7490,6 @@
"npm": ">=8.19.2"
}
},
- "node_modules/@wordpress/e2e-test-utils": {
- "version": "11.19.1",
- "resolved": "https://registry.npmjs.org/@wordpress/e2e-test-utils/-/e2e-test-utils-11.19.1.tgz",
- "integrity": "sha512-4V1IT0zg3tf1KtkjRwISAtr2Rbd+rdIDxchT27nFQ1eUbYsk+b8uMOqPSBix2lJG2XWchAEGNSk7gFXzziqyyw==",
- "dev": true,
- "license": "GPL-2.0-or-later",
- "dependencies": {
- "@babel/runtime": "7.25.7",
- "@wordpress/api-fetch": "^7.19.1",
- "@wordpress/keycodes": "^4.19.1",
- "@wordpress/url": "^4.19.1",
- "change-case": "^4.1.2",
- "form-data": "^4.0.0",
- "node-fetch": "2.7.0"
- },
- "engines": {
- "node": ">=18.12.0",
- "npm": ">=8.19.2"
- },
- "peerDependencies": {
- "jest": ">=29",
- "puppeteer-core": ">=23"
- }
- },
"node_modules/@wordpress/e2e-test-utils-playwright": {
"version": "1.19.1",
"resolved": "https://registry.npmjs.org/@wordpress/e2e-test-utils-playwright/-/e2e-test-utils-playwright-1.19.1.tgz",
@@ -7565,22 +7540,6 @@
"node": ">=10.0.0"
}
},
- "node_modules/@wordpress/e2e-test-utils/node_modules/form-data": {
- "version": "4.0.2",
- "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.2.tgz",
- "integrity": "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "asynckit": "^0.4.0",
- "combined-stream": "^1.0.8",
- "es-set-tostringtag": "^2.1.0",
- "mime-types": "^2.1.12"
- },
- "engines": {
- "node": ">= 6"
- }
- },
"node_modules/@wordpress/edit-post": {
"version": "8.19.6",
"resolved": "https://registry.npmjs.org/@wordpress/edit-post/-/edit-post-8.19.6.tgz",
@@ -26241,27 +26200,6 @@
"node": ">=10.5.0"
}
},
- "node_modules/node-fetch": {
- "version": "2.7.0",
- "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
- "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "whatwg-url": "^5.0.0"
- },
- "engines": {
- "node": "4.x || >=6.0.0"
- },
- "peerDependencies": {
- "encoding": "^0.1.0"
- },
- "peerDependenciesMeta": {
- "encoding": {
- "optional": true
- }
- }
- },
"node_modules/node-forge": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz",
@@ -33769,13 +33707,6 @@
"node": ">=6"
}
},
- "node_modules/tr46": {
- "version": "0.0.3",
- "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
- "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==",
- "dev": true,
- "license": "MIT"
- },
"node_modules/tree-kill": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz",
@@ -34665,13 +34596,6 @@
"integrity": "sha512-/CFAm1mNxSmOj6i0Co+iGFJ58OS4NRGVP+AWS/l509uIK5a1bSoIVaHz/ZumpHTfHSZBpgrJ+wjfpAOrTHok5Q==",
"dev": true
},
- "node_modules/webidl-conversions": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
- "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==",
- "dev": true,
- "license": "BSD-2-Clause"
- },
"node_modules/webpack": {
"version": "5.98.0",
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.98.0.tgz",
@@ -35305,17 +35229,6 @@
"node": ">=12"
}
},
- "node_modules/whatwg-url": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
- "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "tr46": "~0.0.3",
- "webidl-conversions": "^3.0.0"
- }
- },
"node_modules/which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
diff --git a/package.json b/package.json
index 77c2b2d68c..f76432beb0 100644
--- a/package.json
+++ b/package.json
@@ -29,7 +29,6 @@
"@pmmmwh/react-refresh-webpack-plugin": "0.5.15",
"@wordpress/babel-preset-default": "8.19.1",
"@wordpress/dependency-extraction-webpack-plugin": "6.19.1",
- "@wordpress/e2e-test-utils": "11.19.1",
"@wordpress/e2e-test-utils-playwright": "1.19.1",
"@wordpress/prettier-config": "4.19.1",
"@wordpress/scripts": "30.12.1",
diff --git a/src/wp-admin/includes/class-wp-screen.php b/src/wp-admin/includes/class-wp-screen.php
index 4bb5995e7f..27801f3695 100644
--- a/src/wp-admin/includes/class-wp-screen.php
+++ b/src/wp-admin/includes/class-wp-screen.php
@@ -986,6 +986,8 @@ final class WP_Screen {
/**
* @global array $wp_meta_boxes Global meta box state.
*
+ * @since 3.3.0
+ *
* @return bool
*/
public function show_screen_options() {
diff --git a/src/wp-admin/includes/class-wp-upgrader.php b/src/wp-admin/includes/class-wp-upgrader.php
index d641d10386..d5a430d25a 100644
--- a/src/wp-admin/includes/class-wp-upgrader.php
+++ b/src/wp-admin/includes/class-wp-upgrader.php
@@ -1022,18 +1022,21 @@ class WP_Upgrader {
}
$file = $wp_filesystem->abspath() . '.maintenance';
+
if ( $enable ) {
if ( ! wp_doing_cron() ) {
$this->skin->feedback( 'maintenance_start' );
}
+
// Create maintenance file to signal that we are upgrading.
$maintenance_string = '<?php $upgrading = ' . time() . '; ?>';
$wp_filesystem->delete( $file );
$wp_filesystem->put_contents( $file, $maintenance_string, FS_CHMOD_FILE );
- } elseif ( ! $enable && $wp_filesystem->exists( $file ) ) {
+ } elseif ( $wp_filesystem->exists( $file ) ) {
if ( ! wp_doing_cron() ) {
$this->skin->feedback( 'maintenance_end' );
}
+
$wp_filesystem->delete( $file );
}
}
diff --git a/src/wp-admin/includes/comment.php b/src/wp-admin/includes/comment.php
index ffec90c81e..ad8b653161 100644
--- a/src/wp-admin/includes/comment.php
+++ b/src/wp-admin/includes/comment.php
@@ -210,6 +210,8 @@ function enqueue_comment_hotkeys_js() {
/**
* Displays error message at bottom of comments.
*
+ * @since 2.5.0
+ *
* @param string $msg Error Message. Assumed to contain HTML and be sanitized.
*/
function comment_footer_die( $msg ) {
diff --git a/src/wp-admin/includes/misc.php b/src/wp-admin/includes/misc.php
index f42c247fb2..23b3f6544e 100644
--- a/src/wp-admin/includes/misc.php
+++ b/src/wp-admin/includes/misc.php
@@ -1059,6 +1059,8 @@ function admin_color_scheme_picker( $user_id ) {
/**
*
* @global array $_wp_admin_css_colors
+ *
+ * @since 3.8.0
*/
function wp_color_scheme_settings() {
global $_wp_admin_css_colors;
diff --git a/src/wp-admin/includes/ms.php b/src/wp-admin/includes/ms.php
index fc5f54a7f4..10ed2e2769 100644
--- a/src/wp-admin/includes/ms.php
+++ b/src/wp-admin/includes/ms.php
@@ -854,6 +854,8 @@ var tb_pathToImage = "<?php echo esc_js( includes_url( 'js/thickbox/loadingAnima
}
/**
+ * @since 3.0.0
+ *
* @param array $users
* @return bool
*/
diff --git a/src/wp-admin/includes/schema.php b/src/wp-admin/includes/schema.php
index 011895f06c..6c15a4d99f 100644
--- a/src/wp-admin/includes/schema.php
+++ b/src/wp-admin/includes/schema.php
@@ -446,7 +446,7 @@ function populate_options( array $options = array() ) {
'moderation_keys' => '',
'active_plugins' => array(),
'category_base' => '',
- 'ping_sites' => 'http://rpc.pingomatic.com/',
+ 'ping_sites' => 'https://rpc.pingomatic.com/',
'comment_max_links' => 2,
'gmt_offset' => $gmt_offset,
diff --git a/src/wp-admin/includes/template.php b/src/wp-admin/includes/template.php
index 16da3388ae..43e3442b00 100644
--- a/src/wp-admin/includes/template.php
+++ b/src/wp-admin/includes/template.php
@@ -2632,6 +2632,8 @@ function get_submit_button( $text = '', $type = 'primary large', $name = 'submit
* Prints out the beginning of the admin HTML header.
*
* @global bool $is_IE
+ *
+ * @since 3.3.0
*/
function _wp_admin_html_begin() {
global $is_IE;
diff --git a/src/wp-admin/includes/upgrade.php b/src/wp-admin/includes/upgrade.php
index a3c7260a04..9b91ef5762 100644
--- a/src/wp-admin/includes/upgrade.php
+++ b/src/wp-admin/includes/upgrade.php
@@ -881,6 +881,11 @@ function upgrade_all() {
if ( $wp_current_db_version < 58975 ) {
upgrade_670();
}
+
+ if ( $wp_current_db_version < 60421 ) {
+ upgrade_682();
+ }
+
maybe_disable_link_manager();
maybe_disable_automattic_widgets();
@@ -2439,6 +2444,42 @@ function upgrade_670() {
wp_set_options_autoload( $options, false );
}
}
+
+/**
+ * Executes changes made in WordPress 6.8.2.
+ *
+ * @ignore
+ * @since 6.8.2
+ *
+ * @global int $wp_current_db_version The old (current) database version.
+ */
+function upgrade_682() {
+ global $wp_current_db_version;
+
+ if ( $wp_current_db_version < 60421 ) {
+ // Upgrade Ping-O-Matic and Twingly to use HTTPS.
+ $ping_sites_value = get_option( 'ping_sites' );
+ $ping_sites_value = explode( "\n", $ping_sites_value );
+ $ping_sites_value = array_map(
+ function ( $url ) {
+ $url = trim( $url );
+ $url = sanitize_url( $url );
+ if (
+ str_ends_with( trailingslashit( $url ), '://rpc.pingomatic.com/' )
+ || str_ends_with( trailingslashit( $url ), '://rpc.twingly.com/' )
+ ) {
+ $url = set_url_scheme( $url, 'https' );
+ }
+ return $url;
+ },
+ $ping_sites_value
+ );
+ $ping_sites_value = array_filter( $ping_sites_value );
+ $ping_sites_value = implode( "\n", $ping_sites_value );
+ update_option( 'ping_sites', $ping_sites_value );
+ }
+}
+
/**
* Executes network-level upgrade routines.
*
diff --git a/src/wp-content/themes/twentyseventeen/functions.php b/src/wp-content/themes/twentyseventeen/functions.php
index 2a4dae4470..22bc3fc58c 100644
--- a/src/wp-content/themes/twentyseventeen/functions.php
+++ b/src/wp-content/themes/twentyseventeen/functions.php
@@ -708,6 +708,16 @@ endif;
*/
function twentyseventeen_should_show_featured_image() {
$show_featured_image = ( is_single() || ( is_page() && ! twentyseventeen_is_frontpage() ) ) && has_post_thumbnail( get_queried_object_id() );
+
+ /**
+ * Filters whether to show the Twenty Seventeen featured image below the header.
+ *
+ * By default, the image is displayed on single posts and pages, unless the page is the front page.
+ *
+ * @since Twenty Seventeen 3.7
+ *
+ * @param bool $show_featured_image Whether to display the featured image below the header.
+ */
return apply_filters( 'twentyseventeen_should_show_featured_image', $show_featured_image );
}
diff --git a/src/wp-content/themes/twentyseventeen/template-parts/post/content-audio.php b/src/wp-content/themes/twentyseventeen/template-parts/post/content-audio.php
index eea60e6c7c..e46faed322 100644
--- a/src/wp-content/themes/twentyseventeen/template-parts/post/content-audio.php
+++ b/src/wp-content/themes/twentyseventeen/template-parts/post/content-audio.php
@@ -42,6 +42,7 @@
</header><!-- .entry-header -->
<?php
+ /** This filter is documented in wp-includes/post-template.php */
$content = apply_filters( 'the_content', get_the_content() );
$audio = false;
diff --git a/src/wp-content/themes/twentyseventeen/template-parts/post/content-video.php b/src/wp-content/themes/twentyseventeen/template-parts/post/content-video.php
index fd7865db92..bd97550b00 100644
--- a/src/wp-content/themes/twentyseventeen/template-parts/post/content-video.php
+++ b/src/wp-content/themes/twentyseventeen/template-parts/post/content-video.php
@@ -42,6 +42,7 @@
</header><!-- .entry-header -->
<?php
+ /** This filter is documented in wp-includes/post-template.php */
$content = apply_filters( 'the_content', get_the_content() );
$video = false;
diff --git a/src/wp-content/themes/twentytwentyfive/functions.php b/src/wp-content/themes/twentytwentyfive/functions.php
index ddb42a89f2..3805c48052 100644
--- a/src/wp-content/themes/twentytwentyfive/functions.php
+++ b/src/wp-content/themes/twentytwentyfive/functions.php
@@ -34,7 +34,7 @@ if ( ! function_exists( 'twentytwentyfive_editor_style' ) ) :
* @return void
*/
function twentytwentyfive_editor_style() {
- add_editor_style( get_parent_theme_file_uri( 'assets/css/editor-style.css' ) );
+ add_editor_style( 'assets/css/editor-style.css' );
}
endif;
add_action( 'after_setup_theme', 'twentytwentyfive_editor_style' );
diff --git a/src/wp-includes/class-wp-phpmailer.php b/src/wp-includes/class-wp-phpmailer.php
index ce71eec458..cc21e6b88c 100644
--- a/src/wp-includes/class-wp-phpmailer.php
+++ b/src/wp-includes/class-wp-phpmailer.php
@@ -48,7 +48,7 @@ class WP_PHPMailer extends PHPMailer\PHPMailer\PHPMailer {
'php.ini'
),
'connect_host' => __( 'SMTP Error: Could not connect to SMTP host.' ),
- 'data_not_accepted' => __( 'SMTP Error: data not accepted.' ),
+ 'data_not_accepted' => __( 'SMTP Error: Data not accepted.' ),
'empty_message' => __( 'Message body empty' ),
/* translators: There is a space after the colon. */
'encoding' => __( 'Unknown encoding: ' ),
diff --git a/src/wp-includes/class-wp-user-meta-session-tokens.php b/src/wp-includes/class-wp-user-meta-session-tokens.php
index d2e27265de..ecbb23d4e8 100644
--- a/src/wp-includes/class-wp-user-meta-session-tokens.php
+++ b/src/wp-includes/class-wp-user-meta-session-tokens.php
@@ -37,6 +37,8 @@ class WP_User_Meta_Session_Tokens extends WP_Session_Tokens {
/**
* Converts an expiration to an array of session information.
*
+ * @since 4.0.0
+ *
* @param mixed $session Session or expiration.
* @return array Session.
*/
diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php
index 33b775e718..640f4b6343 100644
--- a/src/wp-includes/functions.php
+++ b/src/wp-includes/functions.php
@@ -5198,6 +5198,8 @@ function _wp_array_set( &$input_array, $path, $value = null ) {
* Changes to this function should follow updates in the client
* with the same logic.
*
+ * @since 5.8.0
+ *
* @link https://github.com/lodash/lodash/blob/4.17/dist/lodash.js#L14369
* @link https://github.com/lodash/lodash/blob/4.17/dist/lodash.js#L278
* @link https://github.com/lodash-php/lodash-php/blob/master/src/String/kebabCase.php
diff --git a/src/wp-includes/interactivity-api/class-wp-interactivity-api-directives-processor.php b/src/wp-includes/interactivity-api/class-wp-interactivity-api-directives-processor.php
index 590cf967cf..999892758b 100644
--- a/src/wp-includes/interactivity-api/class-wp-interactivity-api-directives-processor.php
+++ b/src/wp-includes/interactivity-api/class-wp-interactivity-api-directives-processor.php
@@ -92,6 +92,8 @@ final class WP_Interactivity_API_Directives_Processor extends WP_HTML_Tag_Proces
* It positions the cursor in the closer tag of the balanced template tag,
* if it exists.
*
+ * @since 6.5.0
+ *
* @access private
*
* @param string $new_content The string to append after the closing template tag.
diff --git a/src/wp-includes/interactivity-api/class-wp-interactivity-api.php b/src/wp-includes/interactivity-api/class-wp-interactivity-api.php
index 38330b2cd0..fdde5d429a 100644
--- a/src/wp-includes/interactivity-api/class-wp-interactivity-api.php
+++ b/src/wp-includes/interactivity-api/class-wp-interactivity-api.php
@@ -744,6 +744,8 @@ final class WP_Interactivity_API {
/**
* Transforms a kebab-case string to camelCase.
*
+ * @since 6.5.0
+ *
* @param string $str The kebab-case string to transform to camelCase.
* @return string The transformed camelCase string.
*/
diff --git a/src/wp-includes/media.php b/src/wp-includes/media.php
index 5d95b0a188..e6c1098277 100644
--- a/src/wp-includes/media.php
+++ b/src/wp-includes/media.php
@@ -1070,7 +1070,6 @@ function wp_get_attachment_image( $attachment_id, $size = 'thumbnail', $icon = f
list( $src, $width, $height ) = $image;
$attachment = get_post( $attachment_id );
- $hwstring = image_hwstring( $width, $height );
$size_class = $size;
if ( is_array( $size_class ) ) {
@@ -1090,15 +1089,14 @@ function wp_get_attachment_image( $attachment_id, $size = 'thumbnail', $icon = f
*
* @param string $context The context. Default 'wp_get_attachment_image'.
*/
- $context = apply_filters( 'wp_get_attachment_image_context', 'wp_get_attachment_image' );
- $attr = wp_parse_args( $attr, $default_attr );
+ $context = apply_filters( 'wp_get_attachment_image_context', 'wp_get_attachment_image' );
+ $attr = wp_parse_args( $attr, $default_attr );
+ $attr['width'] = $width;
+ $attr['height'] = $height;
- $loading_attr = $attr;
- $loading_attr['width'] = $width;
- $loading_attr['height'] = $height;
$loading_optimization_attr = wp_get_loading_optimization_attributes(
'img',
- $loading_attr,
+ $attr,
$context
);
@@ -1169,8 +1167,16 @@ function wp_get_attachment_image( $attachment_id, $size = 'thumbnail', $icon = f
*/
$attr = apply_filters( 'wp_get_attachment_image_attributes', $attr, $attachment, $size );
- $attr = array_map( 'esc_attr', $attr );
- $html = rtrim( "<img $hwstring" );
+ if ( isset( $attr['height'] ) && is_numeric( $attr['height'] ) ) {
+ $height = absint( $attr['height'] );
+ }
+ if ( isset( $attr['width'] ) && is_numeric( $attr['width'] ) ) {
+ $width = absint( $attr['width'] );
+ }
+ unset( $attr['height'], $attr['width'] );
+ $attr = array_map( 'esc_attr', $attr );
+ $hwstring = image_hwstring( $width, $height );
+ $html = rtrim( "<img $hwstring" );
foreach ( $attr as $name => $value ) {
$html .= " $name=" . '"' . $value . '"';
@@ -5559,6 +5565,8 @@ function wpview_media_sandbox_styles() {
/**
* Registers the personal data exporter for media.
*
+ * @since 4.9.6
+ *
* @param array[] $exporters An array of personal data exporters, keyed by their ID.
* @return array[] Updated array of personal data exporters.
*/
diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php
index cd2c06e4cc..3beddac135 100644
--- a/src/wp-includes/script-loader.php
+++ b/src/wp-includes/script-loader.php
@@ -2182,6 +2182,8 @@ function print_footer_scripts() {
/**
* Prints scripts (internal use only)
*
+ * @since 2.8.0
+ *
* @ignore
*
* @global WP_Scripts $wp_scripts
diff --git a/src/wp-includes/version.php b/src/wp-includes/version.php
index c7ee55fc6e..6eca1068aa 100644
--- a/src/wp-includes/version.php
+++ b/src/wp-includes/version.php
@@ -23,7 +23,7 @@ $wp_version = '6.9-alpha-60093-src';
*
* @global int $wp_db_version
*/
-$wp_db_version = 58975;
+$wp_db_version = 60421;
/**
* Holds the TinyMCE version.
diff --git a/tests/phpunit/tests/media.php b/tests/phpunit/tests/media.php
index a1e70c2ff1..902c704b39 100644
--- a/tests/phpunit/tests/media.php
+++ b/tests/phpunit/tests/media.php
@@ -1583,6 +1583,53 @@ EOF;
$this->assertSame( $expected, $output );
}
+ /**
+ * @ticket 14110
+ */
+ public function test_wp_get_attachment_image_filter_with_height_width() {
+ $mock_action = new MockAction();
+ add_filter( 'wp_get_attachment_image_attributes', array( $mock_action, 'filter' ) );
+ wp_get_attachment_image( self::$large_id );
+ $args = $mock_action->get_args();
+ $this->assertArrayHasKey( '0', $args, 'First argument should be an array.' );
+ $this->assertArrayHasKey( '0', $args[0], 'First argument should be an array.' );
+ $this->assertArrayHasKey( 'width', $args[0][0], 'Width should be set.' );
+ $this->assertArrayHasKey( 'height', $args[0][0], 'Height should be set.' );
+ }
+
+ /**
+ * @ticket 14110
+ */
+ public function test_wp_get_attachment_image_filter_change_height_width() {
+ add_filter(
+ 'wp_get_attachment_image_attributes',
+ static function ( $args ) {
+ $args['height'] = '999';
+ $args['width'] = '999';
+ return $args;
+ }
+ );
+ $output = wp_get_attachment_image( self::$large_id );
+ $this->assertStringContainsString( 'width="999"', $output, 'Width should be changed.' );
+ $this->assertStringContainsString( 'height="999"', $output, 'Height should be changed.' );
+ }
+
+ /**
+ * @ticket 14110
+ */
+ public function test_wp_get_attachment_image_filter_unset_height_width() {
+ add_filter(
+ 'wp_get_attachment_image_attributes',
+ static function ( $args ) {
+ unset( $args['height'], $args['width'] );
+ return $args;
+ }
+ );
+ $output = wp_get_attachment_image( self::$large_id );
+ $this->assertStringContainsString( 'width="150"', $output, 'Width should not be changed.' );
+ $this->assertStringContainsString( 'height="150"', $output, 'Height should not be changed.' );
+ }
+
public function filter_wp_get_attachment_image() {
return 'Override wp_get_attachment_image';
}
diff --git a/tests/phpunit/tests/option/sanitizeOption.php b/tests/phpunit/tests/option/sanitizeOption.php
index b4f8293041..68597b8acd 100644
--- a/tests/phpunit/tests/option/sanitizeOption.php
+++ b/tests/phpunit/tests/option/sanitizeOption.php
@@ -43,6 +43,7 @@ class Tests_Option_SanitizeOption extends WP_UnitTestCase {
array( 'date_format', 'F j, Y', 'F j, Y' ),
array( 'date_format', 'F j, Y', 'F j, <strong>Y</strong>' ),
array( 'ping_sites', 'http://rpc.pingomatic.com/', 'http://rpc.pingomatic.com/' ),
+ array( 'ping_sites', 'https://rpc.pingomatic.com/', 'https://rpc.pingomatic.com/' ),
array( 'ping_sites', "http://www.example.com\nhttp://example.org", "www.example.com \n\texample.org\n\n" ),
array( 'gmt_offset', '0', 0 ),
array( 'gmt_offset', '1.5', '1.5' ),