Skip to content

Commit fccf193

Browse files
committed
Fix null parameter to sscanf() on SimpleMessage
1 parent 2514e05 commit fccf193

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/classes/Swift/Mime/SimpleMessage.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -489,9 +489,11 @@ public function setPriority($priority)
489489
*/
490490
public function getPriority()
491491
{
492-
list($priority) = sscanf($this->_getHeaderFieldModel('X-Priority'),
493-
'%[1-5]'
494-
);
492+
$fieldModel = $this->_getHeaderFieldModel('X-Priority');
493+
if (!$fieldModel) {
494+
return 3;
495+
}
496+
list($priority) = sscanf($fieldModel, '%[1-5]');
495497

496498
return isset($priority) ? $priority : 3;
497499
}

0 commit comments

Comments
 (0)