cvs: pear /Net_SmartIRC SmartIRC.php

From: Date: Sun, 08 Jun 2003 23:12:33 +0000
Subject: cvs: pear /Net_SmartIRC SmartIRC.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-10782@lists.php.net to get a copy of this message
meebey Sun Jun 8 19:12:33 2003 EDT Modified files: /pear/Net_SmartIRC SmartIRC.php Log: - added log level check in log() method. Index: pear/Net_SmartIRC/SmartIRC.php diff -u pear/Net_SmartIRC/SmartIRC.php:1.36 pear/Net_SmartIRC/SmartIRC.php:1.37 --- pear/Net_SmartIRC/SmartIRC.php:1.36 Sun Jun 8 17:32:52 2003 +++ pear/Net_SmartIRC/SmartIRC.php Sun Jun 8 19:12:33 2003 @@ -1,9 +1,9 @@ <?php /** - * $Id: SmartIRC.php,v 1.36 2003/06/08 21:32:52 meebey Exp $ - * $Revision: 1.36 $ + * $Id: SmartIRC.php,v 1.37 2003/06/08 23:12:33 meebey Exp $ + * $Revision: 1.37 $ * $Author: meebey $ - * $Date: 2003/06/08 21:32:52 $ + * $Date: 2003/06/08 23:12:33 $ * * Net_SmartIRC * Communication for PHP with IRC networks @@ -799,6 +799,14 @@ */ function log($level, $entry, $file = null, $line = null) { + // prechecks + if (!(is_number($level)) || + !($level > SMARTIRC_DEBUG_NONE && + $level < SMARTIRC_DEBUG_ALL)) { + $this->log(SMARTIRC_DEBUG_NOTICE, 'WARNING!: invalid log level passed to log() ('.$level.')', __FILE__, __LINE__); + return; + } + if (!($level & $this->_debug) || ($this->_logdestination == SMARTIRC_NONE)) { return;

« previous php.pear.cvs (#10782) next »