php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch php-fpm.ini_scanner_normal.patch for FPM related Bug #52609

Patch version 2010-08-19 09:30 UTC

Return to Bug #52609 | Download this patch
This patch renders other patches obsolete

Obsolete patches:

Patch Revisions: 2010-08-19 09:30 UTC | 2010-08-15 16:37 UTC

Developer: fat@php.net



  Index: sapi/fpm/fpm/fpm_conf.c
  ===================================================================
 --- sapi/fpm/fpm/fpm_conf.c	(r�vision 302272)
 --- sapi/fpm/fpm/fpm_conf.c	(r�vision 302466)
  +++ sapi/fpm/fpm/fpm_conf.c	(copie de travail)
  @@ -114,8 +114,8 @@
   static char *fpm_conf_set_boolean(zval *value, void **config, intptr_t offset) /* {{{ */
   {


  +	if (!Z_STRVAL_P(key) || !Z_STRVAL_P(value) || !*Z_STRVAL_P(key)) {
   		zlog(ZLOG_STUFF, ZLOG_ERROR, "[%s:%d] Mispell array ?", ini_filename, ini_lineno);
   		*error = 1;
   		return;
 @@ -953,7 +953,7 @@
 @@ -858,14 +858,29 @@
  	}
  
  	if (!strcmp("env", Z_STRVAL_P(name))) {
 +		if (!*Z_STRVAL_P(value)) {
 +			zlog(ZLOG_STUFF, ZLOG_ERROR, "[%s:%d] Mispell array ? (empty value)", ini_filename, ini_lineno);
 +			*error = 1;
 +			return;
 +		}
  		config = (char *)current_wp->config + offsetof(struct fpm_worker_pool_config_s, env);
  		err = fpm_conf_set_array(key, value, &config, 0);
  
  	} else if (!strcmp("php_value", Z_STRVAL_P(name))) {
 +		if (!*Z_STRVAL_P(value)) {
 +			zlog(ZLOG_STUFF, ZLOG_ERROR, "[%s:%d] Mispell array ? (empty value)", ini_filename, ini_lineno);
 +			*error = 1;
 +			return;
 +		}
  		config = (char *)current_wp->config + offsetof(struct fpm_worker_pool_config_s, php_values);
  		err = fpm_conf_set_array(key, value, &config, 0);
  
  	} else if (!strcmp("php_admin_value", Z_STRVAL_P(name))) {
 +		if (!*Z_STRVAL_P(value)) {
 +			zlog(ZLOG_STUFF, ZLOG_ERROR, "[%s:%d] Mispell array ? (empty value)", ini_filename, ini_lineno);
 +			*error = 1;
 +			return;
 +		}
  		config = (char *)current_wp->config + offsetof(struct fpm_worker_pool_config_s, php_admin_values);
  		err = fpm_conf_set_array(key, value, &config, 0);
  
 @@ -953,7 +968,7 @@
   		buf[n++] = '\n';
   		ini_lineno++;
  		ini_filename = filename;
  		ini_filename = filename;
  -		tmp = zend_parse_ini_string(buf, 1, ZEND_INI_SCANNER_RAW, (zend_ini_parser_cb_t)fpm_conf_ini_parser, &error TSRMLS_CC);
  +		tmp = zend_parse_ini_string(buf, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t)fpm_conf_ini_parser, &error TSRMLS_CC);
   		ini_filename = filename;
   		if (error || tmp == FAILURE) {
   			if (ini_include) free(ini_include);
 Index: sapi/fpm/fpm/fpm_main.c
 ===================================================================
 --- sapi/fpm/fpm/fpm_main.c	(r�vision 302466)
 +++ sapi/fpm/fpm/fpm_main.c	(copie de travail)
 @@ -1370,7 +1370,7 @@
  		int mode = ZEND_INI_USER;
  		char *tmp;
  		spprintf(&tmp, 0, "%s\n", ini);
 -		zend_parse_ini_string(tmp, 1, ZEND_INI_SCANNER_RAW, (zend_ini_parser_cb_t)fastcgi_ini_parser, &mode TSRMLS_CC);
 +		zend_parse_ini_string(tmp, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t)fastcgi_ini_parser, &mode TSRMLS_CC);
  		efree(tmp);
  	}
  
 @@ -1379,7 +1379,7 @@
  		int mode = ZEND_INI_SYSTEM;
  		char *tmp;
  		spprintf(&tmp, 0, "%s\n", ini);
 -		zend_parse_ini_string(tmp, 1, ZEND_INI_SCANNER_RAW, (zend_ini_parser_cb_t)fastcgi_ini_parser, &mode TSRMLS_CC);
 +		zend_parse_ini_string(tmp, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t)fastcgi_ini_parser, &mode TSRMLS_CC);
  		efree(tmp);
  	}
  }
 @@ -1404,7 +1404,7 @@
  		return;
  	}
  
 -	if (!value || strlen(value) < 1) {
 +	if (!value) {
  		fprintf(stderr, "Passing INI directive through FastCGI: empty value for key '%s'\n", key);
  		return;
  	}
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 13:01:29 2024 UTC