Re: [Patch] PEAR::loadExtension

From: Date: Tue, 08 Jul 2003 10:59:08 +0000
Subject: Re: [Patch] PEAR::loadExtension
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-18087@lists.php.net to get a copy of this message
I've commited it, thanks Davey. On Monday, July 7, 2003 23:09, Davey wrote: > 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') { -- Tomas V.V.Cox mailto:cox@idecnet.com

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