Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checkstyle output needs to HTML-escape messages #72

Closed
gmazzap opened this issue Nov 3, 2021 · 0 comments
Closed

Checkstyle output needs to HTML-escape messages #72

gmazzap opened this issue Nov 3, 2021 · 0 comments
Milestone

Comments

@gmazzap
Copy link

gmazzap commented Nov 3, 2021

The simplex example, let's take a file containing:

<?php

$x = foo";

If we run PHP Parallel Lint with the --checkstyle flag we get (formatted for readability):

<?xml version="1.0" encoding="UTF-8"?>
<checkstyle>
  <file name="example.php">
    <error
      line="3"
      severity="ERROR"
      message="Parse error: syntax error, unexpected '"' in ./inc/x.php on line 3"
      source="Syntax Error" />
    </file>
</checkstyle>

Which is broken XML.

Generally speaking, when generating checkstyle XML, PHP Parallel Lint should HTML-escape messages, via something like: htmlspecialchars($message, ENT_QUOTES, 'UTF-8'); here: https://github.com/php-parallel-lint/PHP-Parallel-Lint/blob/master/src/Output.php#L444

gmazzap added a commit to gmazzap/PHP-Parallel-Lint that referenced this issue Nov 3, 2021
@jrfnl jrfnl closed this as completed in 490078e Dec 6, 2021
jrfnl added a commit that referenced this issue Dec 6, 2021
jrfnl added a commit that referenced this issue Dec 6, 2021
* Minor tweak to allow CS to pass.
* Enable SimpleXML for the PHP 5.3-5.5 tests.
@jrfnl jrfnl added this to the 1.x Next milestone Feb 17, 2022
@jrfnl jrfnl added the Type: bug label Mar 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants