fix privacy issue with similar person matcher

The condition to show only person from same center had no precedence with
name and firstname string.
This commit is contained in:
Julien Fastré 2018-07-08 17:15:58 +02:00
parent 5acfbd0cf1
commit 318d93c456

View File

@ -70,10 +70,12 @@ class SimilarPersonMatcher
);
$dql = 'SELECT p from ChillPersonBundle:Person p WHERE'
. ' UNACCENT(LOWER(p.firstName)) LIKE UNACCENT(LOWER(:firstName))'
. ' OR UNACCENT(LOWER(p.lastName)) LIKE UNACCENT(LOWER(:lastName))'
. ' OR UNACCENT(LOWER(p.firstName)) LIKE UNACCENT(LOWER(:lastName))'
. ' OR UNACCENT(LOWER(p.lastName)) LIKE UNACCENT(LOWER(:firstName))'
. ' ('
. ' UNACCENT(LOWER(p.firstName)) LIKE UNACCENT(LOWER(:firstName)) '
. ' OR UNACCENT(LOWER(p.lastName)) LIKE UNACCENT(LOWER(:lastName)) '
. ' OR UNACCENT(LOWER(p.firstName)) LIKE UNACCENT(LOWER(:lastName)) '
. ' OR UNACCENT(LOWER(p.lastName)) LIKE UNACCENT(LOWER(:firstName)) '
. ' ) '
. ' AND p.center IN (:centers)';
$query =