24 namespace MediaWiki\Specials;
44 private $contentHandlerFactory;
56 parent::__construct(
'BrokenRedirects' );
57 $this->contentHandlerFactory = $contentHandlerFactory;
75 return $this->
msg(
'brokenredirectstext' )->parseAsBlock();
88 'namespace' =>
'p1.page_namespace',
89 'title' =>
'p1.page_title',
99 'rd_interwiki IS NULL OR rd_interwiki = ' .
$dbr->addQuotes(
'' ),
100 'p2.page_namespace IS NULL',
104 'rd_from=p1.page_id',
106 'p2' => [
'LEFT JOIN', [
107 'rd_namespace=p2.page_namespace',
108 'rd_title=p2.page_title'
118 return [
'rd_namespace',
'rd_title',
'rd_from' ];
128 if ( isset( $result->rd_title ) ) {
130 $result->rd_namespace,
132 $result->rd_fragment ??
''
135 $blinks = $fromObj->getBrokenLinksFrom(); # TODO: check
for redirect, not
for links
146 if ( !is_object( $toObj ) ) {
147 return '<del>' . $linkRenderer->makeLink( $fromObj ) .
'</del>';
150 $from = $linkRenderer->makeKnownLink(
154 [
'redirect' =>
'no' ]
162 $this->contentHandlerFactory->getContentHandler( $fromObj->getContentModel() )
163 ->supportsDirectEditing()
165 $links[] = $linkRenderer->makeKnownLink(
167 $this->
msg(
'brokenredirects-edit' )->text(),
169 [
'action' =>
'edit' ]
172 $to = $linkRenderer->makeBrokenLink( $toObj, $toObj->getFullText() );
175 $out = $from . $this->
msg(
'word-separator' )->escaped();
178 $links[] = $linkRenderer->makeKnownLink(
180 $this->
msg(
'brokenredirects-delete' )->text(),
183 'action' =>
'delete',
184 'wpReason' => $this->
msg(
'brokenredirects-delete-reason' )
185 ->inContentLanguage()
192 $out .= $this->
msg(
'parentheses' )->rawParams( $this->
getLanguage()
193 ->pipeList( $links ) )->escaped();
195 $out .=
" {$arr} {$to}";
202 parent::execute( $par );
216 return 'maintenance';
223 class_alias( SpecialBrokenRedirects::class,
'SpecialBrokenRedirects' );
This is a class for doing query pages; since they're almost all the same, we factor out some of the f...
setDatabaseProvider(IConnectionProvider $databaseProvider)
executeLBFromResultWrapper(IResultWrapper $res, $ns=null)
Creates a new LinkBatch object, adds all pages from the passed result wrapper (MUST include title and...
setLinkBatchFactory(LinkBatchFactory $linkBatchFactory)
The main skin class which provides methods and properties for all other skins.
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
getAuthority()
Shortcut to get the Authority executing this instance.
getLanguage()
Shortcut to get user's language.
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.