As interim solution to an issue in JavaScript, I changed the User module code, to disallow single quotation mark. I changed the following line.
if (preg_match('/[^\x{80}-\x{F7} a-z0-9@_.\'-]/i', $name)) {
After my edit, it becomes as follows.
if (preg_match('/[^\x{80}-\x{F7} a-z0-9@_.-]/i', $name)) {
One of our senior Drupal developers said that this is not an acceptable solution because it could open up the site to serious security risks and it could potentially lead to a security flaw around form injection.
I do not understand why that could happen. Can anyone explain me why?
PS. I understand that this will get overwritten on Drupal update. This was to temporarily prevent serious bug that is blocking the whole page from functioning.