Skip to content

Commit

Permalink
[helper] preg_match offset is by default 0
Browse files Browse the repository at this point in the history
  • Loading branch information
connorhu committed Dec 20, 2023
1 parent 69e489a commit da40bd0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/helper/TextHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function truncate_text($text, $length = 30, $truncate_string = '...', $truncate_

if ($strlen($text) > $length) {
if ($truncate_pattern) {
$length_min = null !== $length_max && (0 == $length_max || $length_max > $length) ? $length : null;
$length_min = null !== $length_max && (0 == $length_max || $length_max > $length) ? $length : 0;

preg_match($truncate_pattern, $text, $matches, PREG_OFFSET_CAPTURE, $length_min);

Expand Down

0 comments on commit da40bd0

Please sign in to comment.