[Patch] PEAR::loadExtension

From: Date: Mon, 07 Jul 2003 21:09:28 +0000
Subject: [Patch] PEAR::loadExtension
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-18075@lists.php.net to get a copy of this message
Hi all, It came to my attention to PEAR::loadExtension does not handle certain situations properly, namely the fatal errors thrown when enable_dl = Off or safe_mode = On in php.ini. Please find a simple patch below (and attached) that addresses this (3 lines + comment) and apply it (I've not worked out the branches thing yet with php-src and don't have time to sit down and work it out atm). - Davey Index: PEAR.php =================================================================== RCS file: /repository/php-src/pear/PEAR.php,v retrieving revision 1.63 diff -u -r1.63 PEAR.php --- PEAR.php 3 Jul 2003 06:54:26 -0000 1.63 +++ PEAR.php 7 Jul 2003 21:08:20 -0000 @@ -621,6 +621,10 @@ function loadExtension($ext) { if (!extension_loaded($ext)) { + // if either returns true dl() will produce a FATAL error, stop that + if ((ini_get('enable_dl') != 1) || (ini_get('safe_mode') == 1)) { + return false; + } if (OS_WINDOWS) { $suffix = '.dll'; } elseif (PHP_OS == 'HP-UX') {

« previous php.pear.dev (#18075) next »