Whitespace in user folder

Several old users in our domain have whitespaces like "name surname" in their sAMAccountName. When one of these users is logging in to OwnCloud, the attribute is normalized (substitutes whitespaces with underscores) in the database, but the user folder on my server is named with the whitespace.

Steps to reproduce
1. Create AD user with whitespace in sAMAccountName
2. Log in to OwnCloud
3. Check file path on server

Expected behaviour
filepath should be normalized and must not contain whitespaces

Actual behaviour
filepath has whitespaces in it

Server configuration
Operating system: Ubuntu 14.04.5
Web server:apache 2.4.7
Database: mysql 5.6.33
PHP version: 5.5.9
ownCloud version (see ownCloud admin page): 9.1.3
Updated from an older ownCloud or fresh install: fresh install
Special configuration (external storage, external authentication, reverse proxy, server-side-encryption):

  • reverse proxy with nginx
  • server-side-encryption enabled
  • ldap backend

Integrity status for oC9+

Technical information
The following list covers which files have failed the integrity check. Please read
the previous linked documentation to learn more about the errors and how to fix
- Application to check
		- Exception
		- App not found
Raw output
    [Application to check] => Array
            [EXCEPTION] => Array
                    [class] => Exception
                    [message] => App not found


Could someone link the code where oC determines the users file path and creates it? I rgrepped core but didnt find the lines of code.

Thank you!