MAke sure post_parent is valid.

git-svn-id: http://svn.automattic.com/wordpress/trunk@3354 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2005-12-24 05:34:50 +00:00
parent d0ff0c9315
commit c9afa8e4dc
1 changed files with 5 additions and 2 deletions

View File

@ -272,8 +272,11 @@ function wp_insert_attachment($object, $file = false, $post_parent = 0) {
$to_ping = preg_replace('|\s+|', "\n", $to_ping);
else
$to_ping = '';
$post_parent = (int) $post_parent;
if ( isset($post_parent) )
$post_parent = (int) $post_parent;
else
$post_parent = 0;
if ( isset($menu_order) )
$menu_order = (int) $menu_order;