Browse Source

Avoid one more headache and use str_replace to add the tabindex

Signed-off-by: Suki <[email protected]>
Suki 10 năm trước cách đây
mục cha
commit
ff28c6b050
1 tập tin đã thay đổi với 1 bổ sung5 xóa
  1. 1 5
      Themes/default/Register.template.php

+ 1 - 5
Themes/default/Register.template.php

@@ -183,11 +183,7 @@ function template_registration_form()
 							<strong', !empty($field['is_error']) ? ' style="color: red;"' : '', '>', $field['name'], ':</strong>
 							<span class="smalltext">', $field['desc'], '</span>
 						</dt>
-						<dd>', preg_replace_callback('~<(input|select|textarea) ~', create_function('$matches', '
-							global $context;
-							return \'<\' . $matches[1] . \' tabindex="\' . $context[\'tabindex\']++ . \'"\';
-						')
-					, $field['input_html']), '</dd>';
+						<dd>', str_replace('name="', 'tabindex="' . $context['tabindex']++ .'" name="', $field['input_html']), '</dd>';
 
 		echo '
 					</dl>';