summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2015-03-27 07:53:47 (GMT)
committerAleksander Machniak <machniak@kolabsys.com>2015-03-27 07:53:47 (GMT)
commitde82f0ccedc7be62d14377ce04f44d38c5adfb61 (patch)
tree05038b4a64118c5fe239d365668119903a95babe
parentad8678b41c9c3566e18caf2bffb9f08d9d6fbafd (diff)
downloadkolab-wap-de82f0ccedc7be62d14377ce04f44d38c5adfb61.tar.gz
Fix object type scoring mechanism issue with locales that use non-standard decimal separator, i.e. a comma (#4799)kolab-webadmin-3.1
Conflicts: lib/kolab_api_service.php
-rw-r--r--lib/kolab_api_service.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/kolab_api_service.php b/lib/kolab_api_service.php
index 858e643..d0d4f26 100644
--- a/lib/kolab_api_service.php
+++ b/lib/kolab_api_service.php
@@ -201,6 +201,9 @@ abstract class kolab_api_service
$elem_score .= ':' . $elem_keys_score . ':' . $elem_values_score;
+ // fix decimal separator for score_compare() and consistent log (#4799)
+ $elem_score = str_replace(',', '.', $elem_score);
+
// Log::trace("\$object_class not in \$ref_class (" . $elem['key'] . "): " . implode(", ", $_object_class));
// Log::trace("\$ref_class not in \$object_class (" . $elem['key'] . "): " . implode(", ", $_ref_class));
Log::trace("Score for $object_name type " . $elem['name'] . ": " . $elem_score . " (" . $commonalities . "/" . $differences . ")");