1.20.x locale.pages.inc locale_translate_edit_form_validate($form, &$form_state)

Validate string editing form submissions.

File

modules/locale/locale.pages.inc, line 352
Interface translation summary, editing and deletion user interfaces.

Code

function locale_translate_edit_form_validate($form, &$form_state) {
  require_once BACKDROP_ROOT . '/core/includes/locale.inc';

  foreach ($form_state['values']['translations'] as $key => $value) {
    if (!locale_string_is_safe($value)) {
      form_set_error('translations', t('The submitted string contains disallowed HTML: %string', array('%string' => $value)));
      watchdog('locale', 'Attempted submission of a translation string with disallowed HTML: %string', array('%string' => $value), WATCHDOG_WARNING);
    }
  }
}