b81bbc126a
The character used as a preg_* delimter is the tilde (~) char, but this was not passed into the `preg_quote()` when taking the user input ($CFG->wwwroot). As a result, any site which uses a userdir fails to parse the regexp.