cvs: phpdoc /scripts/iniupdate ini-update.php
| From: | Nuno Lopes | Date: | Fri, 14 Sep 2007 21:06:23 +0000 |
| Subject: | cvs: phpdoc /scripts/iniupdate ini-update.php | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-22@lists.php.net to get a copy of this message | ||
nlopess Fri Sep 14 21:06:23 2007 UTC
Modified files:
/phpdoc/scripts/iniupdate ini-update.php
Log:
add a MAX_MACRO_EXPAND_DEPTH to limit the macro expanding loop. defaults to 10, that should be
enough for everybody (tm)
http://cvs.php.net/viewvc.cgi/phpdoc/scripts/iniupdate/ini-update.php?r1=1.10&r2=1.11&diff_format=u
Index: phpdoc/scripts/iniupdate/ini-update.php
diff -u phpdoc/scripts/iniupdate/ini-update.php:1.10 phpdoc/scripts/iniupdate/ini-update.php:1.11
--- phpdoc/scripts/iniupdate/ini-update.php:1.10 Fri Sep 14 20:31:08 2007
+++ phpdoc/scripts/iniupdate/ini-update.php Fri Sep 14 21:06:23 2007
@@ -25,6 +25,8 @@
$pecl_dir = 'sources/pecl'; //pecl path
$phpdoc_dir = '../..'; //phpdoc path
+define('MAX_MACRO_EXPAND_DEPTH', 10);
+
/******* END of configurations *****/
require_once './ini_search_lib.php';
@@ -137,12 +139,13 @@
/* replace macros and make the $default var */
$new = $arr[0];
+ $i = 0;
do {
$old = $new;
$new = strtr($new,$replace);
- } while($new != $old);
+ } while ($new !== $old && ++$i < MAX_MACRO_EXPAND_DEPTH);
$default = $new;