Explicitly pass flags to htmlspecialchars to have consistent behavior.

This commit is contained in:
levlam 2023-06-04 23:10:06 +03:00
parent 9b8bb82897
commit ad8d1f8964
2 changed files with 2 additions and 2 deletions

View File

@ -39,7 +39,7 @@ class DoxygenTlDocumentationGenerator extends TlDocumentationGenerator
protected function escapeDocumentation($doc) protected function escapeDocumentation($doc)
{ {
$doc = htmlspecialchars($doc); $doc = htmlspecialchars($doc, ENT_COMPAT);
$doc = preg_replace_callback('/"((http|https|tg):\/\/[^" ]*)"/', $doc = preg_replace_callback('/"((http|https|tg):\/\/[^" ]*)"/',
function ($quoted_link) 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]); return preg_replace_callback('/_([A-Za-z])/', function ($matches) {return strtoupper($matches[1]);}, $word_matches[0]);
}, $doc); }, $doc);
$doc = htmlspecialchars($doc); $doc = htmlspecialchars($doc, ENT_COMPAT);
$doc = str_replace('*/', '*/', $doc); $doc = str_replace('*/', '*/', $doc);
return $doc; return $doc;
} }