MDL-43430 enrol_ldap: Enrolment lost if member of group with parenthesis

As part of fixing MDL-43430, a typo has been detected in the
quoted alphanumeric characters (the '=' and '>' were transposed).
MDL-43430 enrol_ldap: Enrolment lost if member of group with parenthesis

The group names we get from ldap_find_user_groups() can contain invalid LDAP
filter characters. So we need to escape them for LDAP filter usage.
MDL-43430 enrol_ldap: Enrolment lost if member of group with parenthesis

While testing the fix, it was found that ldap_stripslashes() was broken and
using a deprecated PCRE patter modifier, so it's also been fixed.

Thanks to Damyon Wiese, some units tests have been added to cover
ldap_addslashes() and ldap_stripslashes().
MDL-47943 editor_atto: Save selection on mouseleave for Chrome
MDL-47174 events: new calendar event may have 0 timestart
Merge branch 'wip-MDL-47174-master' of git://github.com/marinaglancy/moodle
MDL-47922 tool_monitor: Update strings
MDL-47980 gradebook: add labels and legends missing from single view
MDL-48029 mod_forum: Check for subscription before enrolling
MDL-48083 dml: Empty buffers on forced rollback
MDL-48061 mod_forum: Correct variable name in HTML warning message
Merge branch 'MDL-48061-master-fixes' of https://github.com/andrewnicols/moodle
MDL-48061 mod_forum: posttext should concat
Merge branch 'MDL-48061-master-fixes' of https://github.com/andrewnicols/moodle
Merge branch 'wip_MDL-48083_m28_rollback' of git://github.com/skodak/moodle
Merge branch 'wip_master_mdl-43430' of https://github.com/iarenaza/moodle
MDL-43430 ldap: whitespace fix
MDL-47869 tool_monitor: Add sorting on event monitor pages
Merge branch 'MDL-47980-master' of git://github.com/jethac/moodle
MDL-47980 gradebook: fixed label for bulk insert select box