summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2015-03-27 07:49:22 (GMT)
committerAleksander Machniak <machniak@kolabsys.com>2015-03-27 07:49:22 (GMT)
commit81684b443784c7f2adbe964c1eedf599aadcabe9 (patch)
tree2e4796a243c000c63e020c7b046d2673c67f1867
parent54e790c7b02bc926bc74f3a0ad14482f1892cd3e (diff)
downloadkolab-wap-81684b443784c7f2adbe964c1eedf599aadcabe9.tar.gz
Fix object type scoring mechanism issue with locales that use non-standard decimal separator, i.e. a comma (#4799)kolab-webadmin-3.2.7
-rw-r--r--lib/kolab_api_service.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/kolab_api_service.php b/lib/kolab_api_service.php
index e3c66c5..f19486a 100644
--- a/lib/kolab_api_service.php
+++ b/lib/kolab_api_service.php
@@ -197,6 +197,10 @@ 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);
+ $delta = str_replace(',', '.', $delta);
+
Log::trace("Score for $object_name type " . $elem['name'] . ": $elem_score ($commonalities/$differences/$delta)");
// Compare last and current element (object type) score