note 69186 added to function.mcrypt-generic-init

From: Date: Fri, 25 Aug 2006 21:14:06 +0000
Subject: note 69186 added to function.mcrypt-generic-init
Groups: php.notes 
Request: Send a blank email to php-notes+get-116332@lists.php.net to get a copy of this message
If you write error-checking into your code, be warned that this function returns FALSE on some errors, and 0 on success, hence mcrypt_generic_init( $a, $b, $c ) or die( "Oops"); ALWAYS exits with the error message "Oops", and (mcrypt_generic_init( $a, $b, $c ) >= 0 ) or die( "Oops"); Sometimes continues when mcrypt_generic_init() actually failed. To check for successful init use something like: $s = mcrypt_generic_init( $a, $b, $c ); if( ($s < 0) || ($s === false)) die( "Really an error" ); ---- Server IP: 66.163.161.117 Probable Submitter: 71.7.147.57 ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/function.mcrypt-generic-init.php Edit -- https://master.php.net/note/edit/69186 Del: integrated -- https://master.php.net/note/delete/69186/integrated Del: useless -- https://master.php.net/note/delete/69186/useless Del: bad code -- https://master.php.net/note/delete/69186/bad+code Del: spam -- https://master.php.net/note/delete/69186/spam Del: non-english -- https://master.php.net/note/delete/69186/non-english Del: in docs -- https://master.php.net/note/delete/69186/in+docs Del: other reasons-- https://master.php.net/note/delete/69186 Reject -- https://master.php.net/note/reject/69186 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#116332) next »