LafColITS / moodle-local_ldap

Various synchronization scripts between Moodle and LDAP directories (see https://tracker.moodle.org/browse/MDL-25011 )
9 stars 7 forks source link

ldap search failed with filters containing parenthesis #9

Closed cperves closed 6 years ago

cperves commented 6 years ago

Hello, I had a trouble with filters on this plugin in its version moodle_3.1_Stable while executing \local_ldap\task\attribute_sync_task if cohortname passed to get_users_having_attribute_value contains parenthesis ldap filter failed I correct the trouble by replacing escaping these parenthesis on line 529 of /local/ldap/localib.php:

'='.str_replace(')','\\29',str_replace('(','\\28',ldap_addslashes($attributevalue))).'))';

Hope this will be usefull Regards, Céline

mackensen commented 6 years ago

@cperves thanks for the report! I've confirmed the issue and I'm implementing a fix. I'm also going to report the issue to the core Moodle project as the problem is present in the ldap_addslashes() function.

cperves commented 6 years ago

thank you! Regards