修复update时会出错的问题。

master
落雨楓 5 years ago
parent d14fb19829
commit 79882a8393

2
.gitignore vendored

@ -0,0 +1,2 @@
LatinizeUrl.zip

@ -51,4 +51,5 @@ http://static-www.isekai.cn:8081/api/toolkit/asciiurl/hanzi2pinyin
### 使用首字母排列分类中的标题
```php
$wgCategoryCollation = 'latinize';
```
```
いい夢見てね

@ -25,6 +25,10 @@ class LatinizeCollation extends Collation {
}
public function getSortKey($string){
if(defined('MW_UPDATER')){
return $string;
}
$slug = Utils::getSlugByTitle($string);
if($slug){
return ucfirst($slug);
@ -34,6 +38,10 @@ class LatinizeCollation extends Collation {
}
public function getFirstLetter($string){
if(defined('MW_UPDATER')){
return mb_substr(0, 1, $string, 'UTF-8');
}
$slug = Utils::getSlugByTitle($string);
if($slug){
return strtoupper($slug[0]);

Loading…
Cancel
Save