我在周末将应用程序从Ubuntu 11.04(Natty Narwhal)服务器移动到Red Hat Enterprise Linux(RHEL)服务器.我的错误日志中充满了主题行中引用以下函数的PHP错误:
function wfTalkHereArticleFromTitle( &$title, &$article ) {
global $wgRequest, $wgTalkHereNamespaces;
if (isset($title->noTalkHere))
return true; //Stop recursion
$action = $wgRequest->getVal( 'action' );
$oldid = $wgRequest->getVal( 'oldid' );
$diff = $wgRequest->getVal( 'diff' );
if ($action == 'purge')
$action = NULL; //"purge" is not considered an action in this context
if ($action || $oldid || $diff)
return true;
$ns = $title->getNamespace();
if (!Namespace::isTalk($ns) && Namespace::canTalk($ns) && $title->exists()
&& ( !$wgTalkHereNamespaces || in_array($ns, $wgTalkHereNamespaces) ) ) {
$tns = Namespace::getTalk($ns);
$talk = Title::makeTitle($tns, $title->getDBKey());
if ($talk && $talk->userCan('read')) {
$t = clone $title;
$t->noTalkHere = true; //Stop recursion
$a = MediaWiki::articleFromTitle( $t );
$article = new TalkHereArticle( $a, $talk );
}
}
return true;
}
Run Code Online (Sandbox Code Playgroud)
该错误被抛出
If (!Namespace::isTalk($ns)
Run Code Online (Sandbox Code Playgroud)
声明.这个错误对我来说是个新错误.我该如何解决?
我将违规代码更改为:
if ( !Ns::isTalk($ns) && Ns::canTalk($ns) && $title->exists()
&& ( !$wgTalkHereNamespaces || in_array($ns, $wgTalkHereNamespaces) ) ) {
$tns = Ns::getTalk($ns);
$talk = Title::makeTitle($tns, $title->getDBKey());
if ($talk && $talk->userCan('read')) {
$t = clone $title;
$t->noTalkHere = true; //Stop recursion
$a = MediaWiki::articleFromTitle( $t );
$article = new TalkHereArticle( $a, $talk );
}
}
return true;
Run Code Online (Sandbox Code Playgroud)
是否足以修复错误,至少在此文件中?
| 归档时间: |
|
| 查看次数: |
9963 次 |
| 最近记录: |