Explicitly pass encoding to htmlspecialchars.

This commit is contained in:
levlam 2023-06-05 00:05:21 +03:00
parent ad8d1f8964
commit 31eee9d084
3 changed files with 3 additions and 3 deletions

View File

@ -11,7 +11,7 @@ class DotnetTlDocumentationGenerator extends TlDocumentationGenerator
{
return ucfirst(preg_replace_callback('/_([A-Za-z])/', function ($matches) {return strtoupper($matches[1]);}, $word_matches[0]));
}, $doc);
$doc = htmlspecialchars($doc, ENT_XML1);
$doc = htmlspecialchars($doc, ENT_XML1, 'UTF-8');
$doc = str_replace('*/', '*/', $doc);
return $doc;
}

View File

@ -39,7 +39,7 @@ class DoxygenTlDocumentationGenerator extends TlDocumentationGenerator
protected function escapeDocumentation($doc)
{
$doc = htmlspecialchars($doc, ENT_COMPAT);
$doc = htmlspecialchars($doc, ENT_COMPAT, 'UTF-8');
$doc = preg_replace_callback('/"((http|https|tg):\/\/[^" ]*)"/',
function ($quoted_link)
{

View File

@ -15,7 +15,7 @@ class JavadocTlDocumentationGenerator extends TlDocumentationGenerator
{
return preg_replace_callback('/_([A-Za-z])/', function ($matches) {return strtoupper($matches[1]);}, $word_matches[0]);
}, $doc);
$doc = htmlspecialchars($doc, ENT_COMPAT);
$doc = htmlspecialchars($doc, ENT_COMPAT, 'UTF-8');
$doc = str_replace('*/', '*/', $doc);
return $doc;
}