Message info
 
To:buddypress-trac@lists.automattic.com From:buddypress-trac@lists.automattic.com Subject:[buddypress-trac] [BuddyPress][6059] trunk/bp-messages/bp-messages-actions.php: Prevent PHP Notice when sending private messages with javascript disabled. Date:Sat, 2 Jun 2012 21:38:48 +0000 (UTC)
 

Revision
6059
Author
djpaul
Date
2012-06-02 21:38:48 +0000 (Sat, 02 Jun 2012)

Log Message

Prevent PHP Notice when sending private messages with javascript disabled. Fixes #4225, props hnla and r-a-y

Modified Paths

Diff

Modified: trunk/bp-messages/bp-messages-actions.php (6058 => 6059)


--- trunk/bp-messages/bp-messages-actions.php	2012-06-01 06:36:12 UTC (rev 6058)
+++ trunk/bp-messages/bp-messages-actions.php	2012-06-02 21:38:48 UTC (rev 6059)
@@ -32,7 +32,7 @@
 		check_admin_referer( 'messages_send_message', 'send_message_nonce' );
 
 		// Send the reply
-		if ( messages_new_message( array( 'thread_id' => $thread_id, 'subject' => $_POST['subject'], 'content' => $_POST['content'] ) ) )
+		if ( messages_new_message( array( 'thread_id' => $thread_id, 'subject' => ! empty( $_POST['subject'] ) ? $_POST['subject'] : false, 'content' => $_POST['content'] ) ) )
 			bp_core_add_message( __( 'Your reply was sent successfully', 'buddypress' ) );
 		else
 			bp_core_add_message( __( 'There was a problem sending your reply, please try again', 'buddypress' ), 'error' );