Update MessageController.php

Fixed order of checking config `format` property
Merge pull request #4561 from maxlapko/patch-1

Update MessageController.php