Html Options Markup values shown as filtered text for anonymous user during display

Created on 11 June 2015, over 9 years ago
Updated 21 April 2023, over 1 year ago

Hi,

This is the first time I am using this module and I found that everything works fine, except for anonymous users.

After a little debugging, I found a patch and fixed it by commenting filter_access() call from webform_optionsmarkup_get_filter_format().
Hence the updated code is ::

/**
 * Determines which text format should be used for rendering the field.
 *
 * @return string
 *   The text format machine name to use.
 */
function webform_optionsmarkup_get_filter_format() {
  $format_id = &drupal_static(__FUNCTION__);

  if (!isset($format_id)) {
    $format_id = variable_get('optionsmarkup_input_format', 'filtered_html');
    if (empty($format_id)) {
      $format_id = filter_fallback_format();
    }
    $format = filter_format_load($format_id);

    // This doesn't make sense. If you are an editior you will see the
    // correct markup, but as anonymous you will see the html escaped version
    //if (!filter_access($format)) {
    //  $format_id = NULL;
    //  return $format_id;
    //}
  }

  return $format_id;
}

Please find the attached updated module with patch in .zip format.

🐛 Bug report
Status

Needs work

Version

2.1

Component

Code

Created by

🇲🇽Mexico monojnath

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024