Commit c4c341ca authored by ron_s's avatar ron_s Committed by joseph.olstad

Issue #2989181 by ron_s: Double brackets filter error

parent cb4aa587
......@@ -140,6 +140,16 @@ function media_wysiwyg_token_to_markup($match, $wysiwyg = FALSE, $langcode = NUL
$match = str_replace("]]", "", $match);
$tag = $match[0];
// Drupal modules with email support often include site name in the subject line
// wrapped in brackets. With a token, this is rendered as "[[site:name]]". Such a
// format will cause a conflict with media_wysiwyg, which is looking for the same.
if (module_exists('token_filter')) {
$token_filter = _token_filter_filter_tokens('[' . $tag . ']', '', '', $langcode, NULL, NULL);
if ($token_filter != '[' . $tag . ']') {
return '[[' . $tag . ']]';
}
}
try {
if (!is_string($tag)) {
throw new Exception('Unable to find matching tag');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment