소스 검색

Make sure is an array

Signed-off-by: Suki <[email protected]>
Suki 12 년 전
부모
커밋
51180ab6d6
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      Sources/Subs-Post.php

+ 5 - 1
Sources/Subs-Post.php

@@ -833,8 +833,12 @@ function sendpm($recipients, $subject, $message, $store_outbox = false, $from =
 	if ($smcFunc['strlen']($htmlsubject) > 100)
 		$htmlsubject = $smcFunc['substr']($htmlsubject, 0, 100);
 
+	// Make sure is an array
+	if (!is_array($recipients))
+		$recipients = array($recipients);
+
 	// Integrated PMs
-	call_integration_hook('integrate_personal_message', array(&$recipients, &$from['username'], &$subject, &$message));
+	call_integration_hook('integrate_personal_message', array(&$recipients, &$from, &$subject, &$message));
 
 	// Get a list of usernames and convert them to IDs.
 	$usernames = array();