mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-12-22 21:40:54 +01:00
Handle safe HTML in intraline renderer
Test Plan: Used it in Phabricator. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T2432 Differential Revision: https://secure.phabricator.com/D4928
This commit is contained in:
parent
42ae7cd92f
commit
980889f1ba
1 changed files with 11 additions and 0 deletions
|
@ -123,6 +123,12 @@ final class ArcanistDiffUtils {
|
|||
$highlight_o = '<span class="bright">';
|
||||
$highlight_c = '</span>';
|
||||
|
||||
$is_html = false;
|
||||
if ($str instanceof PhutilSafeHTML) {
|
||||
$is_html = true;
|
||||
$str = $str->getHTMLContent();
|
||||
}
|
||||
|
||||
$n = strlen($str);
|
||||
for ($i = 0; $i < $n; $i++) {
|
||||
|
||||
|
@ -176,6 +182,11 @@ final class ArcanistDiffUtils {
|
|||
$highlight = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ($is_html) {
|
||||
return phutil_safe_html($buf);
|
||||
}
|
||||
|
||||
return $buf;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue