Merge pull request #12469 from MrPetovan/bug/12462-tos-rules

Skip blank lines in Tos module
This commit is contained in:
Tobias Diekershoff 2022-12-19 06:58:42 +01:00 committed by GitHub
commit b4db8fe8d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -85,11 +85,13 @@ class Tos extends BaseModule
if ($this->config->get('system', 'tosdisplay')) { if ($this->config->get('system', 'tosdisplay')) {
$lines = trim($this->config->get('system', 'tosrules') ?: ''); $lines = trim($this->config->get('system', 'tosrules') ?: '');
if ($lines) { if ($lines) {
$rules = "[list=1]"; $rules = "[ol]";
foreach (explode("\n", $lines) as $line) { foreach (explode("\n", $lines) as $line) {
$rules .= "\n[*]" . $line; if (trim($line)) {
$rules .= "\n[*]" . trim($line);
}
} }
$rules .= "\n[/list]\n"; $rules .= "\n[/ol]\n";
} else { } else {
$rules = ''; $rules = '';
} }