Refactored models.

This commit is contained in:
Dmitry Khomutov 2018-03-10 01:00:53 +07:00
commit fb11ba4652
No known key found for this signature in database
GPG key ID: EC19426474B37AAC
34 changed files with 2006 additions and 2335 deletions

View file

@ -120,7 +120,7 @@ use PHPCensor\Model\BuildError;
<tr>
<th><?php Lang::out('commit_message'); ?></th>
<td style="text-align: right">
<?= $build->getCommitMessage(); ?>
<?= htmlspecialchars($build->getCommitMessage()); ?>
</td>
</tr>
</table>

View file

@ -68,8 +68,9 @@
<?= $latest->getProject()->getTitle(); ?> #<?= $latest->getId(); ?> (<?= $statusText; ?>)
</h3>
<p>
<?php if ($latest->getCommitMessage()): ?>
<?= $latest->getCommitMessage(); ?><br /><br />
<?php $latestCommitMessage = htmlspecialchars($latest->getCommitMessage()); ?>
<?php if ($latestCommitMessage): ?>
<?= $latestCommitMessage; ?><br /><br />
<?php endif; ?>
<strong>Branch: </strong> <?= $latest->getBranch(); ?><br />

View file

@ -4,7 +4,7 @@ use PHPCensor\Helper\AnsiConverter;
?>
<p style="margin: 10px; background: #fafafa">
<?= $build->getCommitMessage(); ?>
<?= htmlspecialchars($build->getCommitMessage()); ?>
</p>
<pre class="ansi_color_bg_black ansi_color_fg_white" style="padding: 4px">
<?= AnsiConverter::convert($build->getLog()); ?>

View file

@ -1,3 +1,3 @@
<p style="margin: 10px; background: #fafafa">
<?= $build->getCommitMessage(); ?>
<?= htmlspecialchars($build->getCommitMessage()); ?>
</p>

View file

@ -115,9 +115,10 @@ use PHPCensor\Model\Build;
substr($build->getCommitId(), 0, 7),
$build->getCommitterEmail() ? ('(' . $build->getCommitterEmail() . ')') : ''
);
if (!empty($build->getCommitMessage())) {
$buildCommitMessage = htmlspecialchars($build->getCommitMessage());
if ($buildCommitMessage) {
echo '</p><p>';
print $build->getCommitMessage();
echo $buildCommitMessage;
}
}
?>