Browse Source

Merge pull request #306 from towards-a-new-leftypol/code-markup-encoding

Prevent double-encoding of HTML entities in [code]
pull/40/head
nonmakina 3 years ago
committed by GitHub
parent
commit
f89b5cdff0
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      inc/functions.php

4
inc/functions.php

@ -2196,8 +2196,8 @@ function markup(&$body, $track_cites = false, $op = false) {
$code = rtrim(ltrim($code, "\r\n"));
$code = "<pre class='code lang-$code_lang'>".str_replace(array("\n","\t"), array("&#10;","&#9;"), htmlspecialchars($code))."</pre>";
$code = "<pre class='code lang-$code_lang'>".str_replace(array("\n","\t"), array("&#10;","&#9;"), htmlspecialchars($code, ENT_COMPAT, "UTF-8", false))."</pre>";
$body = str_replace("<code $id>", $code, $body);
}
}

Loading…
Cancel
Save