If to use letters only the national alphabet (Russian, for example) in component options with identical quantity of blanks identical names will be generated.

Example:
- select component
- options:
Проба раз
Проба два
Проба три
- result in select field: only one item - "Проба три"

Solution: Rewrite _webform_safe_name function.
was:

function _webform_safe_name($name) {
  $new = drupal_strtolower(trim($name));
  $new = str_replace(' ', '_', $new);
  $new = preg_replace('/[^a-z0-9_]/', '', $new);
  // If the string contains NO safe characters, base64 encode the answer
  if ($new == '') {
    $new = base64_encode($name);
  }
  return $new;
}

became:

function _webform_safe_name($name) {
  $new = drupal_strtolower(trim($name));
  $new = str_replace(' ', '_', $new);
  $new = preg_replace('/[^a-z0-9_]/', '', $new);
  return $new.'_'.base64_encode($name);
}

or just:

function _webform_safe_name($name) {
  return base64_encode($name);
}

Comments

quicksketch’s picture

Status: Needs review » Fixed

Rather than further encrypt select values, I added the ability to manually enter key/value pairs. So keys may now be entered my_safe_key|Some crazy value.

dries’s picture

Status: Fixed » Closed (fixed)