mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-26 14:38:19 +01:00
Fix an issue where lines with more than one pattern match highlighted improperly in Diffusion
Summary: Ref T13339. If a search pattern matches more than once on a line, we currently render the line incorreclty, duplicating some of the text. `substr()` is being called as though the third parameter was `end_offset`, but it's actually `length`. Correct the parameter. Test Plan: Before: {F6676625} After: {F6676623} Maniphest Tasks: T13339 Differential Revision: https://secure.phabricator.com/D20695
This commit is contained in:
parent
1fe6311167
commit
6c41508906
1 changed files with 1 additions and 1 deletions
|
@ -47,7 +47,7 @@ final class DiffusionPatternSearchView extends DiffusionView {
|
||||||
$offset = $match[1];
|
$offset = $match[1];
|
||||||
if ($cursor != $offset) {
|
if ($cursor != $offset) {
|
||||||
$output[] = array(
|
$output[] = array(
|
||||||
'text' => substr($string, $cursor, $offset),
|
'text' => substr($string, $cursor, ($offset - $cursor)),
|
||||||
'highlight' => false,
|
'highlight' => false,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue