summaryrefslogtreecommitdiff
path: root/ext/tidy/tidy.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2015-06-30 04:05:24 +0300
committerDmitry Stogov <dmitry@zend.com>2015-06-30 04:05:24 +0300
commit4a2e40bb861bc3cf5fb6863e57486ed60316e97c (patch)
tree6579660b282fdd1bc50095e48d702913a0b6aa97 /ext/tidy/tidy.c
parent8cce5b2641fb91c3073018b59f6f044b843041a8 (diff)
downloadphp-git-4a2e40bb861bc3cf5fb6863e57486ed60316e97c.tar.gz
Use ZSTR_ API to access zend_string elements (this is just renaming without semantick changes).
Diffstat (limited to 'ext/tidy/tidy.c')
-rw-r--r--ext/tidy/tidy.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/ext/tidy/tidy.c b/ext/tidy/tidy.c
index e1c13e6515..edd0bcf85e 100644
--- a/ext/tidy/tidy.c
+++ b/ext/tidy/tidy.c
@@ -567,7 +567,7 @@ static void php_tidy_quick_repair(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_fil
if (zend_parse_parameters(ZEND_NUM_ARGS(), "P|zsb", &arg1, &config, &enc, &enc_len, &use_include_path) == FAILURE) {
RETURN_FALSE;
}
- if (!(data = php_tidy_file_to_mem(arg1->val, use_include_path))) {
+ if (!(data = php_tidy_file_to_mem(ZSTR_VAL(arg1), use_include_path))) {
RETURN_FALSE;
}
} else {
@@ -608,7 +608,7 @@ static void php_tidy_quick_repair(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_fil
TidyBuffer buf;
tidyBufInit(&buf);
- tidyBufAttach(&buf, (byte *) data->val, data->len);
+ tidyBufAttach(&buf, (byte *) ZSTR_VAL(data), ZSTR_LEN(data));
if (tidyParseBuffer(doc, &buf) < 0) {
php_error_docref(NULL, E_WARNING, "%s", errbuf->bp);
@@ -998,7 +998,7 @@ static int _php_tidy_apply_config_array(TidyDoc doc, HashTable *ht_options)
if (opt_name == NULL) {
continue;
}
- _php_tidy_set_tidy_opt(doc, opt_name->val, opt_val);
+ _php_tidy_set_tidy_opt(doc, ZSTR_VAL(opt_name), opt_val);
} ZEND_HASH_FOREACH_END();
return SUCCESS;
@@ -1086,14 +1086,14 @@ static PHP_INI_MH(php_tidy_set_clean_output)
int status;
zend_bool value;
- if (new_value->len==2 && strcasecmp("on", new_value->val)==0) {
+ if (ZSTR_LEN(new_value)==2 && strcasecmp("on", ZSTR_VAL(new_value))==0) {
value = (zend_bool) 1;
- } else if (new_value->len==3 && strcasecmp("yes", new_value->val)==0) {
+ } else if (ZSTR_LEN(new_value)==3 && strcasecmp("yes", ZSTR_VAL(new_value))==0) {
value = (zend_bool) 1;
- } else if (new_value->len==4 && strcasecmp("true", new_value->val)==0) {
+ } else if (ZSTR_LEN(new_value)==4 && strcasecmp("true", ZSTR_VAL(new_value))==0) {
value = (zend_bool) 1;
} else {
- value = (zend_bool) atoi(new_value->val);
+ value = (zend_bool) atoi(ZSTR_VAL(new_value));
}
if (stage == PHP_INI_STAGE_RUNTIME) {
@@ -1202,7 +1202,7 @@ static PHP_FUNCTION(tidy_parse_string)
TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options);
- if (php_tidy_parse_string(obj, input->val, input->len, enc) == FAILURE) {
+ if (php_tidy_parse_string(obj, ZSTR_VAL(input), ZSTR_LEN(input), enc) == FAILURE) {
zval_ptr_dtor(return_value);
RETURN_FALSE;
}
@@ -1258,14 +1258,14 @@ static PHP_FUNCTION(tidy_parse_file)
tidy_instanciate(tidy_ce_doc, return_value);
obj = Z_TIDY_P(return_value);
- if (!(contents = php_tidy_file_to_mem(inputfile->val, use_include_path))) {
- php_error_docref(NULL, E_WARNING, "Cannot Load '%s' into memory%s", inputfile->val, (use_include_path) ? " (Using include path)" : "");
+ if (!(contents = php_tidy_file_to_mem(ZSTR_VAL(inputfile), use_include_path))) {
+ php_error_docref(NULL, E_WARNING, "Cannot Load '%s' into memory%s", ZSTR_VAL(inputfile), (use_include_path) ? " (Using include path)" : "");
RETURN_FALSE;
}
TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options);
- if (php_tidy_parse_string(obj, contents->val, contents->len, enc) == FAILURE) {
+ if (php_tidy_parse_string(obj, ZSTR_VAL(contents), ZSTR_LEN(contents), enc) == FAILURE) {
zval_ptr_dtor(return_value);
RETVAL_FALSE;
}
@@ -1571,14 +1571,14 @@ static TIDY_DOC_METHOD(__construct)
obj = Z_TIDY_P(object);
if (inputfile) {
- if (!(contents = php_tidy_file_to_mem(inputfile->val, use_include_path))) {
- php_error_docref(NULL, E_WARNING, "Cannot Load '%s' into memory%s", inputfile->val, (use_include_path) ? " (Using include path)" : "");
+ if (!(contents = php_tidy_file_to_mem(ZSTR_VAL(inputfile), use_include_path))) {
+ php_error_docref(NULL, E_WARNING, "Cannot Load '%s' into memory%s", ZSTR_VAL(inputfile), (use_include_path) ? " (Using include path)" : "");
return;
}
TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options);
- php_tidy_parse_string(obj, contents->val, contents->len, enc);
+ php_tidy_parse_string(obj, ZSTR_VAL(contents), ZSTR_LEN(contents), enc);
zend_string_release(contents);
}
@@ -1602,14 +1602,14 @@ static TIDY_DOC_METHOD(parseFile)
RETURN_FALSE;
}
- if (!(contents = php_tidy_file_to_mem(inputfile->val, use_include_path))) {
- php_error_docref(NULL, E_WARNING, "Cannot Load '%s' into memory%s", inputfile->val, (use_include_path) ? " (Using include path)" : "");
+ if (!(contents = php_tidy_file_to_mem(ZSTR_VAL(inputfile), use_include_path))) {
+ php_error_docref(NULL, E_WARNING, "Cannot Load '%s' into memory%s", ZSTR_VAL(inputfile), (use_include_path) ? " (Using include path)" : "");
RETURN_FALSE;
}
TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options);
- if (php_tidy_parse_string(obj, contents->val, contents->len, enc) == FAILURE) {
+ if (php_tidy_parse_string(obj, ZSTR_VAL(contents), ZSTR_LEN(contents), enc) == FAILURE) {
RETVAL_FALSE;
} else {
RETVAL_TRUE;
@@ -1636,7 +1636,7 @@ static TIDY_DOC_METHOD(parseString)
TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options);
- if(php_tidy_parse_string(obj, input->val, input->len, enc) == SUCCESS) {
+ if(php_tidy_parse_string(obj, ZSTR_VAL(input), ZSTR_LEN(input), enc) == SUCCESS) {
RETURN_TRUE;
}