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
This commit is contained in:
parent
f3488744ce
commit
faa8c3c9ef
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user