T_PAAMAYIM_NEKUDOTAYIM inesperado, esperando T_NS_Separator
Moví una aplicación desde unUbuntu 11.04ervidor @ (Natty Narwhal) a unaRed Hat Enterprise Linux (RHEL) servidor durante el fin de semana. Mi registro de errores está lleno de errores de PHP en la línea de asunto que hace referencia a la siguiente función:
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;
}
El error se arroja en el
If (!Namespace::isTalk($ns)
declaración. Este error es nuevo para mí. ¿Cómo podría resolverlo?
Cambié el código ofensivo a:
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;
¿Sería suficiente para corregir el error, al menos en este archivo?