Doesn't it have to array_merge of `attr` element?
`array_merge(array('attr' => array('pattern' => $pattern)), array('attr' => array('class' => 'form-input')))` gets `array('attr' => ('class' => 'form-input'))`, guessed pattern is gone, which is breaking BC.