[PHP-CVS] cvs: php-src(PHP_5_3) /ext/xsl xsltprocessor.c

2009-05-23 Thread Felipe Pena
felipe  Sat May 23 14:26:47 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/xslxsltprocessor.c 
  Log:
  - Fix error message
  
http://cvs.php.net/viewvc.cgi/php-src/ext/xsl/xsltprocessor.c?r1=1.39.2.2.2.9.2.17&r2=1.39.2.2.2.9.2.18&diff_format=u
Index: php-src/ext/xsl/xsltprocessor.c
diff -u php-src/ext/xsl/xsltprocessor.c:1.39.2.2.2.9.2.17 
php-src/ext/xsl/xsltprocessor.c:1.39.2.2.2.9.2.18
--- php-src/ext/xsl/xsltprocessor.c:1.39.2.2.2.9.2.17   Sun May 10 19:59:47 2009
+++ php-src/ext/xsl/xsltprocessor.c Sat May 23 14:26:47 2009
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: xsltprocessor.c,v 1.39.2.2.2.9.2.17 2009/05/10 19:59:47 davidc Exp $ */
+/* $Id: xsltprocessor.c,v 1.39.2.2.2.9.2.18 2009/05/23 14:26:47 felipe Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -316,7 +316,7 @@
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call 
handler %s()", callable);

} else if ( intern->registerPhpFunctions == 2 && 
zend_hash_exists(intern->registered_phpfunctions, callable, strlen(callable) + 
1) == 0) { 
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not allowed to 
call handler '%s()'.", callable);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not allowed to 
call handler '%s()'", callable);
/* Push an empty string, so that we at least have an xslt 
result... */
valuePush(ctxt, xmlXPathNewString(""));
} else {



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/xsl xsltprocessor.c

2009-05-10 Thread David Coallier
davidc  Sun May 10 19:59:47 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/xslxsltprocessor.c 
  Log:
  - Removed the RETURN_TRUE to keep consistency with documentation. This 
function
is supposed to be "void registerPHPFunctions"
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/xsl/xsltprocessor.c?r1=1.39.2.2.2.9.2.16&r2=1.39.2.2.2.9.2.17&diff_format=u
Index: php-src/ext/xsl/xsltprocessor.c
diff -u php-src/ext/xsl/xsltprocessor.c:1.39.2.2.2.9.2.16 
php-src/ext/xsl/xsltprocessor.c:1.39.2.2.2.9.2.17
--- php-src/ext/xsl/xsltprocessor.c:1.39.2.2.2.9.2.16   Sun May 10 15:13:05 2009
+++ php-src/ext/xsl/xsltprocessor.c Sun May 10 19:59:47 2009
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: xsltprocessor.c,v 1.39.2.2.2.9.2.16 2009/05/10 15:13:05 felipe Exp $ */
+/* $Id: xsltprocessor.c,v 1.39.2.2.2.9.2.17 2009/05/10 19:59:47 davidc Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -814,7 +814,6 @@
zend_hash_move_forward(Z_ARRVAL_P(array_value));
}
intern->registerPhpFunctions = 2;
-   RETURN_TRUE;
 
} else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, 
ZEND_NUM_ARGS() TSRMLS_CC, "s",  &name, &name_len) == SUCCESS) {
intern = (xsl_object *)zend_object_store_get_object(id 
TSRMLS_CC);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/xsl xsltprocessor.c /ext/xsl/tests bug48221.phpt

2009-05-10 Thread Felipe Pena
felipe  Sun May 10 15:13:05 2009 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/xsl/tests  bug48221.phpt 

  Modified files:  
/php-src/ext/xslxsltprocessor.c 
  Log:
  - MFH: Fixed bug #48221 (memory leak when passing invalid xslt parameter)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/xsl/xsltprocessor.c?r1=1.39.2.2.2.9.2.15&r2=1.39.2.2.2.9.2.16&diff_format=u
Index: php-src/ext/xsl/xsltprocessor.c
diff -u php-src/ext/xsl/xsltprocessor.c:1.39.2.2.2.9.2.15 
php-src/ext/xsl/xsltprocessor.c:1.39.2.2.2.9.2.16
--- php-src/ext/xsl/xsltprocessor.c:1.39.2.2.2.9.2.15   Wed Dec 31 11:15:47 2008
+++ php-src/ext/xsl/xsltprocessor.c Sun May 10 15:13:05 2009
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: xsltprocessor.c,v 1.39.2.2.2.9.2.15 2008/12/31 11:15:47 sebastian Exp 
$ */
+/* $Id: xsltprocessor.c,v 1.39.2.2.2.9.2.16 2009/05/10 15:13:05 felipe Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -153,11 +153,13 @@
if (!xpath_params) {
xpath_expr = 
php_xsl_xslt_string_to_xpathexpr(Z_STRVAL_PP(value) TSRMLS_CC);
} else {
-   xpath_expr = estrndup(Z_STRVAL_PP(value), 
strlen(Z_STRVAL_PP(value)));
+   xpath_expr = estrndup(Z_STRVAL_PP(value), 
Z_STRLEN_PP(value));
}
if (xpath_expr) {
params[i++] = string_key;
params[i++] = xpath_expr;
+   } else {
+   efree(string_key);
}
}
}

http://cvs.php.net/viewvc.cgi/php-src/ext/xsl/tests/bug48221.phpt?view=markup&rev=1.1
Index: php-src/ext/xsl/tests/bug48221.phpt
+++ php-src/ext/xsl/tests/bug48221.phpt
--TEST--
Bug #48221 (memory leak when passing invalid xslt parameter)
--SKIPIF--

--FILE--
loadXML('http://www.w3.org/1999/XSL/Transform";
  lang="en">

Sales Results By Division




Division
Revenue
Growth
Bonus














 
 color:red
 










');

$dom = new DOMDocument;
$dom->loadXMl('


10
9
7



4
3
4



6
-1.5
2


');

$proc = new xsltprocessor;
$proc->importStylesheet($xsl);
$proc->setParameter('', '', '"\'');
$proc->transformToXml($dom);

?>
--EXPECTF--
Warning: XSLTProcessor::transformToXml(): Cannot create XPath expression 
(string contains both quote and double-quotes) in %s on line %d



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/xsl xsltprocessor.c

2008-12-05 Thread Rob Richards
rrichards   Fri Dec  5 18:35:43 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/xslxsltprocessor.c 
  Log:
  MFH: fix arginfo - these also accept SimpleXMLElement
  
http://cvs.php.net/viewvc.cgi/php-src/ext/xsl/xsltprocessor.c?r1=1.39.2.2.2.9.2.13&r2=1.39.2.2.2.9.2.14&diff_format=u
Index: php-src/ext/xsl/xsltprocessor.c
diff -u php-src/ext/xsl/xsltprocessor.c:1.39.2.2.2.9.2.13 
php-src/ext/xsl/xsltprocessor.c:1.39.2.2.2.9.2.14
--- php-src/ext/xsl/xsltprocessor.c:1.39.2.2.2.9.2.13   Thu Nov 27 19:01:23 2008
+++ php-src/ext/xsl/xsltprocessor.c Fri Dec  5 18:35:43 2008
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: xsltprocessor.c,v 1.39.2.2.2.9.2.13 2008/11/27 19:01:23 dmitry Exp $ */
+/* $Id: xsltprocessor.c,v 1.39.2.2.2.9.2.14 2008/12/05 18:35:43 rrichards Exp 
$ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -29,20 +29,20 @@
 
 /* {{{ arginfo */
 ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_import_stylesheet, 0, 0, 1)
-   ZEND_ARG_OBJ_INFO(0, doc, DOMDocument, 0)
+   ZEND_ARG_INFO(0, doc)
 ZEND_END_ARG_INFO();
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_transform_to_doc, 0, 0, 1)
-   ZEND_ARG_OBJ_INFO(0, doc, DOMNode, 0)
+   ZEND_ARG_INFO(0, doc)
 ZEND_END_ARG_INFO();
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_transform_to_uri, 0, 0, 2)
-   ZEND_ARG_OBJ_INFO(0, doc, DOMDocument, 0)
+   ZEND_ARG_INFO(0, doc)
ZEND_ARG_INFO(0, uri)
 ZEND_END_ARG_INFO();
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_transform_to_xml, 0, 0, 1)
-   ZEND_ARG_OBJ_INFO(0, doc, DOMDocument, 0)
+   ZEND_ARG_INFO(0, doc)
 ZEND_END_ARG_INFO();
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_set_parameter, 0, 0, 2)



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/xsl xsltprocessor.c

2008-05-04 Thread Rob Richards
rrichards   Sun May  4 15:14:23 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/xslxsltprocessor.c 
  Log:
  MFH: fix bug #44891 Memory leak using registerPHPFunctions and XSLT Variable
  
http://cvs.php.net/viewvc.cgi/php-src/ext/xsl/xsltprocessor.c?r1=1.39.2.2.2.9.2.7&r2=1.39.2.2.2.9.2.8&diff_format=u
Index: php-src/ext/xsl/xsltprocessor.c
diff -u php-src/ext/xsl/xsltprocessor.c:1.39.2.2.2.9.2.7 
php-src/ext/xsl/xsltprocessor.c:1.39.2.2.2.9.2.8
--- php-src/ext/xsl/xsltprocessor.c:1.39.2.2.2.9.2.7Tue Jan 29 21:21:20 2008
+++ php-src/ext/xsl/xsltprocessor.c Sun May  4 15:14:23 2008
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: xsltprocessor.c,v 1.39.2.2.2.9.2.7 2008/01/29 21:21:20 sebastian Exp $ 
*/
+/* $Id: xsltprocessor.c,v 1.39.2.2.2.9.2.8 2008/05/04 15:14:23 rrichards Exp $ 
*/
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -286,7 +286,9 @@
}
break;
default:
-   ZVAL_STRING(args[i], xmlXPathCastToString(obj), 1);
+   str = xmlXPathCastToString(obj);
+   ZVAL_STRING(args[i], str, 1);
+   xmlFree(str);
}
xmlXPathFreeObject(obj);
fci.params[i] = &args[i];



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/xsl xsltprocessor.c

2008-01-29 Thread Sebastian Bergmann
sebastian   Tue Jan 29 21:21:20 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/xslxsltprocessor.c 
  Log:
  MFH: Fix arginfo and prototype.
  
http://cvs.php.net/viewvc.cgi/php-src/ext/xsl/xsltprocessor.c?r1=1.39.2.2.2.9.2.6&r2=1.39.2.2.2.9.2.7&diff_format=u
Index: php-src/ext/xsl/xsltprocessor.c
diff -u php-src/ext/xsl/xsltprocessor.c:1.39.2.2.2.9.2.6 
php-src/ext/xsl/xsltprocessor.c:1.39.2.2.2.9.2.7
--- php-src/ext/xsl/xsltprocessor.c:1.39.2.2.2.9.2.6Tue Jan 29 07:51:43 2008
+++ php-src/ext/xsl/xsltprocessor.c Tue Jan 29 21:21:20 2008
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: xsltprocessor.c,v 1.39.2.2.2.9.2.6 2008/01/29 07:51:43 sebastian Exp $ 
*/
+/* $Id: xsltprocessor.c,v 1.39.2.2.2.9.2.7 2008/01/29 21:21:20 sebastian Exp $ 
*/
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -74,6 +74,7 @@
 
 static
 ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_register_php_functions, 0, 0, 
0)
+   ZEND_ARG_INFO(0, restrict)
 ZEND_END_ARG_INFO();
 
 static
@@ -796,7 +797,7 @@
 }
 /* }}} end xsl_xsltprocessor_remove_parameter */
 
-/* {{{ proto void xsl_xsltprocessor_register_php_functions();
+/* {{{ proto void xsl_xsltprocessor_register_php_functions([mixed $restrict]);
 */
 PHP_FUNCTION(xsl_xsltprocessor_register_php_functions)
 {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/xsl xsltprocessor.c

2008-01-28 Thread Sebastian Bergmann
sebastian   Tue Jan 29 07:51:43 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/xslxsltprocessor.c 
  Log:
  MFH: Add Reflection API metadata for XSLTProcessor.
  
http://cvs.php.net/viewvc.cgi/php-src/ext/xsl/xsltprocessor.c?r1=1.39.2.2.2.9.2.5&r2=1.39.2.2.2.9.2.6&diff_format=u
Index: php-src/ext/xsl/xsltprocessor.c
diff -u php-src/ext/xsl/xsltprocessor.c:1.39.2.2.2.9.2.5 
php-src/ext/xsl/xsltprocessor.c:1.39.2.2.2.9.2.6
--- php-src/ext/xsl/xsltprocessor.c:1.39.2.2.2.9.2.5Mon Dec 31 07:17:16 2007
+++ php-src/ext/xsl/xsltprocessor.c Tue Jan 29 07:51:43 2008
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: xsltprocessor.c,v 1.39.2.2.2.9.2.5 2007/12/31 07:17:16 sebastian Exp $ 
*/
+/* $Id: xsltprocessor.c,v 1.39.2.2.2.9.2.6 2008/01/29 07:51:43 sebastian Exp $ 
*/
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -27,6 +27,61 @@
 #include "php_xsl.h"
 #include "ext/libxml/php_libxml.h"
 
+/* {{{ arginfo */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_import_stylesheet, 0, 0, 1)
+   ZEND_ARG_OBJ_INFO(0, doc, DOMDocument, 0)
+ZEND_END_ARG_INFO();
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_transform_to_doc, 0, 0, 1)
+   ZEND_ARG_OBJ_INFO(0, doc, DOMNode, 0)
+ZEND_END_ARG_INFO();
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_transform_to_uri, 0, 0, 2)
+   ZEND_ARG_OBJ_INFO(0, doc, DOMDocument, 0)
+   ZEND_ARG_INFO(0, uri)
+ZEND_END_ARG_INFO();
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_transform_to_xml, 0, 0, 1)
+   ZEND_ARG_OBJ_INFO(0, doc, DOMDocument, 0)
+ZEND_END_ARG_INFO();
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_set_parameter, 0, 0, 2)
+   ZEND_ARG_INFO(0, namespace)
+   ZEND_ARG_INFO(0, name)
+   ZEND_ARG_INFO(0, value)
+ZEND_END_ARG_INFO();
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_get_parameter, 0, 0, 2)
+   ZEND_ARG_INFO(0, namespace)
+   ZEND_ARG_INFO(0, name)
+ZEND_END_ARG_INFO();
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_remove_parameter, 0, 0, 2)
+   ZEND_ARG_INFO(0, namespace)
+   ZEND_ARG_INFO(0, name)
+ZEND_END_ARG_INFO();
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_has_exslt_support, 0, 0, 0)
+ZEND_END_ARG_INFO();
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_register_php_functions, 0, 0, 
0)
+ZEND_END_ARG_INFO();
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_set_profiling, 0, 0, 1)
+   ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO();
+/* }}} */
+
 /*
 * class xsl_xsltprocessor 
 *
@@ -35,16 +90,16 @@
 */
 
 const zend_function_entry php_xsl_xsltprocessor_class_functions[] = {
-   PHP_FALIAS(importStylesheet, xsl_xsltprocessor_import_stylesheet, NULL)
-   PHP_FALIAS(transformToDoc, xsl_xsltprocessor_transform_to_doc, NULL)
-   PHP_FALIAS(transformToUri, xsl_xsltprocessor_transform_to_uri, NULL)
-   PHP_FALIAS(transformToXml, xsl_xsltprocessor_transform_to_xml, NULL)
-   PHP_FALIAS(setParameter, xsl_xsltprocessor_set_parameter, NULL)
-   PHP_FALIAS(getParameter, xsl_xsltprocessor_get_parameter, NULL)
-   PHP_FALIAS(removeParameter, xsl_xsltprocessor_remove_parameter, NULL)
-   PHP_FALIAS(hasExsltSupport, xsl_xsltprocessor_has_exslt_support, NULL)
-   PHP_FALIAS(registerPHPFunctions, 
xsl_xsltprocessor_register_php_functions, NULL)
-   PHP_FALIAS(setProfiling, xsl_xsltprocessor_set_profiling, NULL)
+   PHP_FALIAS(importStylesheet, xsl_xsltprocessor_import_stylesheet, 
arginfo_xsl_xsltprocessor_import_stylesheet)
+   PHP_FALIAS(transformToDoc, xsl_xsltprocessor_transform_to_doc, 
arginfo_xsl_xsltprocessor_transform_to_doc)
+   PHP_FALIAS(transformToUri, xsl_xsltprocessor_transform_to_uri, 
arginfo_xsl_xsltprocessor_transform_to_uri)
+   PHP_FALIAS(transformToXml, xsl_xsltprocessor_transform_to_xml, 
arginfo_xsl_xsltprocessor_transform_to_xml)
+   PHP_FALIAS(setParameter, xsl_xsltprocessor_set_parameter, 
arginfo_xsl_xsltprocessor_set_parameter)
+   PHP_FALIAS(getParameter, xsl_xsltprocessor_get_parameter, 
arginfo_xsl_xsltprocessor_get_parameter)
+   PHP_FALIAS(removeParameter, xsl_xsltprocessor_remove_parameter, 
arginfo_xsl_xsltprocessor_remove_parameter)
+   PHP_FALIAS(hasExsltSupport, xsl_xsltprocessor_has_exslt_support, 
arginfo_xsl_xsltprocessor_has_exslt_support)
+   PHP_FALIAS(registerPHPFunctions, 
xsl_xsltprocessor_register_php_functions, 
arginfo_xsl_xsltprocessor_register_php_functions)
+   PHP_FALIAS(setProfiling, xsl_xsltprocessor_set_profiling, 
arginfo_xsl_xsltprocessor_set_profiling)
{NULL, NULL, NULL}
 };
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php