Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

[resolved] Class attribute in FAQ Stripped out

edited January 2017 in General Discussions
Hi Guys

Just trying to use a div with a class attribute in a FAQ but each time I save it the class is removed.

e.g.

<div class="embed-container"><iframe src='https://player.vimeo.com/video/1234567' frameborder='0' webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></div>

When I add the above code (class="embed-container") is stripped out!

How can I make sure class="embed-container" is not removed from my FAQ article?

Comments

  • You would have to alter it at the database level.
  • @ntozier

    Is there some code I can change that will prevent this from being filtered out of an FAQ?

    If you know which file it is I should be able to work out the rest.

    Thanks
  • I've found the fix for this item.

    In this file /include/class.format.php lines 234 - 244 there is some code the unsets unsupported classes.

    // Clean unexpected class values
            if (isset($attributes['class'])) {
                $classes = explode(' ', $attributes['class']);
                foreach ($classes as $i=>$a)
                    // Unset all unsupported style classes -- anything but M$
                    if (strpos($a, 'Mso') !== 0)
                        unset($classes[$i]);
                if ($classes)
                    $attributes['class'] = implode(' ', $classes);
                else
                    unset($attributes['class']);
            }

    All I needed to do was change the class name I used in my html to start with "Mso". Dont quite understand why they need to start with "Mso" but now my class is not removed from my FAQ.

    <div class="Mso-embed-container"><iframe src='https://player.vimeo.com/video/1234567' frameborder='0' webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></div>
  • @Wasca, after making the edits, you were able to complete your task that you needed help with? if so, may I close this thread? 
  • Yes I was able to complete my task. Go ahead and mark this as resolved.
This discussion has been closed.