$allMsgs = array();
$catDesc = $catMsg . '-desc';
$catMsgTitle = Title::makeTitleSafe( NS_MEDIAWIKI, $catMsg );
+ if ( !$catMsgTitle ) {
+ continue;
+ }
$catMsgTitleText = Linker::link(
$catMsgTitle,
htmlspecialchars( $catMsg )
$ns = MWNamespace::getValidNamespaces();
foreach ( $ns as $namesp ) {
$tempTitle = Title::makeTitleSafe( $namesp, $catMsg );
+ if ( !$tempTitle ) {
+ continue;
+ }
$catName = $msgObj->title( $tempTitle )->text();
- if ( !$msgObj->isDisabled() ) {
+ # Allow tracking categories to be disabled by setting them to "-"
+ if ( $catName !== '-' ) {
$catTitle = Title::makeTitleSafe( NS_CATEGORY, $catName );
+ if ( $catTitle ) {
+ $catTitleText = Linker::link(
+ $catTitle,
+ htmlspecialchars( $catName )
+ );
+ $allMsgs[] = $catTitleText;
+ }
+ }
+ }
+ } else {
+ $catName = $msgObj->text();
+ # Allow tracking categories to be disabled by setting them to "-"
+ if ( $catName !== '-' ) {
+ $catTitle = Title::makeTitleSafe( NS_CATEGORY, $catName );
+ if ( $catTitle ) {
$catTitleText = Linker::link(
$catTitle,
htmlspecialchars( $catName )
$allMsgs[] = $catTitleText;
}
}
- } else {
- $catName = $msgObj->text();
- if ( !$msgObj->isDisabled() ) {
- $catTitle = Title::makeTitleSafe( NS_CATEGORY, $catName );
- $catTitleText = Linker::link(
- $catTitle,
- htmlspecialchars( $catName )
- );
- } else {
- $catTitleText = $this->msg( 'trackingcategories-disabled' )->parse();
- }
- $allMsgs[] = $catTitleText;
+ }
+
+ # Extra message, when no category was found
+ if ( !count( $allMsgs ) ) {
+ $allMsgs[] = $this->msg( 'trackingcategories-disabled' )->parse();
}
/*