In windows new line is "\r\n" so code in implementation hook_form_alter is incomplete:

now:

  $whitelist = explode("\n", $whitelist);
  if (in_array($form_id, $whitelist)) {

should be:

  $whitelist = explode("\n", $whitelist);
  // Remove "\r" in Windows and spaces.
  $whitelist = array_map('trim', $whitelist);
  if (in_array($form_id, $whitelist)) {

Comments

izhilin created an issue. See original summary.

imiksu’s picture

Status: Active » Needs work

We could make it onliner:

$whitelist = array_map('trim', explode("\n", $whitelist));
bhavikshah9’s picture

Status: Needs work » Needs review
StatusFileSize
new854 bytes

Thanks @izhilin for pointing it out.
Thanks @iMiksu for suggesting an update.

Here is the patch. Plain and simple.

imiksu’s picture

I'm not able to get a Windows machine for testing. Can @izhilin confirm if this patch works?