|
50 | 50 | /* {{{ ext/tidy macros */ |
51 | 51 | #define FIX_BUFFER(bptr) do { if ((bptr)->size) { (bptr)->bp[(bptr)->size-1] = '\0'; } } while(0) |
52 | 52 |
|
53 | | -#define TIDY_SET_CONTEXT \ |
54 | | - zval *object = getThis(); |
55 | | - |
56 | 53 | #define TIDY_FETCH_OBJECT \ |
57 | 54 | PHPTidyObj *obj; \ |
58 | 55 | zval *object; \ |
|
70 | 67 |
|
71 | 68 | #define TIDY_FETCH_ONLY_OBJECT \ |
72 | 69 | PHPTidyObj *obj; \ |
73 | | - TIDY_SET_CONTEXT; \ |
74 | 70 | if (zend_parse_parameters_none() != SUCCESS) { \ |
75 | 71 | RETURN_THROWS(); \ |
76 | 72 | } \ |
77 | | - obj = Z_TIDY_P(object); \ |
| 73 | + obj = Z_TIDY_P(ZEND_THIS); \ |
78 | 74 |
|
79 | 75 | #define TIDY_SET_DEFAULT_CONFIG(_doc) \ |
80 | 76 | if (TG(default_config) && TG(default_config)[0]) { \ |
@@ -1368,8 +1364,7 @@ PHP_METHOD(tidy, __construct) |
1368 | 1364 | Z_PARAM_BOOL(use_include_path) |
1369 | 1365 | ZEND_PARSE_PARAMETERS_END(); |
1370 | 1366 |
|
1371 | | - TIDY_SET_CONTEXT; |
1372 | | - obj = Z_TIDY_P(object); |
| 1367 | + obj = Z_TIDY_P(ZEND_THIS); |
1373 | 1368 |
|
1374 | 1369 | if (inputfile) { |
1375 | 1370 | if (!(contents = php_tidy_file_to_mem(ZSTR_VAL(inputfile), use_include_path))) { |
@@ -1415,8 +1410,7 @@ PHP_METHOD(tidy, parseFile) |
1415 | 1410 | Z_PARAM_BOOL(use_include_path) |
1416 | 1411 | ZEND_PARSE_PARAMETERS_END(); |
1417 | 1412 |
|
1418 | | - TIDY_SET_CONTEXT; |
1419 | | - obj = Z_TIDY_P(object); |
| 1413 | + obj = Z_TIDY_P(ZEND_THIS); |
1420 | 1414 |
|
1421 | 1415 | if (!(contents = php_tidy_file_to_mem(ZSTR_VAL(inputfile), use_include_path))) { |
1422 | 1416 | php_error_docref(NULL, E_WARNING, "Cannot load \"%s\" into memory%s", ZSTR_VAL(inputfile), (use_include_path) ? " (using include path)" : ""); |
@@ -1455,8 +1449,7 @@ PHP_METHOD(tidy, parseString) |
1455 | 1449 | RETURN_THROWS(); |
1456 | 1450 | } |
1457 | 1451 |
|
1458 | | - TIDY_SET_CONTEXT; |
1459 | | - obj = Z_TIDY_P(object); |
| 1452 | + obj = Z_TIDY_P(ZEND_THIS); |
1460 | 1453 |
|
1461 | 1454 | RETURN_BOOL(php_tidy_apply_config(obj->ptdoc->doc, options_str, options_ht, 2) == SUCCESS |
1462 | 1455 | && php_tidy_parse_string(obj, ZSTR_VAL(input), (uint32_t)ZSTR_LEN(input), enc) == SUCCESS); |
|
0 commit comments