Skip to content

Commit

Permalink
Merge branch '4.8.5' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
bloatware committed Jan 18, 2021
2 parents 3b75a9d + 50e29f1 commit 9214092
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
8 changes: 8 additions & 0 deletions HISTORY.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,19 @@ Changes in 4.8.5 (upcoming)
* Fixed: libxml_disable_entity_loader() deprecation warning on PHP 8.0.
* Fixed: Undefined array key/offset warnings on PHP 8.0.
* Fixed: System temp directory notice on PHP 8.0.
* Fixed: Custom field ordering on Write panel.
* Fixed: Diagnostics panel strings no longer have 'Help' appended, and
the textarea is rendered fully in English to aid support requests.
* Added: SSL version verification on Diagnostics panel during update checks.
* Added: Latest text translations. Thank you to all our translators.
* Added: More aggregators in <txp:article /> 'fields' attribute.
* Added: Global 'break', 'replace' and 'trim' attributes.
* Changed: Expose secondpass Advanced pref for testing.
* Changed: Plugin load warning includes version number.
* Changed: Comments off by default on new installations.
* Changed: If allowed, <txp:php /> is processed in forms even in article body.
* Changed: Staff writers are allowed to use <txp:php /> (they were able to do
it in forms anyway).
* PrismJS 1.23.0.

Changes in 4.8.4 (29 Nov 2020)
Expand Down
12 changes: 8 additions & 4 deletions textpattern/lib/txplib_html.php
Original file line number Diff line number Diff line change
Expand Up @@ -1743,16 +1743,20 @@ function doWrap($list, $wraptag, $break, $class = null, $breakclass = null, $att
if (isset($trim) || isset($replace)) {
$replacement = $replace === true ? null : $replace;

if (!isset($trim) || $trim === true) {
!$trim or $list = array_map('trim', $list);
if ($trim === true) {
$list = array_map('trim', $list);
!isset($replacement) or $list = preg_replace('/\s+/', $replacement, $list);
} else {
} elseif (isset($trim)) {
$list = strlen($trim) > 2 && preg_match('/([^\\\w\s]).+\1[UsiAmuS]*$/As', $trim) ?
preg_replace($trim, $replacement, $list) :
(isset($replacement) ?
str_replace($trim, $replacement, $list) :
aray_map(function ($v) use ($trim) {return trim($v, $trim);})
array_map(function ($v) use ($trim) {return trim($v, $trim);})
);
} elseif (isset($replacement)) {
$list = strlen($replacement) > 2 && preg_match('/([^\\\w\s]).+\1[UsiAmuS]*$/As', $replacement) ?
array_filter($list, function ($v) use ($replacement) {return preg_match($replacement, $v);}) :
array_filter($list, function ($v) use ($replacement) {return strpos($v, $replacement) !== false;});
}

$list = array_filter($list, function ($v) {return $v !== '';});
Expand Down

0 comments on commit 9214092

Please sign in to comment.