我有一个旧的Mediawiki网站(1.6.x),我需要将其升级到1.31。这个网站有很多页面,其中许多都有HTML格式的html链接文本,例如:
<a href="/index.php?title=My_PAGE">Text</a>
我能够将其数据库升级到1.31。但是,在显示中,上面的html链接被转换为
<a href="/index.php?title=My_PAGE">TEXT</a>
如何阻止Mediawiki(1.31.x)执行上述转换?
我目前不确定如何阻止MediaWiki更改您的代码,但可能的解决方案是使用它
https://www.mediawiki.org/wiki/Extension:Replace_Text
升级后用<
和<
替换>
和>
无法找到方法,我只是在ExampleTemplate.php的public function execute()
中添加了以下两行。
$html = str_replace('<', '<', $html);
$html = str_replace('>', '>', $html);
如果您知道更好的方法,请告诉我。