Rewrite to strict PHP code

8 years ago
4 years ago


Your PHP code have many strict errors, instead of code if($array['val']) you should write if(isset($array['val'])

when you creating object, you should create it like this $obj = new stdClass();

If you wish, i can help you with this, every time i download new version of Traq, i rewrite a part of it :)

Ticket History

8 years and 3 months ago by Rodney

  • Changed Milestone from 2.0 to 2.2
  • Closed ticket as Closed

I did some searching with I had scripts gives me errors about unset variables, undefined indexes, etc. I found that most people run PHP with these turned off/hidden.

I do not see the point in making the author rewrite/add more lines of code to fix something that only a few people will see, and is also easily fixed by turning such errors off.

And from my understanding, it's also wise to run PHP with errors turned off on a production server.

8 years and 3 months ago by Jack

I receive no errors with error_reporting set to "E_ALL & ~E_NOTICE | E_STRICT".

8 years and 3 months ago by Pierre

Not a very ideal solution, but in the index file set the following to remove all warnings/errors:

<?php ini_set('error_reporting', 'off'); error_reporting(0); ?>

8 years and 3 months ago by Jack

  • Changed Milestone from 2.2 to 2.1