浏览代码

Fixing constant SORT_SORT_LOCALE_STRING

Julio Montoya 11 年之前
父节点
当前提交
b7708be08a
共有 2 个文件被更改,包括 3 次插入4 次删除
  1. 1 2
      main/inc/lib/internationalization.lib.php
  2. 2 2
      main/inc/lib/internationalization_internal.lib.php

+ 1 - 2
main/inc/lib/internationalization.lib.php

@@ -3360,8 +3360,7 @@ function api_sort(&$array, $sort_flag = SORT_REGULAR, $language = null, $encodin
             if (api_is_utf8($encoding)) {
                 $sort_flag = ($sort_flag == SORT_LOCALE_STRING) ? SORT_STRING : $sort_flag;
                 return collator_sort($collator, $array, _api_get_collator_sort_flag($sort_flag));
-            }
-            elseif ($sort_flag == SORT_STRING || $sort_flag == SORT_LOCALE_STRING) {
+            } elseif ($sort_flag == SORT_STRING || $sort_flag == SORT_LOCALE_STRING) {
                 global $_api_collator, $_api_encoding;
                 $_api_collator = $collator;
                 $_api_encoding = $encoding;

+ 2 - 2
main/inc/lib/internationalization_internal.lib.php

@@ -817,14 +817,14 @@ function _api_strnatcasercmp($string1, $string2) {
 }
 
 /**
- * A fuction that translates sorting flag constants from php core to correspondent constants from intl extension.
+ * A function that translates sorting flag constants from php core to correspondent constants from intl extension.
  * @param int $sort_flag (optional)		Sorting modifier flag as it is defined for php core. The default value is SORT_REGULAR.
  * @return int							Retturns the corresponding sorting modifier flag as it is defined in intl php-extension.
  */
 function _api_get_collator_sort_flag($sort_flag = SORT_REGULAR) {
     switch ($sort_flag) {
         case SORT_STRING:
-        case SORT_SORT_LOCALE_STRING:
+        case SORT_LOCALE_STRING:
             return Collator::SORT_STRING;
         case SORT_NUMERIC:
             return Collator::SORT_NUMERIC;