From 9db190c7e736ec8d063187d4241b59feaf7dc2d1 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 22 Jun 2011 11:28:20 +0200 Subject: update to MediaWiki 1.17.0 --- includes/specials/SpecialLinkSearch.php | 41 ++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 11 deletions(-) (limited to 'includes/specials/SpecialLinkSearch.php') diff --git a/includes/specials/SpecialLinkSearch.php b/includes/specials/SpecialLinkSearch.php index 70b2257a..9dee9d5a 100644 --- a/includes/specials/SpecialLinkSearch.php +++ b/includes/specials/SpecialLinkSearch.php @@ -1,11 +1,27 @@ getVal( 'target', $par ); $namespace = $GLOBALS['wgRequest']->getIntorNull( 'namespace', null ); @@ -44,19 +60,18 @@ function wfSpecialLinkSearch( $par ) { $protocol = ''; } - $wgOut->allowClickjacking(); - $self = Title::makeTitle( NS_SPECIAL, 'Linksearch' ); - + + $wgOut->allowClickjacking(); $wgOut->addWikiMsg( 'linksearch-text', '' . $wgLang->commaList( $wgUrlProtocols ) . '' ); - $s = Xml::openElement( 'form', array( 'id' => 'mw-linksearch-form', 'method' => 'get', 'action' => $GLOBALS['wgScript'] ) ) . - Xml::hidden( 'title', $self->getPrefixedDbKey() ) . + $s = Xml::openElement( 'form', array( 'id' => 'mw-linksearch-form', 'method' => 'get', 'action' => $GLOBALS['wgScript'] ) ) . + Html::hidden( 'title', $self->getPrefixedDbKey() ) . '
' . Xml::element( 'legend', array(), wfMsg( 'linksearch' ) ) . Xml::inputLabel( wfMsg( 'linksearch-pat' ), 'target', 'target', 50, $target ) . ' '; if ( !$wgMiserMode ) { $s .= Xml::label( wfMsg( 'linksearch-ns' ), 'namespace' ) . ' ' . - XML::namespaceSelector( $namespace, '' ); + Xml::namespaceSelector( $namespace, '' ); } $s .= Xml::submitButton( wfMsg( 'linksearch-ok' ) ) . '
' . @@ -73,6 +88,9 @@ function wfSpecialLinkSearch( $par ) { } } +/** + * @ingroup SpecialPage + */ class LinkSearchPage extends QueryPage { function setParams( $params ) { $this->mQuery = $params['query']; @@ -98,8 +116,9 @@ class LinkSearchPage extends QueryPage { $field = 'el_index'; $rv = LinkFilter::makeLikeArray( $query , $prot ); if ($rv === false) { - //makeLike doesn't handle wildcard in IP, so we'll have to munge here. + // LinkFilter doesn't handle wildcard in IP, so we'll have to munge here. if (preg_match('/^(:?[0-9]{1,3}\.)+\*\s*$|^(:?[0-9]{1,3}\.){3}[0-9]{1,3}:[0-9]*\*\s*$/', $query)) { + $dbr = wfGetDB( DB_SLAVE ); $rv = array( $prot . rtrim($query, " \t*"), $dbr->anyString() ); $field = 'el_to'; } @@ -162,7 +181,7 @@ class LinkSearchPage extends QueryPage { */ function doQuery( $offset, $limit, $shownavigation=true ) { global $wgOut; - list( $this->mMungedQuery, $clause ) = LinkSearchPage::mungeQuery( $this->mQuery, $this->mProt ); + list( $this->mMungedQuery, ) = LinkSearchPage::mungeQuery( $this->mQuery, $this->mProt ); if( $this->mMungedQuery === false ) { $wgOut->addWikiMsg( 'linksearch-error' ); } else { -- cgit v1.2.3-54-g00ecf