Menu

#10 Don't blindly remove first 2 chars of file path

Fixed
nobody
None
Medium
Defect
2011-09-13
2011-09-12
Anonymous
No

Originally created by: an...@headnet.dk
Originally owned by: tch...@hotmail.com

I am setting up phpcheckstyle for a Jenkins build to use with the Violations plug-in:

php /usr/local/www/jenkinsscripts/PhpCheckstyle/run.php --src "$WORKSPACE/mymodule" --format xml

However, in the XML output the path to the php files are truncated. Instead of "/var/lib/jenkins/jobs/myjob/workspace/mymodule/x.php", the path is "ar/lib/jenkins/jobs/myjob/workspace/mymodule/x.php"

The reason is that XmlFormatReporter.php blindly removes the first 2 chars of the path (to remove ./):

  // remove the "./" at the beginning ot the path
  $this->currentElement->setAttribute("name", substr($f, 2));

I think it should check if the path is relative or absolute before rewriting the path.

Related

Wiki: History

Discussion

  • Anonymous

    Anonymous - 2011-09-12

    Originally posted by: tch...@hotmail.com

    (No comment was entered for this change.)

    Owner: tch...@hotmail.com
    Status: Accepted

     
  • Anonymous

    Anonymous - 2011-09-12

    Originally posted by: tch...@hotmail.com

    Added a correction, tested that it doesn't change anything for relative path.

    Uploaded version 0.9.7.

    Can you check that it works for absolute paths ?

    Thanks

    Status: Fixed

     
  • Anonymous

    Anonymous - 2011-09-13

    Originally posted by: an...@headnet.dk

    It works. Thanks for a quick fix.

    /Anton

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.