Menu ▾ ▴

#350 Reduce PHP Notices when debug set to E_ALL

closed-fixed
Other (69)
5
2008-03-26
2008-03-19
openfan
No

Many php Notices are generated during use of NOCC if debug level in conf.php is set to E_ALL.
(NOCC 1.6dev build 2008-03-18)

Most of them seem harmless to me but some are easy to prevent or may be a problem(?). I selected the following three notices:

* [19-Mar-2008 20:04:20] PHP Notice: Undefined variable: decpasswd in /Applications/MAMP/htdocs/webmail/utils/crypt.php on line 88
-> Easily solved by initialising decpasswd I guess.

* [19-Mar-2008 20:04:19] PHP Notice: Uninitialized string offset: 0 in /Applications/MAMP/htdocs/webmail/utils/functions.php on line 997
-> I'm not sure what's wrong here, 2 dimensional string array?

* [19-Mar-2008 20:04:19] PHP Notice: Object of class smtp could not be converted to int in /Applications/MAMP/htdocs/webmail/classes/class_send.php on line 215
-> Found on the web: In PHP 4 (int) $object results in 0 when there are no properties set, 1 when there are properties set. In PHP 5 (int) $object results in a Notice and always 1 unless zend.ze1_compatibility_mode = 1
So this type cast could lead to a problem?

Discussion

  • Anonymous

    Anonymous - 2008-03-21

    Logged In: YES
    user_id=75246
    Originator: NO

    The last problem could be 'easily' fixed by changing the "!= '0'" to "!empty()", it does the same BUT empty() is avoiding possible 'PHP Notice:' ...

    see:

    http://www.deformedweb.co.uk/php_variable_tests.php
    http://de.php.net/manual/en/types.comparisons.php

     
  • Anonymous

    Anonymous - 2008-03-22

    Logged In: YES
    user_id=529507
    Originator: NO

    I've fixed the first and last notice (and many more). But I can't reproduce the second one. Could you please tell the the steps you follow to get this notice ?

     
  • Anonymous

    Anonymous - 2008-03-22
    • assigned_to: nobody --> goddess_skuld
     
  • openfan

    openfan - 2008-03-25

    Logged In: YES
    user_id=1511744
    Originator: YES

    Notice appears in php_error.log when I send a new email message.
    (and the escape_dots() function in functions.php gets executed)

     
  • Anonymous

    Anonymous - 2008-03-26
    • status: open --> closed-fixed
     
  • Anonymous

    Anonymous - 2008-03-26

    Logged In: YES
    user_id=529507
    Originator: NO

    Fixed in CVS.

    It'll be included in next release.

    But you can download daily snapshots at :
    http://nocc.sourceforge.net/download/

    Thanks for the bug report.

     

Log in to post a comment.