我最近在开发服务器上安装了最新版本的 MediaWiki。我想在编辑页面上添加一些信息,为此需要修改现有的 .php 文件以添加更多文本。
我使用 grep 查找哪个文件包含我想要更改的文本。结果是 languages/messages/MessagesEn.php。我找到了文本并将其更改为我想要的内容。
我最后只在“编辑”页面的版权声明正下方添加了几行额外信息。现在我无法进入我的 wiki 主页。
有人知道这是为什么吗?MediaWiki 是开源的,因此更改源代码应该不是什么大问题。我以为可能存在某种校验和检查,当我修改文件时,MediaWiki 发现文件没有相同的校验和时就慌了。
有想法吗?
编辑:我删除了添加到文件中的文本,MediaWiki 又恢复了工作。这表明我添加的文本是问题所在。我仍然希望该文本保留在那里,所以我的问题仍然有效。
更新:
以下是我正在编辑的部分:
'copyrightwarning' => "Please note that all contributions to {{SITENAME}} are considered to be released under the $2 (see $1 for details).
If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.<br />
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
'''Do not submit copyrighted work without permission!'''",
'copyrightwarning2' => "Please note that all contributions to {{SITENAME}} may be edited, altered, or removed by other contributors.
If you do not want your writing to be edited mercilessly, then do not submit it here.<br />
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see $1 for details).
'''Do not submit copyrighted work without permission!'''",
我将文本更改为如下内容:
'copyrightwarning' => "Please note that all contributions to {{SITENAME}} are considered to be released under the $2 (see $1 for details).
If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.<br />
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
'''Do not submit copyrighted work without permission!''' **blah blah blah blah**",
'copyrightwarning2' => "Please note that all contributions to {{SITENAME}} may be edited, altered, or removed by other contributors.
If you do not want your writing to be edited mercilessly, then do not submit it here.<br />
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see $1 for details).
'''Do not submit copyrighted work without permission!''' **blah blah blah blah**",
MediaWiki 为何如此恐慌?我会尽量提供尽可能多的信息,但我周一才会回办公室。谢谢
答案1
听起来你的编辑破坏了一些 PHP,可能是因为字符转义不当。
MediaWiki 中的大多数内容不涉及对.php
文件的直接编辑。对系统消息的编辑发生在 MediaWiki 界面内,就像对任何其他页面的编辑一样。系统消息位于以下特殊页面:
http://example.com/index.php?title=Special:AllMessages
具体来说,对于您的版权信息:
http://example.com/index.php?title=MediaWiki:Copyrightwarning&action=edit
http://example.com/index.php?title=MediaWiki:Copyrightwarning2&action=edit