Mediawiki

MediaWiki 在修改文件後出現恐慌。也許是校驗和?

  • May 7, 2011

我最近在開發伺服器上安裝了最新版本的 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在這裡驚慌失措是有原因的嗎?我會盡可能多地提供這方面的資訊,但我要到星期一才會再次到辦公室。謝謝

聽起來您的編輯破壞了一些 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

引用自:https://serverfault.com/questions/267155