Skip to content

Commit 15145f6

Browse files
committed
Add a configuration check for encoding detection
1 parent 7688879 commit 15145f6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

webapp/src/Service/CheckConfigService.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,12 @@ public function checkPhpSettings(): ConfigCheckItem
189189
(isset($sizes[$var]) ? Utils::printsize($sizes[$var]) : "unlimited"));
190190
}
191191

192+
$desc .= "\nFor submission encoding detection, the detect order should at least contain all expected submission encodings:\n";
193+
$desc .= sprintf(" - `mbstring.detect_order` should at least contain `UTF-8` (now set to `%s`)\n", implode(', ', mb_detect_order()));
194+
if ($result !== 'E' && !in_array('UTF-8', mb_detect_order())) {
195+
$result = 'W';
196+
}
197+
192198
$this->stopwatch->stop(__FUNCTION__);
193199
return new ConfigCheckItem(
194200
caption: 'PHP settings',

0 commit comments

Comments
 (0)