iliaa Wed Dec 24 11:38:23 2003 EDT
Modified files:
/php-src/main main.c php_globals.h php.h
Log:
Fixed bug #26707 (Incorrect error for disabled functions/classes).
Index: php-src/main/main.c
diff -u php-src/main/main.c:1.583 php-src/main/main.c:1.584
--- php-src/main/main.c:1.583 Fri Dec 12 03:25:22 2003
+++ php-src/main/main.c Wed Dec 24 11:38:22 2003
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: main.c,v 1.583 2003/12/12 08:25:22 helly Exp $ */
+/* $Id: main.c,v 1.584 2003/12/24 16:38:22 iliaa Exp $ */
/* {{{ includes
*/
@@ -131,23 +131,21 @@
*/
static void php_disable_functions(TSRMLS_D)
{
- char *s = NULL;
- char *e = INI_STR("disable_functions");
- char p;
+ char *s = NULL, *e;
- if (!*e) {
+ if (!*(INI_STR("disable_functions"))) {
return;
}
+ e = PG(disable_functions) = strdup(INI_STR("disable_functions"));
+
while (*e) {
switch (*e) {
case ' ':
case ',':
if (s) {
- p = *e;
*e = '\0';
zend_disable_function(s, e-s TSRMLS_CC);
- *e = p;
s = NULL;
}
break;
@@ -169,23 +167,21 @@
*/
static void php_disable_classes(TSRMLS_D)
{
- char *s = NULL;
- char *e = INI_STR("disable_classes");
- char p;
+ char *s = NULL, *e;
- if (!*e) {
+ if (!*(INI_STR("disable_classes"))) {
return;
}
+ e = PG(disable_classes) = strdup(INI_STR("disable_classes"));
+
while (*e) {
switch (*e) {
case ' ':
case ',':
if (s) {
- p = *e;
*e = '\0';
zend_disable_class(s, e-s TSRMLS_CC);
- *e = p;
s = NULL;
}
break;
@@ -1384,6 +1380,8 @@
PG(last_error_file) = NULL;
PG(last_error_lineno) = 0;
PG(error_handling) = EH_NORMAL;
+ PG(disable_functions) = NULL;
+ PG(disable_classes) = NULL;
#if HAVE_SETLOCALE
setlocale(LC_CTYPE, "");
@@ -1552,6 +1550,12 @@
if (PG(last_error_file)) {
free(PG(last_error_file));
}
+ if (PG(disable_functions)) {
+ free(PG(disable_functions));
+ }
+ if (PG(disable_classes)) {
+ free(PG(disable_classes));
+ }
}
/* }}} */
Index: php-src/main/php_globals.h
diff -u php-src/main/php_globals.h:1.93 php-src/main/php_globals.h:1.94
--- php-src/main/php_globals.h:1.93 Tue Jun 10 16:03:41 2003
+++ php-src/main/php_globals.h Wed Dec 24 11:38:22 2003
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_globals.h,v 1.93 2003/06/10 20:03:41 imajes Exp $ */
+/* $Id: php_globals.h,v 1.94 2003/12/24 16:38:22 iliaa Exp $ */
#ifndef PHP_GLOBALS_H
#define PHP_GLOBALS_H
@@ -147,6 +147,9 @@
int last_error_lineno;
error_handling_t error_handling;
zend_class_entry *exception_class;
+
+ char *disable_functions;
+ char *disable_classes;
};
Index: php-src/main/php.h
diff -u php-src/main/php.h:1.200 php-src/main/php.h:1.201
--- php-src/main/php.h:1.200 Mon Nov 3 09:12:45 2003
+++ php-src/main/php.h Wed Dec 24 11:38:22 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php.h,v 1.200 2003/11/03 14:12:45 derick Exp $ */
+/* $Id: php.h,v 1.201 2003/12/24 16:38:22 iliaa Exp $ */
#ifndef PHP_H
#define PHP_H
@@ -26,7 +26,7 @@
#include <dmalloc.h>
#endif
-#define PHP_API_VERSION 20031103
+#define PHP_API_VERSION 20031224
#define PHP_HAVE_STREAMS
#define YYDEBUG 0
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php