diff --git a/RELEASE-NOTES-1.32 b/RELEASE-NOTES-1.32 index b1192d086d4..62e3df88bf9 100644 --- a/RELEASE-NOTES-1.32 +++ b/RELEASE-NOTES-1.32 @@ -111,6 +111,7 @@ because of Phabricator reports. * Overriding SearchEngine::{searchText,searchTitle,searchArchiveTitle} in extending classes is deprecated. Extend related doSearch* methods instead. +* CollationFa has been removed completely as it's not needed anymore === Other changes in 1.32 === * Soft hyphens (U+00AD) are now automatically removed from titles; these diff --git a/autoload.php b/autoload.php index c55b931235e..9e876db955f 100644 --- a/autoload.php +++ b/autoload.php @@ -280,7 +280,6 @@ $wgAutoloadLocalClasses = [ 'Collation' => __DIR__ . '/includes/collation/Collation.php', 'CollationCkb' => __DIR__ . '/includes/collation/CollationCkb.php', 'CollationEt' => __DIR__ . '/includes/collation/CollationEt.php', - 'CollationFa' => __DIR__ . '/includes/collation/CollationFa.php', 'CommandLineInc' => __DIR__ . '/maintenance/commandLine.inc', 'CommandLineInstaller' => __DIR__ . '/maintenance/install.php', 'CommentStore' => __DIR__ . '/includes/CommentStore.php', diff --git a/includes/collation/Collation.php b/includes/collation/Collation.php index 30cae5a8833..f52dcae017c 100644 --- a/includes/collation/Collation.php +++ b/includes/collation/Collation.php @@ -63,8 +63,6 @@ abstract class Collation { return new CollationCkb; case 'xx-uca-et': return new CollationEt; - case 'xx-uca-fa': - return new CollationFa; case 'uppercase-ab': return new AbkhazUppercaseCollation; case 'uppercase-ba': diff --git a/includes/collation/CollationFa.php b/includes/collation/CollationFa.php deleted file mode 100644 index 7410886ecad..00000000000 --- a/includes/collation/CollationFa.php +++ /dev/null @@ -1,60 +0,0 @@ - U+0623 ARABIC LETTER ALEF WITH HAMZA ABOVE - "\xd8\xa7" => "\xd8\xa3", - // U+0648 ARABIC LETTER WAW => U+0649 ARABIC LETTER ALEF MAKSURA - "\xd9\x88" => "\xd9\x89", - // U+0672 ARABIC LETTER ALEF WITH WAVY HAMZA ABOVE => U+F3001 (private use area) - "\xd9\xb2" => "\xF3\xB3\x80\x81", - // U+0673 ARABIC LETTER ALEF WITH WAVY HAMZA BELOW => U+F3002 (private use area) - "\xd9\xb3" => "\xF3\xB3\x80\x82", - ]; - - public function __construct() { - parent::__construct( 'fa' ); - } - - public function getSortKey( $string ) { - $modified = strtr( $string, $this->override ); - return parent::getSortKey( $modified ); - } - - public function getFirstLetter( $string ) { - if ( isset( $this->override[substr( $string, 0, 2 )] ) ) { - return substr( $string, 0, 2 ); - } - return parent::getFirstLetter( $string ); - } -} diff --git a/tests/phpunit/includes/collation/CollationFaTest.php b/tests/phpunit/includes/collation/CollationFaTest.php deleted file mode 100644 index f7455419ad9..00000000000 --- a/tests/phpunit/includes/collation/CollationFaTest.php +++ /dev/null @@ -1,55 +0,0 @@ -checkPHPExtension( 'intl' ); - } - - /** - * @dataProvider provideGetFirstLetter - */ - public function testGetFirstLetter( $letter, $str ) { - $coll = new CollationFa; - $this->assertEquals( $letter, $coll->getFirstLetter( $str ), $str ); - } - - public function provideGetFirstLetter() { - return [ - [ - '۷', - '۷' - ], - [ - 'ا', - 'ا' - ], - [ - 'ا', - 'ایران' - ], - [ - 'ب', - 'برلین' - ], - [ - 'و', - 'واو' - ], - [ "\xd8\xa7", "\xd8\xa7Foo" ], - [ "\xd9\x88", "\xd9\x88Foo" ], - [ "\xd9\xb2", "\xd9\xb2Foo" ], - [ "\xd9\xb3", "\xd9\xb3Foo" ], - ]; - } -}