增加reinfo里的转义
This commit is contained in:
@@ -30,32 +30,14 @@
|
||||
margin-bottom: -10px !important;
|
||||
}
|
||||
</style>
|
||||
<?php
|
||||
function trans_md($str)
|
||||
{
|
||||
$s = $str;
|
||||
$s = bbcode_to_html($s);
|
||||
if (
|
||||
strpos($s, "class='md") === false &&
|
||||
strpos($s, "class=\"md") === false
|
||||
) // 没找到,那就加上
|
||||
$s = "<span class='md'>" . $s . "</span>";
|
||||
// 删除代码块里的<br />防止引起混乱
|
||||
$s = preg_replace_callback('/(```.*?```|`[^`]*`)/s', function ($matches) {
|
||||
return str_replace('<br />', '', $matches[0]);
|
||||
}, $s);
|
||||
// 特殊转义
|
||||
$s = str_replace("<br />", "\n", $s);
|
||||
return $s;
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="padding">
|
||||
<div style="margin-top: 0px; margin-bottom: 14px; " v-if="content != null && content !== ''">
|
||||
<p class="transition visible">
|
||||
<strong ><?php echo "$MSG_ERROR_INFO";?> </strong>
|
||||
</p>
|
||||
<div class="ui existing segment">
|
||||
<pre v-if="escape" style="margin-top: 0; margin-bottom: 0; " id="errtxt"><?php echo trans_md($view_reinfo)?></pre>
|
||||
<div class="ui existing segment">echo htmlentities($view_reinfo,ENT_QUOTES,"UTF-8")
|
||||
<pre v-if="escape" style="margin-top: 0; margin-bottom: 0; " id="errtxt"><?php echo htmlentities($view_reinfo,ENT_QUOTES,"UTF-8")?></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user