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

Patch html_parse_compat.patch for html_parse Bug #65563

Patch version 2013-09-06 13:38 UTC

Return to Bug #65563 | Download this patch
Patch Revisions:

Developer: krakjoe@php.net

diff -uNr html_parse-1.0.0-virgin/html_parse.c html_parse-1.0.0-patched/html_parse.c
--- html_parse-1.0.0-virgin/html_parse.c	2007-11-28 22:35:42.000000000 +0000
+++ html_parse-1.0.0-patched/html_parse.c	2013-09-06 14:37:03.648830964 +0100
@@ -148,7 +148,11 @@
 /* }}} */
 
 /* {{{ html_parse_functions[] */
-function_entry html_parse_functions[] = {
+#if PHP_VERSION_ID <= 50299
+    function_entry html_parse_functions[] = {
+#else
+    zend_function_entry html_parse_functions[] = {
+#endif
 	PHP_FE(html_parser_create  , html_parser_create_arg_info)
 	PHP_FE(html_parser_free    , html_parser_free_arg_info)
 	PHP_FE(html_parser_starttag_handler, html_parser_starttag_handler_arg_info)
@@ -319,15 +323,22 @@
 		return;
 	}
 	ZEND_FETCH_RESOURCE(parser, php_html_parser *, &parser_res, parser_resid, "html_parser", le_html_parser);
-	if (!zend_is_callable(handler, 0, NULL)) {
-	  php_error(E_WARNING, "Invalid comparison function.");
-	  return;    }
-
-
+#if PHP_VERSION_ID <= 50299
+    if (!zend_is_callable(handler, 0, NULL)) {
+#else
+    if (!zend_is_callable(handler, 0, NULL TSRMLS_CC)) {
+#endif
+      php_error(E_WARNING, "Invalid comparison function.");
+	  return;
+	}
 
 	do {
 		/* parameter check */
-		if (!zend_is_callable(handler, 0, NULL)) {
+#if PHP_VERSION_ID <= 50299
+        if (!zend_is_callable(handler, 0, NULL)) {
+#else
+        if (!zend_is_callable(handler, 0, NULL TSRMLS_CC)) {
+#endif
 		  php_error_docref(NULL TSRMLS_CC, E_WARNING, "2nd argument is not a valid callback");
 		  RETURN_FALSE;
 		}
@@ -364,14 +375,22 @@
 		return;
 	}
 	ZEND_FETCH_RESOURCE(parser, php_html_parser *, &parser_res, parser_resid, "html_parser", le_html_parser);
-	if (!zend_is_callable(handler, 0, NULL)) {
-	  php_error(E_WARNING, "Invalid comparison function.");
-	  return;    }
-
+#if PHP_VERSION_ID <= 50299
+    if (!zend_is_callable(handler, 0, NULL)) {
+#else
+    if (!zend_is_callable(handler, 0, NULL TSRMLS_CC)) {
+#endif
+     php_error(E_WARNING, "Invalid comparison function.");
+	  return;   
+	}
 
 
 	do {
-		if (!zend_is_callable(handler, 0, NULL)) {
+#if PHP_VERSION_ID <= 50299
+        if (!zend_is_callable(handler, 0, NULL)) {
+#else
+        if (!zend_is_callable(handler, 0, NULL TSRMLS_CC)) {
+#endif
 		  php_error_docref(NULL TSRMLS_CC, E_WARNING, "2nd argument is not a valid callback");
 		  RETURN_FALSE;
 		}
@@ -403,14 +422,23 @@
 		return;
 	}
 	ZEND_FETCH_RESOURCE(parser, php_html_parser *, &parser_res, parser_resid, "html_parser", le_html_parser);
-	if (!zend_is_callable(handler, 0, NULL)) {
+#if PHP_VERSION_ID <= 50299
+    if (!zend_is_callable(handler, 0, NULL)) {
+#else
+    if (!zend_is_callable(handler, 0, NULL TSRMLS_CC)) {
+#endif
 	  php_error(E_WARNING, "Invalid comparison function.");
-	  return;    }
+	  return;    
+	}
 
 
 
 	do {
+#if PHP_VERSION_ID <= 50299
 		if (!zend_is_callable(handler, 0, NULL)) {
+#else
+		if (!zend_is_callable(handler, 0, NULL TSRMLS_CC)) {
+#endif
 		  php_error_docref(NULL TSRMLS_CC, E_WARNING, "2nd argument is not a valid callback");
 		  RETURN_FALSE;
 		}
@@ -442,15 +470,23 @@
 		return;
 	}
 	ZEND_FETCH_RESOURCE(parser, php_html_parser *, &parser_res, parser_resid, "html_parser", le_html_parser);
+#if PHP_VERSION_ID <= 50299
 	if (!zend_is_callable(handler, 0, NULL)) {
+#else
+    if (!zend_is_callable(handler, 0, NULL TSRMLS_CC)) {
+#endif
 	  php_error(E_WARNING, "Invalid comparison function.");
-	  return;    }
-
-
+	  return;    
+	}
 
 	do {
-		if (!zend_is_callable(handler, 0, NULL)) {    php_error_docref(NULL TSRMLS_CC, E_WARNING, "2nd argument is not a valid callback");
-		  RETURN_FALSE;
+#if PHP_VERSION_ID <= 50299
+		if (!zend_is_callable(handler, 0, NULL)) {    
+#else
+		if (!zend_is_callable(handler, 0, NULL TSRMLS_CC)) {    
+#endif
+		    php_error_docref(NULL TSRMLS_CC, E_WARNING, "2nd argument is not a valid callback");
+		    RETURN_FALSE;
 		}
 		if(parser->commentHandler) {
 		  zval_ptr_dtor(&parser->commentHandler);
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 10:01:28 2024 UTC