Codoforum related discussions
Signatures allow HTML?

I've been testing out Codoforum and discover something I found strange.

I tried to create a signature using markdown or bbCode, but when I save, I find that my signature is wrapped in p tags. Thankfully, signatures are apparently limited in what HTML can be posted (no script tags).

Are signatures supposed to be HTML? It seems inconsistent with the Markdown/bbCode used elsewhere.

UPDATE: On that same note, greater-than and less-than signs are being converted to < and > when in code tags, which is unpleasant. They are also inconsistent with the live preview.

I've been testing out Codoforum and discover something I found strange. I tried to create a signature using markdown or bbCode, but when I save, I find that my signature is wrapped in `p` tags. Thankfully, signatures are apparently limited in what HTML can be posted (no `script` tags). Are signatures supposed to be HTML? It seems inconsistent with the Markdown/bbCode used elsewhere. **UPDATE:** On that same note, greater-than and less-than signs are being converted to `<` and `>` when in code tags, which is unpleasant. They are also inconsistent with the live preview.
edited Nov 12 '14 at 4:14 am

Are signatures supposed to be HTML? It seems inconsistent with the Markdown/bbCode used elsewhere.

Using HTML for the signature makes it very easy to store it in the database.

UPDATE: On that same note, greater-than and less-than signs are being converted to < and > when in code tags, which is unpleasant. They are also inconsistent with the live preview.

Can you give us an example .
It seems like it is working fine, for eg.

<>

<hello>

PS: After checking it again, looks like it does not work with single backtick eg. &lt;
We will correct this in the soon to be released V2.5

&amp;gt;Are signatures supposed to be HTML? It seems inconsistent with the Markdown/bbCode used elsewhere. Using HTML for the signature makes it very easy to store it in the database. &amp;gt;UPDATE: On that same note, greater-than and less-than signs are being converted to &amp;lt; and &amp;gt; when in code tags, which is unpleasant. They are also inconsistent with the live preview. Can you give us an example . It seems like it is working fine, for eg. ``` &amp;lt;&amp;gt; ``` &amp;lt;hello&amp;gt; PS: After checking it again, looks like it does not work with single backtick eg. `&amp;lt;` We will correct this in the soon to be released V2.5
edited Nov 12 '14 at 4:11 am

Using HTML for the signature makes it very easy to store it in the database.

I see. I guess I would prefer a system like what posts use, where it stores both the source markdown for editing and the rendered HTML for display in the database. Maybe I'll have to write a plugin for that.

Incidentally, do you know or is there somewhere I can find what subset of HTML is allowed for signatures?

PS: After checking it again, looks like it does not work with single backtick eg. &lt;
We will correct this in the soon to be released V2.5

Glad to hear!

&amp;gt;Using HTML for the signature makes it very easy to store it in the database. I see. I guess I would prefer a system like what posts use, where it stores both the source markdown for editing and the rendered HTML for display in the database. Maybe I&#039;ll have to write a plugin for that. Incidentally, do you know or is there somewhere I can find what subset of HTML is allowed for signatures? &amp;gt;PS: After checking it again, looks like it does not work with single backtick eg. `&amp;lt;` &amp;gt;We will correct this in the soon to be released V2.5 Glad to hear!
edited Nov 12 '14 at 4:33 am

The signature as well the posts both are filtered using the same whitelist.

Below is the list of supported tags:

    'p' => array('style', 'class', 'align'),
    'div' => array('style', 'class', 'align'),
    'span' => array('style', 'class'),
    'br' => array('style', 'class'),
    'hr' => array('style', 'class'),
    'h1' => array('style', 'class'),
    'h2' => array('style', 'class'),
    'h3' => array('style', 'class'),
    'h4' => array('style', 'class'),
    'h5' => array('style', 'class'),
    'h6' => array('style', 'class'),
    'strong' => array('style', 'class'),
    'em' => array('style', 'class'),
    'i' => array('style', 'class'),
    'b' => array('style', 'class'),
    'u' => array('style', 'class'),
    'strike' => array('style', 'class'),
    'del' => array('style', 'class'),
    'ol' => array('style', 'class'),
    'ul' => array('style', 'class'),
    'li' => array('style', 'class'),
    'code' => array('style', 'class'),
    'pre' => array('style', 'class'),
    'sup' => array('style', 'class'),
    'sub' => array('style', 'class'),
    'marquee' => array('style', 'class'),
    // Took out 'rel' and 'title', because we're using those below
    'a' => array('style', 'class', 'href', 'target'),
    'img' => array('style', 'class', 'src', 'height',
        'width', 'alt', 'longdesc', 'title',
        'hspace', 'vspace'),
    'table' => array('style', 'class', 'border-collapse',
        'cellspacing', 'cellpadding'),
    'thead' => array('style', 'class'),
    'tbody' => array('style', 'class'),
    'tfoot' => array('style', 'class'),
    'tr' => array('style', 'class'),
    'td' => array('style', 'class',
        'colspan', 'rowspan'),
    'th' => array('style', 'class', 'scope', 'colspan',
        'rowspan'),
    'q' => array('style', 'class', 'cite'),
    'cite' => array('style', 'class'),
    'abbr' => array('style', 'class'),
    'blockquote' => array('style', 'class'),
    // Stripped out
    'body' => array()//,

I guess I would prefer a system like what posts use, where it stores both the source markdown for editing and the rendered HTML for display in the database

If we get more requests for this, we will definitely add it.

The signature as well the posts both are filtered using the same whitelist. Below is the list of supported tags: &#039;p&#039; =&amp;gt; array(&#039;style&#039;, &#039;class&#039;, &#039;align&#039;), &#039;div&#039; =&amp;gt; array(&#039;style&#039;, &#039;class&#039;, &#039;align&#039;), &#039;span&#039; =&amp;gt; array(&#039;style&#039;, &#039;class&#039;), &#039;br&#039; =&amp;gt; array(&#039;style&#039;, &#039;class&#039;), &#039;hr&#039; =&amp;gt; array(&#039;style&#039;, &#039;class&#039;), &#039;h1&#039; =&amp;gt; array(&#039;style&#039;, &#039;class&#039;), &#039;h2&#039; =&amp;gt; array(&#039;style&#039;, &#039;class&#039;), &#039;h3&#039; =&amp;gt; array(&#039;style&#039;, &#039;class&#039;), &#039;h4&#039; =&amp;gt; array(&#039;style&#039;, &#039;class&#039;), &#039;h5&#039; =&amp;gt; array(&#039;style&#039;, &#039;class&#039;), &#039;h6&#039; =&amp;gt; array(&#039;style&#039;, &#039;class&#039;), &#039;strong&#039; =&amp;gt; array(&#039;style&#039;, &#039;class&#039;), &#039;em&#039; =&amp;gt; array(&#039;style&#039;, &#039;class&#039;), &#039;i&#039; =&amp;gt; array(&#039;style&#039;, &#039;class&#039;), &#039;b&#039; =&amp;gt; array(&#039;style&#039;, &#039;class&#039;), &#039;u&#039; =&amp;gt; array(&#039;style&#039;, &#039;class&#039;), &#039;strike&#039; =&amp;gt; array(&#039;style&#039;, &#039;class&#039;), &#039;del&#039; =&amp;gt; array(&#039;style&#039;, &#039;class&#039;), &#039;ol&#039; =&amp;gt; array(&#039;style&#039;, &#039;class&#039;), &#039;ul&#039; =&amp;gt; array(&#039;style&#039;, &#039;class&#039;), &#039;li&#039; =&amp;gt; array(&#039;style&#039;, &#039;class&#039;), &#039;code&#039; =&amp;gt; array(&#039;style&#039;, &#039;class&#039;), &#039;pre&#039; =&amp;gt; array(&#039;style&#039;, &#039;class&#039;), &#039;sup&#039; =&amp;gt; array(&#039;style&#039;, &#039;class&#039;), &#039;sub&#039; =&amp;gt; array(&#039;style&#039;, &#039;class&#039;), &#039;marquee&#039; =&amp;gt; array(&#039;style&#039;, &#039;class&#039;), // Took out &#039;rel&#039; and &#039;title&#039;, because we&#039;re using those below &#039;a&#039; =&amp;gt; array(&#039;style&#039;, &#039;class&#039;, &#039;href&#039;, &#039;target&#039;), &#039;img&#039; =&amp;gt; array(&#039;style&#039;, &#039;class&#039;, &#039;src&#039;, &#039;height&#039;, &#039;width&#039;, &#039;alt&#039;, &#039;longdesc&#039;, &#039;title&#039;, &#039;hspace&#039;, &#039;vspace&#039;), &#039;table&#039; =&amp;gt; array(&#039;style&#039;, &#039;class&#039;, &#039;border-collapse&#039;, &#039;cellspacing&#039;, &#039;cellpadding&#039;), &#039;thead&#039; =&amp;gt; array(&#039;style&#039;, &#039;class&#039;), &#039;tbody&#039; =&amp;gt; array(&#039;style&#039;, &#039;class&#039;), &#039;tfoot&#039; =&amp;gt; array(&#039;style&#039;, &#039;class&#039;), &#039;tr&#039; =&amp;gt; array(&#039;style&#039;, &#039;class&#039;), &#039;td&#039; =&amp;gt; array(&#039;style&#039;, &#039;class&#039;, &#039;colspan&#039;, &#039;rowspan&#039;), &#039;th&#039; =&amp;gt; array(&#039;style&#039;, &#039;class&#039;, &#039;scope&#039;, &#039;colspan&#039;, &#039;rowspan&#039;), &#039;q&#039; =&amp;gt; array(&#039;style&#039;, &#039;class&#039;, &#039;cite&#039;), &#039;cite&#039; =&amp;gt; array(&#039;style&#039;, &#039;class&#039;), &#039;abbr&#039; =&amp;gt; array(&#039;style&#039;, &#039;class&#039;), &#039;blockquote&#039; =&amp;gt; array(&#039;style&#039;, &#039;class&#039;), // Stripped out &#039;body&#039; =&amp;gt; array()//, &amp;gt;I guess I would prefer a system like what posts use, where it stores both the source markdown for editing and the rendered HTML for display in the database If we get more requests for this, we will definitely add it.
edited Nov 12 '14 at 7:46 am

Yikes! Unrestricted style attributes. Unfortunately, I could see that being misused.

<a href="http://example.com" style="display:block;position:fixed;background:white;left:0;top:0;right:0;bottom:0;z-index:999999;padding:1em;font-size:10em;" title="example.com " rel="nofollow">Click me!</a>

An invisible variation on that could be used in a click-jacking attack.

Yikes! Unrestricted style attributes. Unfortunately, I could see that being misused. ```` &amp;lt;a href=&quot;http://example.com&quot; style=&quot;display:block;position:fixed;background:white;left:0;top:0;right:0;bottom:0;z-index:999999;padding:1em;font-size:10em;&quot; title=&quot;example.com &quot; rel=&quot;nofollow&quot;&amp;gt;Click me!&amp;lt;/a&amp;gt; ```` An invisible variation on that could be used in a click-jacking attack.

Yes, you are right.

We noticed it right away when you posted the first message about HTML in signatures.
It has already been fixed in V2.5 , so you don't have to worry about that.

Yes, you are right. We noticed it right away when you posted the first message about HTML in signatures. It has already been fixed in V2.5 , so you don&#039;t have to worry about that.
277
5
2
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft