リビジョン | a33db83e25f27a1b862e87da1133dbf9240b5815 (tree) |
---|---|
日時 | 2016-11-08 03:03:28 |
作者 | umorigu <umorigu@gmai...> |
コミッター | umorigu |
BugTrack/2108 Use case insensitive index chars for page list
@@ -1,8 +1,8 @@ | ||
1 | 1 | <?php |
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone. |
3 | -// $Id: func.php,v 1.104 2011/01/25 15:01:01 henoheno Exp $ | |
4 | -// Copyright (C) | |
5 | -// 2002-2006 PukiWiki Developers Team | |
3 | +// func.php | |
4 | +// Copyright | |
5 | +// 2002-2016 PukiWiki Development Team | |
6 | 6 | // 2001-2002 Originally written by yu-ji |
7 | 7 | // License: GPL v2 or (at your option) any later version |
8 | 8 | // |
@@ -383,7 +383,7 @@ function page_list($pages, $cmd = 'read', $withfilename = FALSE) | ||
383 | 383 | // WARNING: Japanese code hard-wired |
384 | 384 | if($pagereading_enable) { |
385 | 385 | if(mb_ereg('^([A-Za-z])', mb_convert_kana($page, 'a'), $matches)) { |
386 | - $head = $matches[1]; | |
386 | + $head = strtoupper($matches[1]); | |
387 | 387 | } elseif (isset($readings[$page]) && mb_ereg('^([ァ-ヶ])', $readings[$page], $matches)) { // here |
388 | 388 | $head = $matches[1]; |
389 | 389 | } elseif (mb_ereg('^[ -~]|[^ぁ-ん亜-熙]', $page)) { // and here |
@@ -392,13 +392,13 @@ function page_list($pages, $cmd = 'read', $withfilename = FALSE) | ||
392 | 392 | $head = $other; |
393 | 393 | } |
394 | 394 | } else { |
395 | - $head = (preg_match('/^([A-Za-z])/', $page, $matches)) ? $matches[1] : | |
395 | + $head = (preg_match('/^([A-Za-z])/', $page, $matches)) ? strtoupper($matches[1]) : | |
396 | 396 | (preg_match('/^([ -~])/', $page) ? $symbol : $other); |
397 | 397 | } |
398 | 398 | |
399 | 399 | $list[$head][$page] = $str; |
400 | 400 | } |
401 | - ksort($list, SORT_STRING); | |
401 | + uksort($pages, 'strnatcmp'); | |
402 | 402 | |
403 | 403 | $cnt = 0; |
404 | 404 | $arr_index = array(); |
@@ -788,4 +788,3 @@ if (! function_exists('sha1')) { | ||
788 | 788 | } |
789 | 789 | } |
790 | 790 | } |
791 | - |