switch (expr->type) {
case IS_NULL:
expr_copy->value.str.len = 0;
- expr_copy->value.str.val = empty_string;
+ expr_copy->value.str.val = STR_EMPTY_ALLOC();
break;
case IS_BOOL:
if (expr->value.lval) {
expr_copy->value.str.val = estrndup("1", 1);
} else {
expr_copy->value.str.len = 0;
- expr_copy->value.str.val = empty_string;
+ expr_copy->value.str.val = STR_EMPTY_ALLOC();
}
break;
case IS_RESOURCE:
if (EG(exception)) {
zval_dtor(expr_copy);
expr_copy->value.str.len = 0;
- expr_copy->value.str.val = empty_string;
+ expr_copy->value.str.val = STR_EMPTY_ALLOC();
break;
}
}
#define Z_DBG(expr)
#endif
-ZEND_API extern char *empty_string;
-
BEGIN_EXTERN_C()
ZEND_API void free_estring(char **str_p);
END_EXTERN_C()
-#define STR_FREE(ptr) if (ptr && ptr!=empty_string) { efree(ptr); }
-#define STR_FREE_REL(ptr) if (ptr && ptr!=empty_string) { efree_rel(ptr); }
+/* FIXME: Check if we can save if (ptr) too */
-#define STR_REALLOC(ptr, size) \
- if (ptr!=empty_string) { \
- ptr = (char *) erealloc(ptr, size); \
- } else { \
- ptr = (char *) emalloc(size); \
- memset(ptr, 0, size); \
- }
+#define STR_FREE(ptr) if (ptr) { efree(ptr); }
+#define STR_FREE_REL(ptr) if (ptr) { efree_rel(ptr); }
+
+#define STR_EMPTY_ALLOC() estrndup("", sizeof("")-1)
+
+#define STR_REALLOC(ptr, size) \
+ ptr = (char *) erealloc(ptr, size);
/* output support */
#define ZEND_WRITE(str, str_len) zend_write((str), (str_len))
#define ZVAL_EMPTY_STRING(z) { \
(z)->value.str.len = 0; \
- (z)->value.str.val = empty_string; \
+ (z)->value.str.val = STR_EMPTY_ALLOC(); \
(z)->type = IS_STRING; \
}
#define perealloc_recoverable_rel(ptr, size, persistent) ((persistent)?realloc((ptr), (size)):erealloc_recoverable_rel((ptr), (size)))
#define pestrdup_rel(s, persistent) ((persistent)?strdup(s):estrdup_rel(s))
-#define safe_estrdup(ptr) ((ptr)?(estrdup(ptr)):(empty_string))
-#define safe_estrndup(ptr, len) ((ptr)?(estrndup((ptr), (len))):(empty_string))
+#define safe_estrdup(ptr) ((ptr)?(estrdup(ptr)):STR_EMPTY_ALLOC())
+#define safe_estrndup(ptr, len) ((ptr)?(estrndup((ptr), (len))):STR_EMPTY_ALLOC())
ZEND_API int zend_set_memory_limit(unsigned int memory_limit);
|| ((int)T->str_offset.offset<0)
|| (T->str_offset.str->value.str.len <= T->str_offset.offset)) {
zend_error(E_NOTICE, "Uninitialized string offset: %d", T->str_offset.offset);
- T->tmp_var.value.str.val = empty_string;
+ T->tmp_var.value.str.val = STR_EMPTY_ALLOC();
T->tmp_var.value.str.len = 0;
} else {
char c = str->value.str.val[T->str_offset.offset];
}
} else {
MAKE_STD_ZVAL(retval);
- ZVAL_STRINGL(retval, empty_string, 0, 0);
+ ZVAL_STRINGL(retval, "", 0, 1);
}
*writeobj = *retval;
zval_copy_ctor(writeobj);
switch (op->type) {
case IS_NULL:
- op->value.str.val = empty_string;
+ op->value.str.val = STR_EMPTY_ALLOC();
op->value.str.len = 0;
break;
case IS_STRING:
op->value.str.val = estrndup_rel("1", 1);
op->value.str.len = 1;
} else {
- op->value.str.val = empty_string;
+ op->value.str.val = STR_EMPTY_ALLOC();
op->value.str.len = 0;
}
break;
ZEND_API int add_string_to_string(zval *result, zval *op1, zval *op2)
{
int length = op1->value.str.len + op2->value.str.len;
- if (op1->value.str.val == empty_string) {
- result->value.str.val = (char *) emalloc(length+1);
- } else {
- result->value.str.val = (char *) erealloc(op1->value.str.val, length+1);
- }
+
+ result->value.str.val = (char *) erealloc(op1->value.str.val, length+1);
memcpy(result->value.str.val+op1->value.str.len, op2->value.str.val, op2->value.str.len);
result->value.str.val[length] = 0;
result->value.str.len = length;
if (result==op1) { /* special case, perform operations on result */
uint res_len = op1->value.str.len + op2->value.str.len;
- if (result->value.str.len == 0) { /* handle empty_string */
- STR_FREE(result->value.str.val);
- result->value.str.val = emalloc(res_len+1);
- } else {
- result->value.str.val = erealloc(result->value.str.val, res_len+1);
- }
+ result->value.str.val = erealloc(result->value.str.val, res_len+1);
+
memcpy(result->value.str.val+result->value.str.len, op2->value.str.val, op2->value.str.len);
result->value.str.val[res_len]=0;
result->value.str.len = res_len;
#include "zend_constants.h"
#include "zend_list.h"
-ZEND_API char *empty_string = ""; /* in order to save emalloc() and efree() time for
- * empty strings (usually used to denote empty
- * return values in failed functions).
- * The macro STR_FREE() will not efree() it.
- */
-
ZEND_API void _zval_dtor(zval *zvalue ZEND_FILE_LINE_DC)
{
case IS_STRING:
case IS_CONSTANT:
CHECK_ZVAL_STRING_REL(zvalue);
- if (zvalue->value.str.val != empty_string) {
- free(zvalue->value.str.val);
- }
+ free(zvalue->value.str.val);
break;
case IS_ARRAY:
case IS_CONSTANT_ARRAY:
break;
case IS_CONSTANT:
case IS_STRING:
- if (zvalue->value.str.val) {
- if (zvalue->value.str.len==0) {
- zvalue->value.str.val = empty_string;
- return SUCCESS;
- }
- }
CHECK_ZVAL_STRING_REL(zvalue);
zvalue->value.str.val = (char *) estrndup_rel(zvalue->value.str.val, zvalue->value.str.len);
break;
if (Z_STRVAL_PP(arg_pattern) && Z_STRLEN_PP(arg_pattern))
pattern = estrndup(Z_STRVAL_PP(arg_pattern), Z_STRLEN_PP(arg_pattern));
else
- pattern = empty_string;
+ pattern = STR_EMPTY_ALLOC();
} else {
convert_to_long_ex(arg_pattern);
pattern = emalloc(2);
if (Z_STRVAL_PP(arg_replace) && Z_STRLEN_PP(arg_replace))
replace = estrndup(Z_STRVAL_PP(arg_replace), Z_STRLEN_PP(arg_replace));
else
- replace = empty_string;
+ replace = STR_EMPTY_ALLOC();
} else {
convert_to_long_ex(arg_replace);
replace = emalloc(2);
if (Z_STRVAL_PP(arg_string) && Z_STRLEN_PP(arg_string))
string = estrndup(Z_STRVAL_PP(arg_string), Z_STRLEN_PP(arg_string));
else
- string = empty_string;
+ string = STR_EMPTY_ALLOC();
/* do the actual work */
ret = php_reg_replace(pattern, replace, string, icase, 1);
while ((count == -1 || count > 1) && !(err = regexec(&re, strp, 1, subs, 0))) {
if (subs[0].rm_so == 0 && subs[0].rm_eo) {
/* match is at start of string, return empty string */
- add_next_index_stringl(return_value, empty_string, 0, 1);
+ add_next_index_stringl(return_value, "", 0, 1);
/* skip ahead the length of the regex match */
strp += subs[0].rm_eo;
} else if (subs[0].rm_so == 0 && subs[0].rm_eo == 0) {
}
if ((argc == 2) || (argc > 2 && Z_STRLEN_PP(file))) {
- if (!fn || fn == empty_string || php_check_open_basedir(fn TSRMLS_CC)) {
+ if (!fn || php_check_open_basedir(fn TSRMLS_CC)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid filename '%s'", fn);
RETURN_FALSE;
}
}
/* Check origin file */
- if (!fn_org || fn_org == empty_string || php_check_open_basedir(fn_org TSRMLS_CC)) {
+ if (!fn_org || php_check_open_basedir(fn_org TSRMLS_CC)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid origin filename '%s'", fn_org);
RETURN_FALSE;
}
/* Check destination file */
- if (!fn_dest || fn_dest == empty_string || php_check_open_basedir(fn_dest TSRMLS_CC)) {
+ if (!fn_dest || php_check_open_basedir(fn_dest TSRMLS_CC)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid destination filename '%s'", fn_dest);
RETURN_FALSE;
}
}
if ((argc == 2) || (argc > 2 && Z_STRLEN_PP(file))) {
- if (!fn || fn == empty_string || php_check_open_basedir(fn TSRMLS_CC)) {
+ if (!fn || php_check_open_basedir(fn TSRMLS_CC)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid filename '%s'", fn);
RETURN_FALSE;
}
if (n > 0) {
add_next_index_stringl(return_value, pos, n, 1);
} else {
- add_next_index_stringl(return_value, empty_string, 0, 1);
+ add_next_index_stringl(return_value, "", 0, 1);
}
}
/* }}} */
}
} else {
/*
- add_get_index_stringl(return_value, i, empty_string, 0, (void **) &pval_ptr, 1);
+ add_get_index_stringl(return_value, i, "", 0, (void **) &pval_ptr, 1);
*/
}
}
}
object_init(return_value);
- add_property_string(return_value, "name",(msql_field->name?msql_field->name:empty_string), 1);
- add_property_string(return_value, "table",(msql_field->table?msql_field->table:empty_string), 1);
+ add_property_string(return_value, "name",(msql_field->name?msql_field->name:""), 1);
+ add_property_string(return_value, "table",(msql_field->table?msql_field->table:""), 1);
add_property_long(return_value, "not_null",IS_NOT_NULL(msql_field->flags));
#if MSQL1
add_property_long(return_value, "primary_key",(msql_field->flags&PRI_KEY_FLAG?1:0));
MS_SQL_G(default_link) = -1;
MS_SQL_G(num_links) = MS_SQL_G(num_persistent);
MS_SQL_G(appname) = estrndup("PHP 5", 5);
- MS_SQL_G(server_message) = empty_string;
+ MS_SQL_G(server_message) = NULL;
MS_SQL_G(min_error_severity) = MS_SQL_G(cfg_min_error_severity);
MS_SQL_G(min_message_severity) = MS_SQL_G(cfg_min_message_severity);
if (MS_SQL_G(connect_timeout) < 1) MS_SQL_G(connect_timeout) = 1;
result->fields[i].column_source = estrdup(source);
}
else {
- result->fields[i].column_source = empty_string;
+ result->fields[i].column_source = STR_EMPTY_ALLOC();
}
column_types[i] = coltype(i+1);
RETURN_STRING(MS_SQL_G(server_message),1);
}
else {
- RETURN_STRING(empty_string,1);
+ RETURN_STRING("",1);
}
}
}
object_init(return_value);
- add_property_string(return_value, "name",(mysql_field->name?mysql_field->name:empty_string), 1);
- add_property_string(return_value, "table",(mysql_field->table?mysql_field->table:empty_string), 1);
- add_property_string(return_value, "def",(mysql_field->def?mysql_field->def:empty_string), 1);
+ add_property_string(return_value, "name",(mysql_field->name?mysql_field->name:""), 1);
+ add_property_string(return_value, "table",(mysql_field->table?mysql_field->table:""), 1);
+ add_property_string(return_value, "def",(mysql_field->def?mysql_field->def:""), 1);
add_property_long(return_value, "max_length", mysql_field->max_length);
add_property_long(return_value, "not_null", IS_NOT_NULL(mysql_field->flags)?1:0);
add_property_long(return_value, "primary_key", IS_PRI_KEY(mysql_field->flags)?1:0);
}
MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link");
- RETURN_STRING((mysql->mysql->host_info) ? mysql->mysql->host_info : empty_string, 1);
+ RETURN_STRING((mysql->mysql->host_info) ? mysql->mysql->host_info : "", 1);
}
/* }}} */
}
MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link");
- RETURN_STRING((mysql->mysql->info) ? mysql->mysql->info : empty_string, 1);
+ RETURN_STRING((mysql->mysql->info) ? mysql->mysql->info : "", 1);
}
/* }}} */
if (bind->indicator == -1) { /* NULL */
zval *val = bind->zval;
- if (Z_TYPE_P(val) == IS_STRING && (Z_STRVAL_P(val) != empty_string)) {
+ if (Z_TYPE_P(val) == IS_STRING)) {
*Z_STRVAL_P(val) = '\0'; /* XXX avoid warning in debug mode */
}
zval_dtor(val);
ZVAL_NULL(val);
- } else if (Z_TYPE_P(bind->zval) == IS_STRING && (Z_STRVAL_P(bind->zval) != empty_string)) {
+ } else if (Z_TYPE_P(bind->zval) == IS_STRING) {
Z_STRVAL_P(bind->zval) = erealloc(Z_STRVAL_P(bind->zval), Z_STRLEN_P(bind->zval)+1);
Z_STRVAL_P(bind->zval)[ Z_STRLEN_P(bind->zval) ] = '\0';
}
case SQL_VARBINARY:
case SQL_LONGVARBINARY:
if (result->binmode <= 0) {
- Z_STRVAL_P(tmp) = empty_string;
+ Z_STRVAL_P(tmp) = STR_EMPTY_ALLOC();
break;
}
if (result->binmode == 1) sql_c_type = SQL_C_BINARY;
case SQL_LONGVARCHAR:
if (IS_SQL_LONG(result->values[i].coltype) && result->longreadlen <= 0) {
- Z_STRVAL_P(tmp) = empty_string;
+ Z_STRVAL_P(tmp) = STR_EMPTY_ALLOC();
break;
}
if (buf == NULL) buf = emalloc(result->longreadlen + 1);
case SQL_VARBINARY:
case SQL_LONGVARBINARY:
if (result->binmode <= 0) {
- Z_STRVAL_P(tmp) = empty_string;
+ Z_STRVAL_P(tmp) = STR_EMPTY_ALLOC();
break;
}
if (result->binmode == 1) sql_c_type = SQL_C_BINARY;
case SQL_LONGVARCHAR:
if (IS_SQL_LONG(result->values[i].coltype) && result->longreadlen <= 0) {
- Z_STRVAL_P(tmp) = empty_string;
+ Z_STRVAL_P(tmp) = STR_EMPTY_ALLOC();
break;
}
*/
if (count < num_subpats) {
for (; i < num_subpats; i++) {
- add_next_index_string(match_sets[i], empty_string, 1);
+ add_next_index_string(match_sets[i], "", 1);
}
}
} else {
esc_match_len = 0;
}
} else {
- esc_match = empty_string;
+ esc_match = "";
esc_match_len = 0;
match_len = 0;
}
/* Make sure we're dealing with strings. */
convert_to_string_ex(subject);
- ZVAL_STRINGL(&empty_replace, empty_string, 0, 0);
+ /* FIXME: This might need to be changed to STR_EMPTY_ALLOC(). Check if this zval could be dtor()'ed somehow */
+ ZVAL_STRINGL(&empty_replace, "", 0, 0);
/* If regex is an array */
if (Z_TYPE_P(regex) == IS_ARRAY) {
/* Nothing to do if we got an empty string */
if (in_str == in_str_end) {
- RETVAL_STRINGL(empty_string, 0, 0);
+ RETVAL_STRINGL("", 0, 1);
}
if (ZEND_NUM_ARGS() == 2) {
PQclear(result);
}
smart_str_free(&str);
- return empty_string;
+ return STR_EMPTY_ALLOC();
}
num_rows = PQntuples(result);
oid_offset = PQfnumber(result,"oid");
if (Z_STRVAL_P(return_value)) {
RETURN_STRING(Z_STRVAL_P(return_value), 1);
}
- RETURN_STRING(empty_string, 0);
+ RETURN_STRING("", 1);
#endif
}
/* }}} */
smart_str_0(&var);
REGISTER_STRINGL_CONSTANT("SID", var.c, var.len, 0);
} else {
- REGISTER_STRINGL_CONSTANT("SID", empty_string, 0, 0);
+ REGISTER_STRINGL_CONSTANT("SID", "", 0, 1);
}
if (PS(apply_trans_sid)) {
{
zval **p_name;
int ac = ZEND_NUM_ARGS();
- char *old = empty_string;
+ char *old;
if (ac < 0 || ac > 1 || zend_get_parameters_ex(ac, &p_name) == FAILURE)
WRONG_PARAM_COUNT;
- if (PS(id))
+ if (PS(id)) {
old = estrdup(PS(id));
+ } else {
+ old = STR_EMPTY_ALLOC();
+ }
if (ac == 1) {
convert_to_string_ex(p_name);
if (have_content) {
add_assoc_string(return_value, name, value, 0);
} else {
- add_assoc_string(return_value, name, empty_string, 0);
+ add_assoc_string(return_value, name, "", 0);
}
efree(name);
unsigned long value;
if (Z_TYPE_P(arg) != IS_LONG || base < 2 || base > 36) {
- return empty_string;
+ return STR_EMPTY_ALLOC();
}
value = Z_LVAL_P(arg);
static char digits[] = "0123456789abcdefghijklmnopqrstuvwxyz";
if ((Z_TYPE_P(arg) != IS_LONG && Z_TYPE_P(arg) != IS_DOUBLE) || base < 2 || base > 36) {
- return empty_string;
+ return STR_EMPTY_ALLOC();
}
if (Z_TYPE_P(arg) == IS_DOUBLE) {
/* Don't try to convert +/- infinity */
if (fvalue == HUGE_VAL || fvalue == -HUGE_VAL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number too large");
- return empty_string;
+ return STR_EMPTY_ALLOC();
}
end = ptr = buf + sizeof(buf) - 1;
if (Z_STRVAL_PP(arg_pattern) && Z_STRLEN_PP(arg_pattern))
pattern = estrndup(Z_STRVAL_PP(arg_pattern), Z_STRLEN_PP(arg_pattern));
else
- pattern = empty_string;
+ pattern = STR_EMPTY_ALLOC();
} else {
convert_to_long_ex(arg_pattern);
pattern = emalloc(2);
if (Z_STRVAL_PP(arg_replace) && Z_STRLEN_PP(arg_replace))
replace = estrndup(Z_STRVAL_PP(arg_replace), Z_STRLEN_PP(arg_replace));
else
- replace = empty_string;
+ replace = STR_EMPTY_ALLOC();
} else {
convert_to_long_ex(arg_replace);
replace = emalloc(2);
if (Z_STRVAL_PP(arg_string) && Z_STRLEN_PP(arg_string))
string = estrndup(Z_STRVAL_PP(arg_string), Z_STRLEN_PP(arg_string));
else
- string = empty_string;
+ string = STR_EMPTY_ALLOC();
/* do the actual work */
ret = php_reg_replace(pattern, replace, string, icase, 1);
while ((count == -1 || count > 1) && !(err = regexec(&re, strp, 1, subs, 0))) {
if (subs[0].rm_so == 0 && subs[0].rm_eo) {
/* match is at start of string, return empty string */
- add_next_index_stringl(return_value, empty_string, 0, 1);
+ add_next_index_stringl(return_value, "", 0, 1);
/* skip ahead the length of the regex match */
strp += subs[0].rm_eo;
} else if (subs[0].rm_so == 0 && subs[0].rm_eo == 0) {
convert_to_string_ex(subject);
Z_TYPE_P(result) = IS_STRING;
if (Z_STRLEN_PP(subject) == 0) {
- ZVAL_STRINGL(result, empty_string, 0, 1);
+ ZVAL_STRINGL(result, "", 0, 1);
return;
}
zend_hash_move_forward(Z_ARRVAL_P(replace));
} else {
/* We've run out of replacement strings, so use an empty one. */
- replace_value = empty_string;
+ replace_value = "";
replace_len = 0;
}
}
/* Don't waste our time if it's empty */
if (Z_STRLEN_PP(input_str) == 0)
- RETURN_STRINGL(empty_string, 0, 1);
+ RETURN_STRINGL("", 0, 1);
/* ... or if the multiplier is zero */
if (Z_LVAL_PP(mult) == 0)
- RETURN_STRINGL(empty_string, 0, 1);
+ RETURN_STRINGL("", 0, 1);
/* Initialize the result string */
result_len = Z_STRLEN_PP(input_str) * Z_LVAL_PP(mult);
len = parse_iv(start + 2);
- if (len == 0) {
- str = empty_string;
- } else {
- str = estrndup(YYCURSOR, len);
- }
+ str = estrndup(YYCURSOR, len);
YYCURSOR += len + 2;
*p = YYCURSOR;
len = parse_iv(start + 2);
- if (len == 0) {
- str = empty_string;
- } else {
- str = estrndup(YYCURSOR, len);
- }
+ str = estrndup(YYCURSOR, len);
YYCURSOR += len + 2;
*p = YYCURSOR;
php_sybase_module.default_link=-1;
php_sybase_module.num_links = php_sybase_module.num_persistent;
php_sybase_module.appname = estrndup("PHP " PHP_VERSION, sizeof("PHP " PHP_VERSION));
- php_sybase_module.server_message = empty_string;
+ php_sybase_module.server_message = STR_EMPTY_ALLOC();
php_sybase_module.min_error_severity = php_sybase_module.cfg_min_error_severity;
php_sybase_module.min_message_severity = php_sybase_module.cfg_min_message_severity;
return SUCCESS;
result->fields[i].max_length = dbcollen(sybase_ptr->link,i+1);
result->fields[i].column_source = estrdup(dbcolsource(sybase_ptr->link,i+1));
if (!result->fields[i].column_source) {
- result->fields[i].column_source = empty_string;
+ result->fields[i].column_source = STR_EMPTY_ALLOC();
}
Z_TYPE(result->fields[i]) = column_types[i];
/* set numeric flag */
SybCtG(default_link)=-1;
SybCtG(num_links) = SybCtG(num_persistent);
SybCtG(appname) = estrndup("PHP " PHP_VERSION, sizeof("PHP " PHP_VERSION));
- SybCtG(server_message) = empty_string;
+ SybCtG(server_message) = STR_EMPTY_ALLOC();
return SUCCESS;
}
result->fields[i].name = estrdup(computed_buf);
j++;
}
- result->fields[i].column_source = empty_string;
+ result->fields[i].column_source = STR_EMPTY_ALLOC();
result->fields[i].max_length = result->datafmt[i].maxlength-1;
result->fields[i].numeric = result->numerics[i];
Z_TYPE(result->fields[i]) = result->types[i];
ALLOC_ZVAL(ent.data);
INIT_PZVAL(ent.data);
Z_TYPE_P(ent.data) = IS_STRING;
- Z_STRVAL_P(ent.data) = empty_string;
+ Z_STRVAL_P(ent.data) = STR_EMPTY_ALLOC();
Z_STRLEN_P(ent.data) = 0;
wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry));
} else if (!strcmp(name, EL_BINARY)) {
ALLOC_ZVAL(ent.data);
INIT_PZVAL(ent.data);
Z_TYPE_P(ent.data) = IS_STRING;
- Z_STRVAL_P(ent.data) = empty_string;
+ Z_STRVAL_P(ent.data) = STR_EMPTY_ALLOC();
Z_STRLEN_P(ent.data) = 0;
wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry));
} else if (!strcmp(name, EL_CHAR)) {
*/
static void pvalue_config_destructor(zval *pvalue)
{
- if (Z_TYPE_P(pvalue) == IS_STRING && Z_STRVAL_P(pvalue) != empty_string) {
+ if (Z_TYPE_P(pvalue) == IS_STRING) {
free(Z_STRVAL_P(pvalue));
}
}
pstat = sapi_get_stat(TSRMLS_C);
if (!pstat) {
- return empty_string;
+ return "";
}
if ((pwd=getpwuid(pstat->st_uid))==NULL) {
- return empty_string;
+ return "";
}
SG(request_info).current_user_length = strlen(pwd->pw_name);
SG(request_info).current_user = estrndup(pwd->pw_name, SG(request_info).current_user_length);
if (elts[i].val) {
val = elts[i].val;
} else {
- val = empty_string;
+ val = "";
}
php_register_variable(elts[i].key, val, track_vars_array TSRMLS_CC);
}
arr = apr_table_elts(ctx->f->r->headers_in);
APR_ARRAY_FOREACH_OPEN(arr, key, val)
- if (!val) val = empty_string;
+ if (!val) val = "";
add_assoc_string(return_value, key, val, 1);
APR_ARRAY_FOREACH_CLOSE()
}
arr = apr_table_elts(ctx->f->r->headers_out);
APR_ARRAY_FOREACH_OPEN(arr, key, val)
- if (!val) val = empty_string;
+ if (!val) val = "";
add_assoc_string(return_value, key, val, 1);
APR_ARRAY_FOREACH_CLOSE()
}
char *key, *val;
APR_ARRAY_FOREACH_OPEN(arr, key, val)
- if (!val) val = empty_string;
+ if (!val) val = "";
php_register_variable(key, val, track_vars_array TSRMLS_CC);
APR_ARRAY_FOREACH_CLOSE()
arr = apr_table_elts(ctx->r->headers_in);
APR_ARRAY_FOREACH_OPEN(arr, key, val)
- if (!val) val = empty_string;
+ if (!val) val = "";
add_assoc_string(return_value, key, val, 1);
APR_ARRAY_FOREACH_CLOSE()
}
arr = apr_table_elts(ctx->r->headers_out);
APR_ARRAY_FOREACH_OPEN(arr, key, val)
- if (!val) val = empty_string;
+ if (!val) val = "";
add_assoc_string(return_value, key, val, 1);
APR_ARRAY_FOREACH_CLOSE()
}
php_info_print_table_header(2, "Variable", "Value");
APR_ARRAY_FOREACH_OPEN(arr, key, val)
if (!val) {
- val = empty_string;
+ val = "";
}
php_info_print_table_row(2, key, val);
APR_ARRAY_FOREACH_CLOSE()
arr = apr_table_elts(((php_struct *) SG(server_context))->r->headers_in);
APR_ARRAY_FOREACH_OPEN(arr, key, val)
if (!val) {
- val = empty_string;
+ val = "";
}
php_info_print_table_row(2, key, val);
APR_ARRAY_FOREACH_CLOSE()
arr = apr_table_elts(((php_struct *) SG(server_context))->r->headers_out);
APR_ARRAY_FOREACH_OPEN(arr, key, val)
if (!val) {
- val = empty_string;
+ val = "";
}
php_info_print_table_row(2, key, val);
APR_ARRAY_FOREACH_CLOSE()
char *key, *val;
APR_ARRAY_FOREACH_OPEN(arr, key, val)
- if (!val) val = empty_string;
+ if (!val) val = "";
php_register_variable(key, val, track_vars_array TSRMLS_CC);
APR_ARRAY_FOREACH_CLOSE()
if (elts[i].val) {
val = elts[i].val;
} else {
- val = empty_string;
+ val = "";
}
php_register_variable(elts[i].key, val, track_vars_array TSRMLS_CC);
}