We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0825a07 commit 44afd13Copy full SHA for 44afd13
src/Mail/Message.php
@@ -189,7 +189,8 @@ public function setPriority(int $priority)
189
*/
190
public function getPriority(): ?int
191
{
192
- return $this->getHeader('X-Priority');
+ $priority = $this->getHeader('X-Priority');
193
+ return is_numeric($priority) ? (int) $priority : null;
194
}
195
196
tests/Mail/Mail.priority.phpt
@@ -0,0 +1,22 @@
1
+<?php
2
+
3
+/**
4
+ * Test: Nette\Mail\Message - Priority.
5
+ */
6
7
+declare(strict_types=1);
8
9
+use Nette\Mail\Message;
10
+use Tester\Assert;
11
12
13
+require __DIR__ . '/../bootstrap.php';
14
15
16
+$mail = new Message;
17
18
+Assert::null($mail->getPriority());
19
20
+$mail->setPriority(2);
21
22
+Assert::same(2, $mail->getPriority());
0 commit comments