`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.


Built from https://develop.svn.wordpress.org/trunk@25661


git-svn-id: http://core.svn.wordpress.org/trunk@25577 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2013-10-02 19:52:09 +00:00
parent e3d58a5b23
commit 3f42db549c
1 changed files with 1 additions and 1 deletions

View File

@ -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);