From: Derick Alangi Date: Sat, 11 May 2019 14:55:34 +0000 (+0100) Subject: api: Remove deprecated `prepareUrlQuerySearchString()` from core X-Git-Tag: 1.34.0-rc.0~1713^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=170c973e0979a70529ed6a773c0a07e765151a86 api: Remove deprecated `prepareUrlQuerySearchString()` from core This method was deprecated in 1.33 and is no longer used. Usage ===== https://codesearch.wmflabs.org/search/?q=%5CbprepareUrlQuerySearchString%5Cb&i=nope&files=&repos= Bug: T220656 Change-Id: I15a476438f3a579db41a43658e13b6ddc4fc62d4 --- diff --git a/RELEASE-NOTES-1.34 b/RELEASE-NOTES-1.34 index 06e1bde7c3..8607e4afd3 100644 --- a/RELEASE-NOTES-1.34 +++ b/RELEASE-NOTES-1.34 @@ -151,6 +151,8 @@ because of Phabricator reports. * OutputPage::getModuleScripts(), ParserOutput::getModuleScripts(), deprecated in 1.33, have been removed. * User::getPasswordValidity(), deprecated in 1.33, has been removed. +* ApiQueryBase::prepareUrlQuerySearchString(), deprecated in 1.33, has been + removed. * … === Deprecations in 1.34 === diff --git a/includes/api/ApiQueryBase.php b/includes/api/ApiQueryBase.php index d955b56d03..122e02fec7 100644 --- a/includes/api/ApiQueryBase.php +++ b/includes/api/ApiQueryBase.php @@ -423,35 +423,6 @@ abstract class ApiQueryBase extends ApiBase { return Hooks::run( 'ApiQueryBaseProcessRow', [ $this, $row, &$data, &$hookData ] ); } - /** - * @deprecated since 1.33, use LinkFilter::getQueryConditions() instead - * @param string|null $query - * @param string|null $protocol - * @return null|string - */ - public function prepareUrlQuerySearchString( $query = null, $protocol = null ) { - wfDeprecated( __METHOD__, '1.33' ); - $db = $this->getDB(); - if ( $query !== null && $query !== '' ) { - if ( is_null( $protocol ) ) { - $protocol = 'http://'; - } - - $likeQuery = LinkFilter::makeLikeArray( $query, $protocol ); - if ( !$likeQuery ) { - $this->dieWithError( 'apierror-badquery' ); - } - - $likeQuery = LinkFilter::keepOneWildcard( $likeQuery ); - - return 'el_index ' . $db->buildLike( $likeQuery ); - } elseif ( !is_null( $protocol ) ) { - return 'el_index ' . $db->buildLike( "$protocol", $db->anyString() ); - } - - return null; - } - /** * Filters hidden users (where the user doesn't have the right to view them) * Also adds relevant block information