mirror of
https://github.com/friendica/friendica
synced 2024-11-18 15:03:41 +00:00
Trim terms of service rules before turning them to an array
This commit is contained in:
parent
9a8f6f2150
commit
43aa9cddc5
2 changed files with 4 additions and 4 deletions
|
@ -678,7 +678,7 @@ class System
|
||||||
$html = BBCode::convert($rulelist, false, BBCode::EXTERNAL);
|
$html = BBCode::convert($rulelist, false, BBCode::EXTERNAL);
|
||||||
|
|
||||||
$msg = HTML::toPlaintext($html, 0, true);
|
$msg = HTML::toPlaintext($html, 0, true);
|
||||||
foreach (explode("\n", $msg) as $line) {
|
foreach (explode("\n", trim($msg)) as $line) {
|
||||||
$line = trim($line);
|
$line = trim($line);
|
||||||
if ($line) {
|
if ($line) {
|
||||||
$rules[] = ['id' => (string)++$id, 'text' => $line];
|
$rules[] = ['id' => (string)++$id, 'text' => $line];
|
||||||
|
|
|
@ -83,8 +83,8 @@ class Tos extends BaseModule
|
||||||
|
|
||||||
$tpl = Renderer::getMarkupTemplate('tos.tpl');
|
$tpl = Renderer::getMarkupTemplate('tos.tpl');
|
||||||
if ($this->config->get('system', 'tosdisplay')) {
|
if ($this->config->get('system', 'tosdisplay')) {
|
||||||
$lines = $this->config->get('system', 'tosrules');
|
$lines = trim($this->config->get('system', 'tosrules') ?: '');
|
||||||
if (!empty($lines)) {
|
if ($lines) {
|
||||||
$rules = "[list=1]";
|
$rules = "[list=1]";
|
||||||
foreach (explode("\n", $lines) as $line) {
|
foreach (explode("\n", $lines) as $line) {
|
||||||
$rules .= "\n[*]" . $line;
|
$rules .= "\n[*]" . $line;
|
||||||
|
|
Loading…
Reference in a new issue