#2046 - PHP ERROR [64] Cannot redeclare ldap_escape() in sources/cns_ldap.php
| Identifier | #2046 |
|---|---|
| Issue type | Major issue (breaks an entire feature) |
| Title | PHP ERROR [64] Cannot redeclare ldap_escape() in sources/cns_ldap.php |
| Status | Completed |
| Handling member | PDStig |
| Addon | phpinfo |
| Description | My Host proider has forced an update from phpv 5.4 to 5.6 and now when a new user tries to Join I get the following error
An error has occurred PHP ERROR [64] Cannot redeclare ldap_escape() in sources/cns_ldap.php on line 66 (version: 9.0.20, PHP version: 5.6.13-hetz1, URL: /portal/pg/join/step3/index.php?redirect=http%3A%3Aslash%3A%3Aslash%3Afarsouthnet.com%3Aslash%3Aportal%3Aslash%3Apg%3Aslash%3Astart%3Aslash%3Aindex.php%3Fredirected%3D1) Here is the stack trace: The staff have been provided a ‘stack trace’ which may help them diagnose the problem. |
| Steps to reproduce | Run php 5.6 on the hosting server connect to Composr site click join fil in fields and when click sae on bottom it gives the error.
I can roll back to PHP 5.4 till 9th Oct 2015 then the change will be permanent and I will not be able to roll back.
Existing validated users can login fine |
| Additional information | running 9.0.20 |
| Funded? | No |
| Commits |
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".


Comments
PHP now defines its own ldap_escape function. This hotfix renames our function to avoid a naming conflict.
Seems php 5.6 has a built in function called ldap_escape, which was breaking the client authentication.
My workaround was to rename the function in the code.
All usage is confined to the source file cns_ldap.php. So I made a backup then edited the file and change all instances of:
ldap_escape
to
cns_ldap_escape
That Sorted out the issue and all is working fine.
Thanks for the files will update