logo       

[SM-CVS] CVS: squirrelmail/class error.class.php,1.1,1.2: msg#00074

Subject: [SM-CVS] CVS: squirrelmail/class error.class.php,1.1,1.2
Update of /cvsroot/squirrelmail/squirrelmail/class
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24078

Modified Files:
        error.class.php 
Log Message:
add php5 E_STRICT support and disable logging of disabled error messages.

it is possible that switch($iErrNo) should be replaced with if control 
structures in order to follow php error_reporting setting.


Index: error.class.php
===================================================================
RCS file: /cvsroot/squirrelmail/squirrelmail/class/error.class.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -r1.1 -r1.2
--- error.class.php     28 Jul 2005 21:03:00 -0000      1.1
+++ error.class.php     31 Jul 2005 12:13:30 -0000      1.2
@@ -14,6 +14,11 @@
 define('SQM_NOTICE',0);

 define('SQM_WARNING',1);

 define('SQM_ERROR',2);

+define('SQM_STRICT',3);
+// php5 E_STRICT constant (compatibility with php4)
+if (! defined('E_STRICT')) define('E_STRICT',2048);
+// Set docref_root (fixes URLs that link to php manual)
+if (ini_get('docref_root')=='') ini_set('docref_root','http://www.php.net/');
 

 /**

  * Error Handler class

@@ -62,11 +67,21 @@
                   );

         $iType = NULL;

         $aErrorCategory = array();

+
+        /**
+         * Check error_reporting value before logging error.
+         * Don't log errors that are disabled by @ (error_reporting = 0). Some 
SquirrelMail scripts
+         * (sq_mb_list_encodings(), ldap function calls in 
functions/abook_ldap_server.php)
+         * handle errors themselves and @ is used to disable generic php error 
messages.
+         */
+        if ((bool) ini_get('error_reporting')) {
         /*

          * The following errors cannot be handled by a user defined error 
handler:

          * E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING, E_COMPILE_ERROR, 
E_COMPILE_WARNING

          */

         switch ($iErrNo) {

+            case E_STRICT:
+                $iType = (is_null($iType)) ? SQM_STRICT : $iType;
             case E_NOTICE:

                 $iType = (is_null($iType)) ? SQM_NOTICE : $iType;

             case E_WARNING:

@@ -130,6 +145,7 @@
                 break;

             default: break;

         }

+
         $aErrorTpl = array(

                     'type'      => $iType,

                     'category'  => $aErrorCategory,

@@ -140,6 +156,8 @@
         // Add the notice/warning/error to the existing list of 
notices/warnings

         $this->aErrors[] = $aErrorTpl;

         $this->Template->assign('aErrors',$this->aErrors);

+        }
+
         // Show the error immediate in case of fatal errors

         if ($iType == SQM_ERROR) {

             $this->DisplayErrors();




-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
--
squirrelmail-cvs mailing list
List Address: squirrelmail-cvs-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
List Info: https://lists.sourceforge.net/lists/listinfo/squirrelmail-cvs
http://squirrelmail.org/cvs



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
linux.arklinux....    user-groups.lin...    kde.usability/2...    ietf.ipp/2002-0...    mail.spam.spamc...    os.netbsd.devel...    audio.cd-record...    text.unicode.de...    php.documentati...    games.fps.halfl...    window-managers...    suse.oracle.gen...    bug-tracking.gn...    video.dvdrip.us...    xfree86.cvs/200...    java.netbeans.m...    network.argus/2...    culture.sf.kill...    debian.ports.al...    freebsd.questio...    qplus.devel/200...    handhelds.palm....   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe