1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-12-23 14:00:55 +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:
vrana 2013-02-13 00:33:14 -08:00
parent 42ae7cd92f
commit 980889f1ba

View file

@ -123,6 +123,12 @@ final class ArcanistDiffUtils {
$highlight_o = '<span class="bright">'; $highlight_o = '<span class="bright">';
$highlight_c = '</span>'; $highlight_c = '</span>';
$is_html = false;
if ($str instanceof PhutilSafeHTML) {
$is_html = true;
$str = $str->getHTMLContent();
}
$n = strlen($str); $n = strlen($str);
for ($i = 0; $i < $n; $i++) { for ($i = 0; $i < $n; $i++) {
@ -176,6 +182,11 @@ final class ArcanistDiffUtils {
$highlight = false; $highlight = false;
} }
} }
if ($is_html) {
return phutil_safe_html($buf);
}
return $buf; return $buf;
} }