From faa8c3c9ef1d3c8d97ffc94f50c6f4916bd8dfb4 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Wed, 2 Oct 2013 19:51:57 +0000 Subject: [PATCH] `post_content` does not have a default value in the `$wpdb->posts` table. Add a default value of empty string to `wp_insert_attachment()` to avoid a tornado of database errors in PHP 5.5/MySQL 5.6, even when debug mode is turned off. See #25282. git-svn-id: https://develop.svn.wordpress.org/trunk@25661 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/post.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php index e74d59242d..057a1b21cd 100644 --- a/src/wp-includes/post.php +++ b/src/wp-includes/post.php @@ -3957,7 +3957,7 @@ function wp_insert_attachment($object, $file = false, $parent = 0) { $defaults = array('post_status' => 'inherit', 'post_type' => 'post', 'post_author' => $user_ID, 'ping_status' => get_option('default_ping_status'), 'post_parent' => 0, 'post_title' => '', - 'menu_order' => 0, 'to_ping' => '', 'pinged' => '', 'post_password' => '', + 'menu_order' => 0, 'to_ping' => '', 'pinged' => '', 'post_password' => '', 'post_content' => '', 'guid' => '', 'post_content_filtered' => '', 'post_excerpt' => '', 'import_id' => 0, 'context' => ''); $object = wp_parse_args($object, $defaults);