Procházet zdrojové kódy

Make sure is an array

Signed-off-by: Suki <[email protected]>
Suki před 12 roky
rodič
revize
51180ab6d6
1 změnil soubory, kde provedl 5 přidání a 1 odebrání
  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();