Fixing constant SORT_SORT_LOCALE_STRING

1.9.x
Julio Montoya 11 years ago
parent 1be585d918
commit b7708be08a
  1. 3
      main/inc/lib/internationalization.lib.php
  2. 4
      main/inc/lib/internationalization_internal.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;

@ -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;

Loading…
Cancel
Save