[Piglit] [PATCH] Escape HTML output when generating test result pages.

Dylan Baker baker.dylan.c at gmail.com
Tue Oct 22 23:54:21 CEST 2013


On Tuesday, October 22, 2013 05:28:38 AM Paul Berry wrote:
> If a test generates output containing '<', '>', or '&', we need to
> HTML escape it so that the web browser doesn't interpret it as
> containing HTML tags.
> 
> While we're at it, go ahead and HTML escape the traceback and dmesg
> outputs too.
> ---
>  templates/test_result.mako | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/templates/test_result.mako b/templates/test_result.mako
> index b23fb8e..a2c749c 100644
> --- a/templates/test_result.mako
> +++ b/templates/test_result.mako
> @@ -31,7 +31,7 @@
>        <tr>
>          <td>Info</td>
>          <td>
> -          <pre>${info}</pre>
> +          <pre>${info | h}</pre>
>          </td>
>        </tr>
>        <tr>
> @@ -43,13 +43,13 @@
>        <tr>
>          <td>Traceback</td>
>          <td>
> -          <pre>${traceback}</pre>
> +          <pre>${traceback | h}</pre>
>          </td>
>        </tr>
>        <tr>
>          <td>dmesg</td>
>          <td>
> -          <pre>${dmesg}</pre>
> +          <pre>${dmesg | h}</pre>
>          </td>
>        </tr>
>      </table>

I had not idea mako had that feature, but it's dang useful

Reveiwed-by: Dylan Baker <baker.dylan.c at gmail.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20131022/f9178bdf/attachment.pgp>


More information about the Piglit mailing list