Skip to content

Commit

Permalink
Configuration::updateValue: preserve new lines
Browse files Browse the repository at this point in the history
There was a bug introduced in 1.1.0 that resulted in new lines being
striped away from configuration values, if $html escaping was not used.
This bug was caused by this code:

  strip_tags(Tools::nl2br($value));

Which is obviously wrong. nl2br converts new lines to <br />, and
strip_tags immediately removes this tag from the code.

The fix is to remove nl2br call altogether.

Closes #1107
  • Loading branch information
getdatakick committed Nov 12, 2019
1 parent a86e72e commit d6ca9f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion classes/Configuration.php
Expand Up @@ -635,7 +635,7 @@ public static function updateValue($key, $values, $html = false, $idShopGroup =
$value = Tools::purifyHTML($value);
} else {
// if html values are not allowed, strip tags
$value = strip_tags(Tools::nl2br($value));
$value = strip_tags($value);
}
}
}
Expand Down

0 comments on commit d6ca9f6

Please sign in to comment.