Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Whole lotta escaping going on!
I was testing the ability of Vanilla to display code examples (for use on a developer site), and so I tried using both BBCode and Markdown to achieve the proper affect. Vanilla doesn't yet support the BBCode [code] tag, and I looked in the BBCode.php code and found that not much of BBCode is supported at this point, so I turned to Markdown, which requires 4 spaces at the beginning of a line of preformatted code, so I did that.
It works well for preformatting the code, but the output I got looks like this:
So, it appears to be escaping the output of the left arrow bracket (<) twice. My first thought was that it may be escaping the output before saving to the database, which is not a good practice, but I've checked the database, and everything there is the raw input--great!
So, I took a look at the Markdown.php file and found the ProtectString() function, of which the only action it takes is to convert all instances of < to <. However, it appears that there are other functions in the application that apply to the output after this is run, so when those functions (I guess they're something similar to htmlentities()) are applied, it converts the < that Markdown created to &lt; and then sends it to the browser.
I found a similar function in BBCode.php, as well.
When I comment out the line of code that does this in the ProtectString() function, all output appears as expected.
It works well for preformatting the code, but the output I got looks like this:
<form action="POST">
So, it appears to be escaping the output of the left arrow bracket (<) twice. My first thought was that it may be escaping the output before saving to the database, which is not a good practice, but I've checked the database, and everything there is the raw input--great!
So, I took a look at the Markdown.php file and found the ProtectString() function, of which the only action it takes is to convert all instances of < to <. However, it appears that there are other functions in the application that apply to the output after this is run, so when those functions (I guess they're something similar to htmlentities()) are applied, it converts the < that Markdown created to &lt; and then sends it to the browser.
I found a similar function in BBCode.php, as well.
When I comment out the line of code that does this in the ProtectString() function, all output appears as expected.
0
This discussion has been closed.
Comments