The following code,

// Strip out empty tags added by WYSIWYG editors if needed.
$confirmation = strlen(trim(strip_tags($vars['node']->webform['confirmation']))) ? $vars['node']->webform['confirmation'] : '';

stips everything what looks like a tag, if then there is no text left the confirmation message will be set to an empty string.

However, some input formats like the PHP format use code delimiters that look like tags ( ... ) and those will get stripped as well.

Later on the check_markup call is done, where the PHP processing should find place, but it receives an empty string instead of the PHP code.

Proposed solution: reverse the order of the strip_tags check and the check_markup, see code below.

/**
 * Prepare for theming of the webform submission confirmation.
 */
function template_preprocess_webform_confirmation(&$vars) {
  $confirmation = check_markup($vars['node']->webform['confirmation'], $vars['node']->webform['confirmation_format'], FALSE);
  // Strip out empty tags added by WYSIWYG editors if needed.
  $vars['confirmation_message'] = strlen(trim(strip_tags($confirmation))) ? $confirmation : '';
}

Comments

quicksketch’s picture

Status: Active » Fixed
StatusFileSize
new1.01 KB

Thanks, makes perfect sense to me. Committed attached patch.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.