From: Max Semenik Date: Sat, 12 Aug 2017 02:46:54 +0000 (-0700) Subject: Remove deprecated MagicWord::replaceMultiple() X-Git-Tag: 1.31.0-rc.0~2396 X-Git-Url: http://git.cyclocoop.org/%22%2C%20generer_url_ecrire%28?a=commitdiff_plain;h=34eec68649ff06b1625e1f8e9afccf76b765e3c3;p=lhc%2Fweb%2Fwiklou.git Remove deprecated MagicWord::replaceMultiple() wfDeprecated since 1.25, not used anywhere. Change-Id: I09fd362a3d795328ffc12572025702ef9b951378 --- diff --git a/RELEASE-NOTES-1.30 b/RELEASE-NOTES-1.30 index e8d9b48a3b..90d6cd9bdc 100644 --- a/RELEASE-NOTES-1.30 +++ b/RELEASE-NOTES-1.30 @@ -164,6 +164,7 @@ changes to languages because of Phabricator reports. nothing and is deprecated. * mw.util.escapeId() was deprecated, use escapeIdForAttribute() or escapeIdForLink(). +* MagicWord::replaceMultiple() (deprecated in 1.25) was removed. == Compatibility == MediaWiki 1.30 requires PHP 5.5.9 or later. There is experimental support for diff --git a/includes/MagicWord.php b/includes/MagicWord.php index e70b8cec5c..6e7799a308 100644 --- a/includes/MagicWord.php +++ b/includes/MagicWord.php @@ -646,33 +646,6 @@ class MagicWord { return $this->mModified; } - /** - * $magicarr is an associative array of (magic word ID => replacement) - * This method uses the php feature to do several replacements at the same time, - * thereby gaining some efficiency. The result is placed in the out variable - * $result. The return value is true if something was replaced. - * @deprecated since 1.25, unused - * - * @param array $magicarr - * @param string $subject - * @param string &$result - * - * @return bool - */ - public function replaceMultiple( $magicarr, $subject, &$result ) { - wfDeprecated( __METHOD__, '1.25' ); - $search = []; - $replace = []; - foreach ( $magicarr as $id => $replacement ) { - $mw = self::get( $id ); - $search[] = $mw->getRegex(); - $replace[] = $replacement; - } - - $result = preg_replace( $search, $replace, $subject ); - return $result !== $subject; - } - /** * Adds all the synonyms of this MagicWord to an array, to allow quick * lookup in a list of magic words