Go to the documentation of this file.
43 $this->mQuery = $params[
'query'];
44 $this->mNs = $params[
'namespace'];
45 $this->mProt = $params[
'protocol'];
49 parent::__construct( $name );
65 $out->allowClickjacking();
68 $target = $request->getVal(
'target', $par );
69 $namespace = $request->getIntOrNull(
'namespace' );
72 foreach ( $this->
getConfig()->
get(
'UrlProtocols' ) as $prot ) {
73 if ( $prot !==
'//' ) {
74 $protocols_list[] = $prot;
78 $target2 = Parser::normalizeLinkUrl( $target );
80 $protocol =
'http://';
82 if ( isset( $bits[
'scheme'] ) && isset( $bits[
'delimiter'] ) ) {
83 $protocol = $bits[
'scheme'] . $bits[
'delimiter'];
86 if ( strcasecmp( $protocol, substr( $target, 0, strlen( $protocol ) ) ) === 0 ) {
87 $target2 = substr( $target, strlen( $protocol ) );
96 '<nowiki>' . $this->
getLanguage()->commaList( $protocols_list ) .
'</nowiki>',
97 count( $protocols_list )
105 'label-message' =>
'linksearch-pat',
106 'default' => $target,
110 if ( !$this->
getConfig()->
get(
'MiserMode' ) ) {
113 'type' =>
'namespaceselect',
114 'name' =>
'namespace',
115 'label-message' =>
'linksearch-ns',
116 'default' => $namespace,
119 'cssclass' =>
'namespaceselector',
127 $htmlForm->addHiddenFields( $hiddenFields );
128 $htmlForm->setSubmitTextMsg(
'linksearch-ok' );
129 $htmlForm->setWrapperLegendMsg(
'linksearch' );
131 $htmlForm->setMethod(
'get' );
132 $htmlForm->prepareForm()->displayForm(
false );
135 if ( $target !=
'' ) {
138 'namespace' => $namespace,
139 'protocol' => $protocol ] );
140 parent::execute( $par );
141 if ( $this->mungedQuery ===
false ) {
142 $out->addWikiMsg(
'linksearch-error' );
158 if ( $this->mNs !==
null && !$this->
getConfig()->
get(
'MiserMode' ) ) {
168 if ( $this->mQuery ===
'*' && $this->mProt !==
'' ) {
169 $this->mungedQuery = [
170 'el_index_60' .
$dbr->buildLike( $this->mProt,
$dbr->anyString() ),
174 'protocol' => $this->mProt,
175 'oneWildcard' =>
true,
179 if ( $this->mungedQuery ===
false ) {
181 return [
'tables' =>
'page',
'fields' =>
'page_id',
'conds' =>
'0=1' ];
185 if ( !isset( $this->mungedQuery[
'el_index_60'] ) ) {
186 $orderBy[] =
'el_index_60';
188 $orderBy[] =
'el_id';
191 'tables' => [
'page',
'externallinks' ],
193 'namespace' =>
'page_namespace',
194 'title' =>
'page_title',
195 'value' =>
'el_index',
198 'conds' => array_merge(
204 'options' => [
'ORDER BY' => $orderBy ]
207 if ( $this->mNs !==
null && !$this->
getConfig()->
get(
'MiserMode' ) ) {
208 $retval[
'conds'][
'page_namespace'] =
$this->mNs;
236 return $this->
msg(
'linksearch-line' )->rawParams( $urlLink, $pageLink )->escaped();
260 return max( parent::getMaxResults(), 60000 );
getMaxResults()
enwiki complained about low limits on this special page
getPageTitle( $subpage=false)
Get a self-referential title object.
Special:LinkSearch to search the external-links table.
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
isSyndicated()
Disable RSS/Atom feeds.
static getQueryConditions( $filterEntry, array $options=[])
Return query conditions which will match the specified string.
getOutput()
Get the OutputPage being used for this instance.
getQueryInfo()
Subclasses return an SQL query here, formatted as an array with the following keys: tables => Table(s...
linkParameters()
If using extra form wheely-dealies, return a set of parameters here as an associative array.
getLanguage()
Shortcut to get user's language.
This is a class for doing query pages; since they're almost all the same, we factor out some of the f...
executeLBFromResultWrapper(IResultWrapper $res, $ns=null)
Creates a new LinkBatch object, adds all pages from the passed result wrapper (MUST include title and...
formatResult( $skin, $result)
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
wfParseUrl( $url)
parse_url() work-alike, but non-broken.
getConfig()
Shortcut to get main config object.
wfScript( $script='index')
Get the path to a specified script file, respecting file extensions; this is a wrapper around $wgScri...
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
static makeExternalLink( $url, $text, $escape=true, $linktype='', $attribs=[], $title=null)
Make an external link.
getContext()
Gets the context this SpecialPage is executed in.
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
getRequest()
Get the WebRequest being used for this instance.
getOrderFields()
Override to squash the ORDER BY.
isCacheable()
Is the output of this query cacheable? Non-cacheable expensive pages will be disabled in miser mode a...
preprocessResults( $db, $res)
Pre-fill the link cache.
__construct( $name='LinkSearch')
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
execute( $par)
This is the actual workhorse.
Represents a page (or page fragment) title within MediaWiki.