[PHP-CVS-DAILY] cvs: php-src / ChangeLog

2007-10-02 Thread changelog
changelog   Wed Oct  3 01:31:29 2007 UTC

  Modified files:  
/php-srcChangeLog 
  Log:
  ChangeLog update
  
http://cvs.php.net/viewvc.cgi/php-src/ChangeLog?r1=1.2826r2=1.2827diff_format=u
Index: php-src/ChangeLog
diff -u php-src/ChangeLog:1.2826 php-src/ChangeLog:1.2827
--- php-src/ChangeLog:1.2826Tue Oct  2 01:31:35 2007
+++ php-src/ChangeLog   Wed Oct  3 01:31:28 2007
@@ -1,3 +1,139 @@
+2007-10-02  Antony Dovgal  [EMAIL PROTECTED]
+
+* main/streams/unicode_filter.c:
+  ucnv_toUnicode() in ICU 3.8 requires target buffer size to be even,
+  otherwise it bails out with U_ILLEGAL_ARGUMENT_ERROR
+  this commit fixes endless loop (due to the absence of error catching) and
+  also fixes the cause of the error
+
+2007-10-02  Jani Taskinen  [EMAIL PROTECTED]
+
+* ZendEngine2/zend_ini_scanner.l:
+  - Use non-unicode input method (other one crashes for some reason in ZTS
+  mode)
+
+2007-10-02  Antony Dovgal  [EMAIL PROTECTED]
+
+* ext/standard/tests/strings/strcspn_variation10.phpt
+  ext/standard/tests/strings/strcspn_variation2.phpt:
+  fix tests
+
+* ext/standard/string.c:
+  make strcspn() behave the same way in both Unicode and native mode (bug
+  #42731)
+
+* (PHP_5_3)
+  ext/standard/tests/network/ip_x86_64.phpt:
+  fix test
+
+2007-10-02  Andrey Hristov  [EMAIL PROTECTED]
+
+* ext/mysql/package.xml
+  ext/mysql/php_mysql.c
+  ext/mysqli/mysqli.c
+  ext/mysqli/mysqli_api.c
+  ext/mysqli/mysqli_driver.c
+  ext/mysqli/mysqli_fe.c
+  ext/mysqli/mysqli_mysqlnd.h
+  ext/mysqli/mysqli_nonapi.c
+  ext/mysqli/mysqli_prop.c
+  ext/mysqli/mysqli_warning.c
+  ext/mysqli/php_mysqli_structs.h
+  ext/mysqlnd/config.w32
+  ext/mysqlnd/config9.m4
+  ext/mysqlnd/mysqlnd.c
+  ext/mysqlnd/mysqlnd.h
+  ext/mysqlnd/mysqlnd_charset.c
+  ext/mysqlnd/mysqlnd_charset.h
+  ext/mysqlnd/mysqlnd_debug.c
+  ext/mysqlnd/mysqlnd_debug.h
+  ext/mysqlnd/mysqlnd_enum_n_def.h
+  ext/mysqlnd/mysqlnd_loaddata.c
+  ext/mysqlnd/mysqlnd_palloc.c
+  ext/mysqlnd/mysqlnd_palloc.h
+  ext/mysqlnd/mysqlnd_priv.h
+  ext/mysqlnd/mysqlnd_ps.c
+  ext/mysqlnd/mysqlnd_ps_codec.c
+  ext/mysqlnd/mysqlnd_qcache.c
+  ext/mysqlnd/mysqlnd_result.c
+  ext/mysqlnd/mysqlnd_result.h
+  ext/mysqlnd/mysqlnd_result_meta.c
+  ext/mysqlnd/mysqlnd_result_meta.h
+  ext/mysqlnd/mysqlnd_statistics.c
+  ext/mysqlnd/mysqlnd_statistics.h
+  ext/mysqlnd/mysqlnd_structs.h
+  ext/mysqlnd/mysqlnd_wireprotocol.c
+  ext/mysqlnd/mysqlnd_wireprotocol.h
+  ext/mysqlnd/php_mysqlnd.h:
+  Update mysqlnd in HEAD
+  Updated ext/mysql and ext/mysqli in HEAD
+
+2007-10-02  Jani Taskinen  [EMAIL PROTECTED]
+
+* (PHP_5_3)
+  NEWS:
+  - There really is no point in mentioned fixed bugs in something that has
+  never been in any release..
+
+* NEWS:
+  fix news (stuff added in 5.3 wont be needed to mentioned here)
+
+2007-10-02  Antony Dovgal  [EMAIL PROTECTED]
+
+* ext/standard/array.c
+  ext/standard/array.c:
+  MF5_2: improved recursion detection in array_walk()
+  fixes #42752, though the leaks are still there
+
+* (PHP_5_2)
+  ext/standard/array.c:
+  improved recursion detection in array_walk()
+  fixes #42752, though the leaks are still there
+
+2007-10-02  Dmitry Stogov  [EMAIL PROTECTED]
+
+* ZendEngine2/zend_vm_def.h
+  ZendEngine2/zend_vm_def.h
+  ZendEngine2/zend_vm_execute.h
+  ZendEngine2/zend_vm_execute.h:
+  Fixed access to freed memory in tests/classes/__call_001.phpt
+
+* ZendEngine2/tests/bug42819.phpt
+  ZendEngine2/tests/bug42819.phpt:
+  
+  file bug42819.phpt was initially added on branch PHP_5_3.
+
+* (PHP_5_3)
+  NEWS
+  ZendEngine2/zend.h
+  ZendEngine2/zend.h
+  ZendEngine2/zend_compile.c
+  ZendEngine2/zend_compile.c
+  ZendEngine2/zend_execute_API.c
+  ZendEngine2/zend_execute_API.c
+  ZendEngine2/zend_vm_def.h
+  ZendEngine2/zend_vm_def.h
+  ZendEngine2/zend_vm_execute.h
+  ZendEngine2/zend_vm_execute.h
+  ZendEngine2/tests/bug42819.phpt:
+  Fixed bug #42819 (namespaces in indexes of constant arrays)
+
+2007-10-02  Christian Stocker  [EMAIL PROTECTED]
+
+* ext/xsl/php_xsl.c
+  ext/xsl/php_xsl.h
+  ext/xsl/xsl_fe.h
+  ext/xsl/xsltprocessor.c:
+  - Added xsl-setProfiling() for profiling stylesheets. (MFB)
+
+* (PHP_5_3)
+  NEWS
+  ext/xsl/php_xsl.c
+  ext/xsl/php_xsl.h
+  ext/xsl/xsl_fe.h
+  ext/xsl/xsltprocessor.c:
+  - Added xsl-setProfiling() for profiling stylesheets.
+
 2007-10-01  Johannes Schlüter  [EMAIL PROTECTED]
 
 * (PHP_5_3)


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

2007-10-02 Thread Christian Stocker
chregu  Tue Oct  2 06:31:18 2007 UTC

  Modified files:  (Branch: PHP_5_3)
/php-srcNEWS 
/php-src/ext/xslphp_xsl.c php_xsl.h xsl_fe.h xsltprocessor.c 
  Log:
  - Added xsl-setProfiling() for profiling stylesheets.
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.16r2=1.2027.2.547.2.965.2.17diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.16 
php-src/NEWS:1.2027.2.547.2.965.2.17
--- php-src/NEWS:1.2027.2.547.2.965.2.16Mon Oct  1 12:40:52 2007
+++ php-src/NEWSTue Oct  2 06:31:17 2007
@@ -1,6 +1,7 @@
 PHPNEWS
 |||
 ?? ??? 20??, PHP 5.3.0
+- Added xsl-setProfiling() for profiling stylesheets. (Christian)
 - Added long-option feature to getopt() and made getopt() available also on 
   win32 systems by adding a common getopt implementation to core.
   (Jani, David Soria Parra)
http://cvs.php.net/viewvc.cgi/php-src/ext/xsl/php_xsl.c?r1=1.32.2.6.2.2.2.2r2=1.32.2.6.2.2.2.3diff_format=u
Index: php-src/ext/xsl/php_xsl.c
diff -u php-src/ext/xsl/php_xsl.c:1.32.2.6.2.2.2.2 
php-src/ext/xsl/php_xsl.c:1.32.2.6.2.2.2.3
--- php-src/ext/xsl/php_xsl.c:1.32.2.6.2.2.2.2  Fri Sep 28 05:33:11 2007
+++ php-src/ext/xsl/php_xsl.c   Tue Oct  2 06:31:17 2007
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: php_xsl.c,v 1.32.2.6.2.2.2.2 2007/09/28 05:33:11 tony2001 Exp $ */
+/* $Id: php_xsl.c,v 1.32.2.6.2.2.2.3 2007/10/02 06:31:17 chregu Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -123,6 +123,7 @@
intern-registered_phpfunctions = NULL;
intern-node_list = NULL;
intern-doc = NULL;
+   intern-profiling = NULL;
 
zend_object_std_init(intern-std, class_type TSRMLS_CC);
zend_hash_copy(intern-std.properties, class_type-default_properties, 
(copy_ctor_func_t) zval_add_ref, (void *) tmp, sizeof(zval *));
http://cvs.php.net/viewvc.cgi/php-src/ext/xsl/php_xsl.h?r1=1.15.2.1.2.1r2=1.15.2.1.2.1.2.1diff_format=u
Index: php-src/ext/xsl/php_xsl.h
diff -u php-src/ext/xsl/php_xsl.h:1.15.2.1.2.1 
php-src/ext/xsl/php_xsl.h:1.15.2.1.2.1.2.1
--- php-src/ext/xsl/php_xsl.h:1.15.2.1.2.1  Mon Jan  1 09:36:10 2007
+++ php-src/ext/xsl/php_xsl.h   Tue Oct  2 06:31:17 2007
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: php_xsl.h,v 1.15.2.1.2.1 2007/01/01 09:36:10 sebastian Exp $ */
+/* $Id: php_xsl.h,v 1.15.2.1.2.1.2.1 2007/10/02 06:31:17 chregu Exp $ */
 
 #ifndef PHP_XSL_H
 #define PHP_XSL_H
@@ -60,6 +60,7 @@
HashTable *registered_phpfunctions;
HashTable *node_list;
php_libxml_node_object *doc;
+   char *profiling;
 } xsl_object;
 
 void php_xsl_set_object(zval *wrapper, void *obj TSRMLS_DC);
http://cvs.php.net/viewvc.cgi/php-src/ext/xsl/xsl_fe.h?r1=1.8.2.1.2.1.2.1r2=1.8.2.1.2.1.2.2diff_format=u
Index: php-src/ext/xsl/xsl_fe.h
diff -u php-src/ext/xsl/xsl_fe.h:1.8.2.1.2.1.2.1 
php-src/ext/xsl/xsl_fe.h:1.8.2.1.2.1.2.2
--- php-src/ext/xsl/xsl_fe.h:1.8.2.1.2.1.2.1Thu Sep 27 18:00:46 2007
+++ php-src/ext/xsl/xsl_fe.hTue Oct  2 06:31:18 2007
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: xsl_fe.h,v 1.8.2.1.2.1.2.1 2007/09/27 18:00:46 dmitry Exp $ */
+/* $Id: xsl_fe.h,v 1.8.2.1.2.1.2.2 2007/10/02 06:31:18 chregu Exp $ */
 
 #ifndef XSL_FE_H
 #define XSL_FE_H
@@ -33,4 +33,5 @@
 PHP_FUNCTION(xsl_xsltprocessor_remove_parameter);
 PHP_FUNCTION(xsl_xsltprocessor_has_exslt_support);
 PHP_FUNCTION(xsl_xsltprocessor_register_php_functions);
+PHP_FUNCTION(xsl_xsltprocessor_set_profiling);
 #endif
http://cvs.php.net/viewvc.cgi/php-src/ext/xsl/xsltprocessor.c?r1=1.39.2.2.2.9.2.1r2=1.39.2.2.2.9.2.2diff_format=u
Index: php-src/ext/xsl/xsltprocessor.c
diff -u php-src/ext/xsl/xsltprocessor.c:1.39.2.2.2.9.2.1 
php-src/ext/xsl/xsltprocessor.c:1.39.2.2.2.9.2.2
--- php-src/ext/xsl/xsltprocessor.c:1.39.2.2.2.9.2.1Thu Sep 27 18:00:46 2007
+++ php-src/ext/xsl/xsltprocessor.c Tue Oct  2 06:31:18 2007
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: xsltprocessor.c,v 1.39.2.2.2.9.2.1 2007/09/27 18:00:46 dmitry Exp $ */
+/* $Id: xsltprocessor.c,v 1.39.2.2.2.9.2.2 2007/10/02 06:31:18 chregu Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -44,6 +44,7 @@
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)
{NULL, NULL, NULL}
 };
 
@@ -424,6 +425,7 @@
int clone;
zval *doXInclude, *member;
zend_object_handlers 

[PHP-CVS] cvs: php-src /ext/xsl php_xsl.c php_xsl.h xsl_fe.h xsltprocessor.c

2007-10-02 Thread Christian Stocker
chregu  Tue Oct  2 06:32:17 2007 UTC

  Modified files:  
/php-src/ext/xslphp_xsl.c php_xsl.h xsl_fe.h xsltprocessor.c 
  Log:
  - Added xsl-setProfiling() for profiling stylesheets. (MFB)
  
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/xsl/php_xsl.c?r1=1.43r2=1.44diff_format=u
Index: php-src/ext/xsl/php_xsl.c
diff -u php-src/ext/xsl/php_xsl.c:1.43 php-src/ext/xsl/php_xsl.c:1.44
--- php-src/ext/xsl/php_xsl.c:1.43  Fri Sep 28 05:32:41 2007
+++ php-src/ext/xsl/php_xsl.c   Tue Oct  2 06:32:16 2007
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: php_xsl.c,v 1.43 2007/09/28 05:32:41 tony2001 Exp $ */
+/* $Id: php_xsl.c,v 1.44 2007/10/02 06:32:16 chregu Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -123,6 +123,7 @@
intern-registered_phpfunctions = NULL;
intern-node_list = NULL;
intern-doc = NULL;
+   intern-profiling = NULL;
 
zend_object_std_init(intern-std, class_type TSRMLS_CC);
zend_hash_copy(intern-std.properties, class_type-default_properties, 
(copy_ctor_func_t) zval_add_ref, (void *) tmp, sizeof(zval *));
http://cvs.php.net/viewvc.cgi/php-src/ext/xsl/php_xsl.h?r1=1.17r2=1.18diff_format=u
Index: php-src/ext/xsl/php_xsl.h
diff -u php-src/ext/xsl/php_xsl.h:1.17 php-src/ext/xsl/php_xsl.h:1.18
--- php-src/ext/xsl/php_xsl.h:1.17  Mon Jan  1 09:29:34 2007
+++ php-src/ext/xsl/php_xsl.h   Tue Oct  2 06:32:16 2007
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: php_xsl.h,v 1.17 2007/01/01 09:29:34 sebastian Exp $ */
+/* $Id: php_xsl.h,v 1.18 2007/10/02 06:32:16 chregu Exp $ */
 
 #ifndef PHP_XSL_H
 #define PHP_XSL_H
@@ -60,6 +60,7 @@
HashTable *registered_phpfunctions;
HashTable *node_list;
php_libxml_node_object *doc;
+   char *profiling;
 } xsl_object;
 
 void php_xsl_set_object(zval *wrapper, void *obj TSRMLS_DC);
http://cvs.php.net/viewvc.cgi/php-src/ext/xsl/xsl_fe.h?r1=1.12r2=1.13diff_format=u
Index: php-src/ext/xsl/xsl_fe.h
diff -u php-src/ext/xsl/xsl_fe.h:1.12 php-src/ext/xsl/xsl_fe.h:1.13
--- php-src/ext/xsl/xsl_fe.h:1.12   Fri Sep 28 05:32:07 2007
+++ php-src/ext/xsl/xsl_fe.hTue Oct  2 06:32:16 2007
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: xsl_fe.h,v 1.12 2007/09/28 05:32:07 tony2001 Exp $ */
+/* $Id: xsl_fe.h,v 1.13 2007/10/02 06:32:16 chregu Exp $ */
 
 #ifndef XSL_FE_H
 #define XSL_FE_H
@@ -33,4 +33,5 @@
 PHP_FUNCTION(xsl_xsltprocessor_remove_parameter);
 PHP_FUNCTION(xsl_xsltprocessor_has_exslt_support);
 PHP_FUNCTION(xsl_xsltprocessor_register_php_functions);
+PHP_FUNCTION(xsl_xsltprocessor_set_profiling);
 #endif
http://cvs.php.net/viewvc.cgi/php-src/ext/xsl/xsltprocessor.c?r1=1.57r2=1.58diff_format=u
Index: php-src/ext/xsl/xsltprocessor.c
diff -u php-src/ext/xsl/xsltprocessor.c:1.57 
php-src/ext/xsl/xsltprocessor.c:1.58
--- php-src/ext/xsl/xsltprocessor.c:1.57Thu Sep 27 18:28:43 2007
+++ php-src/ext/xsl/xsltprocessor.c Tue Oct  2 06:32:16 2007
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: xsltprocessor.c,v 1.57 2007/09/27 18:28:43 dmitry Exp $ */
+/* $Id: xsltprocessor.c,v 1.58 2007/10/02 06:32:16 chregu Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -44,6 +44,7 @@
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)
{NULL, NULL, NULL}
 };
 
@@ -425,6 +426,7 @@
int clone;
zval *doXInclude, *member;
zend_object_handlers *std_hnd;
+   FILE *f;
 
node = php_libxml_import_node(docp TSRMLS_CC);

@@ -440,6 +442,17 @@
php_error_docref(NULL TSRMLS_CC, E_WARNING, No stylesheet 
associated to this object);
return NULL;
}
+   
+   if (intern-profiling) {
+   if (php_check_open_basedir(intern-profiling TSRMLS_CC)) {
+   f = NULL;
+   } else {
+   f = VCWD_FOPEN(intern-profiling, w);
+   }
+   } else {
+   f = NULL;
+   }
+   
if (intern-parameter) {
params = php_xsl_xslt_make_params(intern-parameter, 0 
TSRMLS_CC);
}
@@ -470,8 +483,10 @@
}
efree(member);
 
-   newdocp = xsltApplyStylesheetUser(style, doc, (const char**) params, 
NULL, NULL, ctxt);
-
+   newdocp = xsltApplyStylesheetUser(style, doc, (const char**) params,  
NULL, f, ctxt);
+   if (f) {
+   fclose(f);
+   }
xsltFreeTransformContext(ctxt);
 
if (intern-node_list != NULL) {
@@ -484,6 +499,9 @@

[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard array.c

2007-10-02 Thread Antony Dovgal
tony2001Tue Oct  2 10:04:13 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard   array.c 
  Log:
  improved recursion detection in array_walk()
  fixes #42752, though the leaks are still there
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.308.2.21.2.37r2=1.308.2.21.2.38diff_format=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.308.2.21.2.37 
php-src/ext/standard/array.c:1.308.2.21.2.38
--- php-src/ext/standard/array.c:1.308.2.21.2.37Sat Sep 22 15:38:00 2007
+++ php-src/ext/standard/array.cTue Oct  2 10:04:13 2007
@@ -21,7 +21,7 @@
+--+
 */
 
-/* $Id: array.c,v 1.308.2.21.2.37 2007/09/22 15:38:00 iliaa Exp $ */
+/* $Id: array.c,v 1.308.2.21.2.38 2007/10/02 10:04:13 tony2001 Exp $ */
 
 #include php.h
 #include php_ini.h
@@ -1079,11 +1079,13 @@

SEPARATE_ZVAL_TO_MAKE_IS_REF(args[0]);
thash = HASH_OF(*(args[0]));
-   if (thash == target_hash) {
+   if (thash-nApplyCount  1) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, 
recursion detected);
return 0;
}
+   thash-nApplyCount++;
php_array_walk(thash, userdata, recursive TSRMLS_CC);
+   thash-nApplyCount--;
} else {
zend_fcall_info fci;
 

-- 
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/standard array.c

2007-10-02 Thread Antony Dovgal
tony2001Tue Oct  2 10:04:38 2007 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   array.c 
  Log:
  MF5_2: improved recursion detection in array_walk()
  fixes #42752, though the leaks are still there
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.308.2.21.2.37.2.1r2=1.308.2.21.2.37.2.2diff_format=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.308.2.21.2.37.2.1 
php-src/ext/standard/array.c:1.308.2.21.2.37.2.2
--- php-src/ext/standard/array.c:1.308.2.21.2.37.2.1Mon Oct  1 12:34:19 2007
+++ php-src/ext/standard/array.cTue Oct  2 10:04:38 2007
@@ -21,7 +21,7 @@
+--+
 */
 
-/* $Id: array.c,v 1.308.2.21.2.37.2.1 2007/10/01 12:34:19 jani Exp $ */
+/* $Id: array.c,v 1.308.2.21.2.37.2.2 2007/10/02 10:04:38 tony2001 Exp $ */
 
 #include php.h
 #include php_ini.h
@@ -1079,11 +1079,13 @@

SEPARATE_ZVAL_TO_MAKE_IS_REF(args[0]);
thash = HASH_OF(*(args[0]));
-   if (thash == target_hash) {
+   if (thash-nApplyCount  1) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, 
recursion detected);
return 0;
}
+   thash-nApplyCount++;
php_array_walk(thash, userdata, recursive TSRMLS_CC);
+   thash-nApplyCount--;
} else {
zend_fcall_info fci;
 

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



[PHP-CVS] cvs: php-src /ext/standard array.c

2007-10-02 Thread Antony Dovgal
tony2001Tue Oct  2 10:06:15 2007 UTC

  Modified files:  
/php-src/ext/standard   array.c 
  Log:
  MF5_2: improved recursion detection in array_walk()
  fixes #42752, though the leaks are still there
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.420r2=1.421diff_format=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.420 php-src/ext/standard/array.c:1.421
--- php-src/ext/standard/array.c:1.420  Sun Sep 30 05:15:35 2007
+++ php-src/ext/standard/array.cTue Oct  2 10:06:15 2007
@@ -21,7 +21,7 @@
+--+
 */
 
-/* $Id: array.c,v 1.420 2007/09/30 05:15:35 jani Exp $ */
+/* $Id: array.c,v 1.421 2007/10/02 10:06:15 tony2001 Exp $ */
 
 #include php.h
 #include php_ini.h
@@ -1067,7 +1067,7 @@
 
SEPARATE_ZVAL_TO_MAKE_IS_REF(args[0]);
thash = HASH_OF(*(args[0]));
-   if (thash == target_hash) {
+   if (thash-nApplyCount  1) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, 
recursion detected);
return 0;
}
@@ -1076,7 +1076,9 @@
orig_array_walk_fci = BG(array_walk_fci);
orig_array_walk_fci_cache = BG(array_walk_fci_cache);
 
+   thash-nApplyCount++;
php_array_walk(thash, userdata, recursive TSRMLS_CC);
+   thash-nApplyCount--;
 
/* restore the fcall info and cache */
BG(array_walk_fci) = orig_array_walk_fci;

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



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard basic_functions.c

2007-10-02 Thread Jani Taskinen
Nice catch. :)

--Jani

On Mon, 2007-10-01 at 20:36 +, Johannes Schlüter wrote:
 johannes  Mon Oct  1 20:36:01 2007 UTC
 
   Modified files:  (Branch: PHP_5_3)
 /php-src/ext/standard basic_functions.c 
   Log:
   - pass the adress not the value
   
 http://cvs.php.net/viewvc.cgi/php-src/ext/standard/basic_functions.c?r1=1.725.2.31.2.64.2.4r2=1.725.2.31.2.64.2.5diff_format=u
 Index: php-src/ext/standard/basic_functions.c
 diff -u php-src/ext/standard/basic_functions.c:1.725.2.31.2.64.2.4 
 php-src/ext/standard/basic_functions.c:1.725.2.31.2.64.2.5
 --- php-src/ext/standard/basic_functions.c:1.725.2.31.2.64.2.4Mon Oct 
  1 12:40:53 2007
 +++ php-src/ext/standard/basic_functions.cMon Oct  1 20:36:01 2007
 @@ -17,7 +17,7 @@
 +--+
   */
  
 -/* $Id: basic_functions.c,v 1.725.2.31.2.64.2.4 2007/10/01 12:40:53 jani Exp 
 $ */
 +/* $Id: basic_functions.c,v 1.725.2.31.2.64.2.5 2007/10/01 20:36:01 johannes 
 Exp $ */
  
  #include php.h
  #include php_streams.h
 @@ -6125,7 +6125,7 @@
   RETURN_FALSE;
   }
  
 - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ss, path, 
 path_len, new_path, new_path_len) == FAILURE) {
 + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ss, path, 
 path_len, new_path, new_path_len) == FAILURE) {
   return;
   }
  
 
-- 
Patches/Donations: http://pecl.php.net/~jani/

--
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) / NEWS

2007-10-02 Thread Jani Taskinen
janiTue Oct  2 10:42:57 2007 UTC

  Modified files:  (Branch: PHP_5_3)
/php-srcNEWS 
  Log:
  - There really is no point in mentioned fixed bugs in something that has 
never been in any release..
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.18r2=1.2027.2.547.2.965.2.19diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.18 
php-src/NEWS:1.2027.2.547.2.965.2.19
--- php-src/NEWS:1.2027.2.547.2.965.2.18Tue Oct  2 08:26:48 2007
+++ php-src/NEWSTue Oct  2 10:42:55 2007
@@ -3,7 +3,7 @@
 ?? ??? 20??, PHP 5.3.0
 - Added xsl-setProfiling() for profiling stylesheets. (Christian)
 - Added long-option feature to getopt() and made getopt() available also on 
-  win32 systems by adding a common getopt implementation to core.
+  win32 systems by adding a common getopt implementation into core.
   (Jani, David Soria Parra)
 - Added support for namespaces. (Dmitry, Stas)
 - Added support for Late Static Binding. (Dmitry, Etienne Kneuss)
@@ -35,8 +35,6 @@
 - Improved and cleaned CGI code. FastCGI is now always enabled and can not be
   disabled. See sapi/cgi/CHANGES for more details. (Dmitry)
 
-- Fixed bug #42819 (namespaces in indexes of constant arrays). (Dmitry)
-- Fixed bug #42802 (Namespace not supported in typehints). (Dmitry)
 - Fixed bug #42798 (__autoload() not triggered for classes used in method
   signature). (Dmitry)
 - Fixed bug #42657 (ini_get() returns incorrect value when default is NULL).

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



[PHP-CVS] cvs: php-src /ext/mysqlnd mysqlnd_debug.h mysqlnd_structs.h

2007-10-02 Thread Andrey Hristov
andrey  Tue Oct  2 10:45:27 2007 UTC

  Added files: 
/php-src/ext/mysqlndmysqlnd_debug.h mysqlnd_structs.h 
  Log:
  Update mysqlnd in HEAD
  Updated ext/mysql and ext/mysqli in HEAD
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_debug.h?view=markuprev=1.1
Index: php-src/ext/mysqlnd/mysqlnd_debug.h
+++ php-src/ext/mysqlnd/mysqlnd_debug.h
/*
  +--+
  | PHP Version 6|
  +--+
  | Copyright (c) 2006-2007 The PHP Group|
  +--+
  | This source file is subject to version 3.01 of the PHP license,  |
  | that is bundled with this package in the file LICENSE, and is|
  | available through the world-wide-web at the following url:   |
  | http://www.php.net/license/3_01.txt  |
  | If you did not receive a copy of the PHP license and are unable to   |
  | obtain it through the world-wide-web, please send a note to  |
  | [EMAIL PROTECTED] so we can mail you a copy immediately.   |
  +--+
  | Authors: Georg Richter [EMAIL PROTECTED] |
  |  Andrey Hristov [EMAIL PROTECTED]   |
  |  Ulf Wendel [EMAIL PROTECTED]  |
  +--+
*/

/* $Id: mysqlnd_debug.h,v 1.1 2007/10/02 10:45:27 andrey Exp $ */

#ifndef MYSQLND_DEBUG_H
#define MYSQLND_DEBUG_H

#include zend_stack.h

#define MYSQLND_DEBUG_MEMORY 1

struct st_mysqlnd_debug_methods
{
enum_func_status (*open)(MYSQLND_DEBUG *self, zend_bool reopen);
void (*set_mode)(MYSQLND_DEBUG *self, const char * 
const mode);
enum_func_status (*log)(MYSQLND_DEBUG *self, unsigned int line, const 
char * const file,
unsigned int level, 
const char * type, const char *message);
enum_func_status (*log_va)(MYSQLND_DEBUG *self, unsigned int line, 
const char * const file,
   unsigned int level, 
const char * type, const char *format, ...);
zend_bool (*func_enter)(MYSQLND_DEBUG *self, unsigned int line, const 
char * const file,
char * func_name, 
size_t func_name_len);
enum_func_status (*func_leave)(MYSQLND_DEBUG *self, unsigned int line, 
const char * const file);
enum_func_status (*close)(MYSQLND_DEBUG *self);
enum_func_status (*free)(MYSQLND_DEBUG *self);
};

struct st_mysqlnd_debug
{
php_stream  *stream;
#ifdef ZTS
TSRMLS_D;
#endif
unsigned int flags;
unsigned int nest_level_limit;
int pid;
char * file_name;
zend_stack call_stack;
HashTable not_filtered_functions;
struct st_mysqlnd_debug_methods *m;
};


MYSQLND_DEBUG *mysqlnd_debug_init(TSRMLS_D);

#define MYSQLND_MEM_D   TSRMLS_DC ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC


void *  _mysqlnd_emalloc(size_t size MYSQLND_MEM_D);
void *  _mysqlnd_pemalloc(size_t size, zend_bool persistent MYSQLND_MEM_D);
void *  _mysqlnd_ecalloc(uint nmemb, size_t size MYSQLND_MEM_D);
void *  _mysqlnd_pecalloc(uint nmemb, size_t size, zend_bool persistent 
MYSQLND_MEM_D);
void *  _mysqlnd_erealloc(void *ptr, size_t new_size MYSQLND_MEM_D);
void *  _mysqlnd_perealloc(void *ptr, size_t new_size, zend_bool persistent 
MYSQLND_MEM_D);
void_mysqlnd_efree(void *ptr MYSQLND_MEM_D);
void_mysqlnd_pefree(void *ptr, zend_bool persistent MYSQLND_MEM_D);
void *  _mysqlnd_malloc(size_t size MYSQLND_MEM_D);
void *  _mysqlnd_calloc(uint nmemb, size_t size MYSQLND_MEM_D);
void *  _mysqlnd_realloc(void *ptr, size_t new_size MYSQLND_MEM_D);
void_mysqlnd_free(void *ptr MYSQLND_MEM_D);

char *  mysqlnd_get_backtrace(TSRMLS_D);

#if PHP_DEBUG  !defined(PHP_WIN32)
#define DBG_INF(msg) do { if (dbg_skip_trace == FALSE) 
MYSQLND_G(dbg)-m-log(MYSQLND_G(dbg), __LINE__, __FILE__, -1, info : , 
(msg)); } while (0)
#define DBG_ERR(msg) do { if (dbg_skip_trace == FALSE) 
MYSQLND_G(dbg)-m-log(MYSQLND_G(dbg), __LINE__, __FILE__, -1, error: , 
(msg)); } while (0)
#define DBG_INF_FMT(...) do { if (dbg_skip_trace == FALSE) 
MYSQLND_G(dbg)-m-log_va(MYSQLND_G(dbg), __LINE__, __FILE__, -1, info : , 
__VA_ARGS__); } while (0)
#define DBG_ERR_FMT(...) do { if (dbg_skip_trace == FALSE) 
MYSQLND_G(dbg)-m-log_va(MYSQLND_G(dbg), __LINE__, __FILE__, -1, error: , 
__VA_ARGS__); } while (0)

#define DBG_ENTER(func_name) zend_bool dbg_skip_trace = TRUE; if 
(MYSQLND_G(dbg)) dbg_skip_trace = 
!MYSQLND_G(dbg)-m-func_enter(MYSQLND_G(dbg), 

Re: [PHP-CVS] cvs: php-src /ext/standard/tests/strings strcspn_basic.phpt

2007-10-02 Thread Antony Dovgal
Raghubansh, you should really try to debug one of your tests.
Here is an example for you: ext/standard/tests/strings/strcspn_variation10.phpt
See the diff below.

Why does it fail? Can you quickly locate the data which demonstrates the 
problem?
Line 100? Which $string is that? And which $mask_array?
The diff is completely useless, the test itself is close to that too.
It should help us to find the problem, but currently it makes the process even 
more complicated.

100+ int(12)
101+ int(12)
100- int(5)
101- int(5)
124+ int(2)
125+ int(2)
124- int(0)
125- int(0)
136+ int(13)
137+ int(13)
136- int(0)
137- int(0)
148+ int(14)
149+ int(14)
148- int(0)
149- int(0)
160+ int(11)
161+ int(11)
160- int(5)
161- int(5)
172+ int(11)
173+ int(11)
172- int(5)
173- int(5)
184+ int(14)
185+ int(14)
184- int(5)
185- int(5)


-- 
Wbr, 
Antony Dovgal

-- 
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/standard/tests/network ip_x86_64.phpt

2007-10-02 Thread Antony Dovgal
tony2001Tue Oct  2 11:21:40 2007 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard/tests/network ip_x86_64.phpt 
  Log:
  fix test
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/network/ip_x86_64.phpt?r1=1.1.2.2r2=1.1.2.2.2.1diff_format=u
Index: php-src/ext/standard/tests/network/ip_x86_64.phpt
diff -u php-src/ext/standard/tests/network/ip_x86_64.phpt:1.1.2.2 
php-src/ext/standard/tests/network/ip_x86_64.phpt:1.1.2.2.2.1
--- php-src/ext/standard/tests/network/ip_x86_64.phpt:1.1.2.2   Sat Sep  1 
18:38:39 2007
+++ php-src/ext/standard/tests/network/ip_x86_64.phpt   Tue Oct  2 11:21:40 2007
@@ -48,20 +48,20 @@
 int(1118019956)
 string(14) 66.163.161.116
 
-Warning: Wrong parameter count for ip2long() in %s on line %d
+Warning: ip2long() expects exactly 1 parameter, 0 given in %s on line %d
 NULL
 bool(false)
 bool(false)
 int(1869573999)
 
-Notice: Array to string conversion in %s on line %d
-bool(false)
+Warning: ip2long() expects parameter 1 to be string, array given in %s on line 
%d
+NULL
 
-Warning: Wrong parameter count for long2ip() in %s on line %d
+Warning: long2ip() expects exactly 1 parameter, 0 given in %s on line %d
 NULL
 string(13) 255.254.82.80
 string(7) 0.0.0.0
 
-Notice: Array to string conversion in %s on line %d
-string(7) 0.0.0.0
+Warning: long2ip() expects parameter 1 to be string, array given in %s on line 
%d
+NULL
 Done

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



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard/tests/network ip_x86_64.phpt

2007-10-02 Thread Jani Taskinen
Oh..there was one for 64bit too..of course I missed that one since I
tested on 32bit only. Yet another reason to not separate tests.. ;)
(EXPECT64 :)

--Jani

On Tue, 2007-10-02 at 11:21 +, Antony Dovgal wrote:
 tony2001  Tue Oct  2 11:21:40 2007 UTC
 
   Modified files:  (Branch: PHP_5_3)
 /php-src/ext/standard/tests/network   ip_x86_64.phpt 
   Log:
   fix test
   
   
 http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/network/ip_x86_64.phpt?r1=1.1.2.2r2=1.1.2.2.2.1diff_format=u
 Index: php-src/ext/standard/tests/network/ip_x86_64.phpt
 diff -u php-src/ext/standard/tests/network/ip_x86_64.phpt:1.1.2.2 
 php-src/ext/standard/tests/network/ip_x86_64.phpt:1.1.2.2.2.1
 --- php-src/ext/standard/tests/network/ip_x86_64.phpt:1.1.2.2 Sat Sep  1 
 18:38:39 2007
 +++ php-src/ext/standard/tests/network/ip_x86_64.phpt Tue Oct  2 11:21:40 2007
 @@ -48,20 +48,20 @@
  int(1118019956)
  string(14) 66.163.161.116
  
 -Warning: Wrong parameter count for ip2long() in %s on line %d
 +Warning: ip2long() expects exactly 1 parameter, 0 given in %s on line %d
  NULL
  bool(false)
  bool(false)
  int(1869573999)
  
 -Notice: Array to string conversion in %s on line %d
 -bool(false)
 +Warning: ip2long() expects parameter 1 to be string, array given in %s on 
 line %d
 +NULL
  
 -Warning: Wrong parameter count for long2ip() in %s on line %d
 +Warning: long2ip() expects exactly 1 parameter, 0 given in %s on line %d
  NULL
  string(13) 255.254.82.80
  string(7) 0.0.0.0
  
 -Notice: Array to string conversion in %s on line %d
 -string(7) 0.0.0.0
 +Warning: long2ip() expects parameter 1 to be string, array given in %s on 
 line %d
 +NULL
  Done
 
-- 
Patches/Donations: http://pecl.php.net/~jani/

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



[PHP-CVS] cvs: php-src /ext/standard string.c

2007-10-02 Thread Antony Dovgal
tony2001Tue Oct  2 11:35:26 2007 UTC

  Modified files:  
/php-src/ext/standard   string.c 
  Log:
  make strcspn() behave the same way in both Unicode and native mode (bug 
#42731)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.653r2=1.654diff_format=u
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.653 php-src/ext/standard/string.c:1.654
--- php-src/ext/standard/string.c:1.653 Mon Oct  1 13:41:57 2007
+++ php-src/ext/standard/string.c   Tue Oct  2 11:35:26 2007
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: string.c,v 1.653 2007/10/01 13:41:57 jani Exp $ */
+/* $Id: string.c,v 1.654 2007/10/02 11:35:26 tony2001 Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -2306,7 +2306,11 @@
 
for (i = 0, codepts = 0 ; i  len1 ; ) {
U16_NEXT(s1, i, len1, ch);
-   if (!len2 || u_memchr32(s2, ch, len2)) {
+   if (len2) {
+   if (u_memchr32(s2, ch, len2)) {
+   break;
+   }
+   } else if (ch == (UChar32)0x00){
break;
}
codepts++;

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



[PHP-CVS] cvs: php-src /ext/standard/tests/strings strcspn_variation10.phpt strcspn_variation2.phpt

2007-10-02 Thread Antony Dovgal
tony2001Tue Oct  2 11:35:40 2007 UTC

  Modified files:  
/php-src/ext/standard/tests/strings strcspn_variation10.phpt 
strcspn_variation2.phpt 
  Log:
  fix tests
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/strcspn_variation10.phpt?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/standard/tests/strings/strcspn_variation10.phpt
diff -u php-src/ext/standard/tests/strings/strcspn_variation10.phpt:1.2 
php-src/ext/standard/tests/strings/strcspn_variation10.phpt:1.3
--- php-src/ext/standard/tests/strings/strcspn_variation10.phpt:1.2 Sat Sep 
22 10:37:46 2007
+++ php-src/ext/standard/tests/strings/strcspn_variation10.phpt Tue Oct  2 
11:35:39 2007
@@ -54,7 +54,7 @@
 // loop through each element of the array for mask argument
 $count = 1;
 foreach($strings as $str) {
-  echo \n-- Itearation $count --\n;
+  echo \n-- Iteration $count --\n;
   foreach($mask_array as $mask) {
   var_dump( strcspn($str,$mask) );
   }
@@ -66,7 +66,7 @@
 --EXPECTF--
 *** Testing strcspn() : with different mask strings and default start and len 
arguments ***
 
--- Itearation 1 --
+-- Iteration 1 --
 int(0)
 int(0)
 int(0)
@@ -78,7 +78,7 @@
 int(0)
 int(0)
 
--- Itearation 2 --
+-- Iteration 2 --
 int(0)
 int(0)
 int(0)
@@ -90,7 +90,7 @@
 int(0)
 int(0)
 
--- Itearation 3 --
+-- Iteration 3 --
 int(1)
 int(1)
 int(0)
@@ -102,7 +102,7 @@
 int(1)
 int(0)
 
--- Itearation 4 --
+-- Iteration 4 --
 int(2)
 int(2)
 int(0)
@@ -114,7 +114,7 @@
 int(2)
 int(0)
 
--- Itearation 5 --
+-- Iteration 5 --
 int(24)
 int(24)
 int(2)
@@ -126,7 +126,7 @@
 int(5)
 int(5)
 
--- Itearation 6 --
+-- Iteration 6 --
 int(28)
 int(28)
 int(2)
@@ -138,7 +138,7 @@
 int(28)
 int(5)
 
--- Itearation 7 --
+-- Iteration 7 --
 int(20)
 int(20)
 int(6)
@@ -150,7 +150,7 @@
 int(16)
 int(16)
 
--- Itearation 8 --
+-- Iteration 8 --
 int(21)
 int(21)
 int(6)
@@ -162,7 +162,7 @@
 int(21)
 int(16)
 
--- Itearation 9 --
+-- Iteration 9 --
 int(5)
 int(5)
 int(2)
@@ -174,7 +174,7 @@
 int(12)
 int(11)
 
--- Itearation 10 --
+-- Iteration 10 --
 int(16)
 int(16)
 int(2)
@@ -186,7 +186,7 @@
 int(16)
 int(5)
 
--- Itearation 11 --
+-- Iteration 11 --
 int(0)
 int(0)
 int(2)
@@ -198,7 +198,7 @@
 int(2)
 int(2)
 
--- Itearation 12 --
+-- Iteration 12 --
 int(0)
 int(0)
 int(3)
@@ -210,7 +210,7 @@
 int(13)
 int(13)
 
--- Itearation 13 --
+-- Iteration 13 --
 int(0)
 int(0)
 int(3)
@@ -222,7 +222,7 @@
 int(14)
 int(6)
 
--- Itearation 14 --
+-- Iteration 14 --
 int(5)
 int(5)
 int(2)
@@ -234,7 +234,7 @@
 int(11)
 int(11)
 
--- Itearation 15 --
+-- Iteration 15 --
 int(5)
 int(5)
 int(2)
@@ -246,7 +246,7 @@
 int(11)
 int(11)
 
--- Itearation 16 --
+-- Iteration 16 --
 int(5)
 int(5)
 int(2)
@@ -258,215 +258,7 @@
 int(14)
 int(6)
 
--- Itearation 17 --
-int(21)
-int(21)
-int(2)
-int(2)
-int(21)
-int(5)
-int(5)
-int(5)
-int(21)
-int(5)
-Done
-
---UEXPECTF--
-*** Testing strcspn() : with different mask strings and default start and len 
arguments ***
-
--- Itearation 1 --
-int(0)
-int(0)
-int(0)
-int(0)
-int(0)
-int(0)
-int(0)
-int(0)
-int(0)
-int(0)
-
--- Itearation 2 --
-int(0)
-int(0)
-int(0)
-int(0)
-int(0)
-int(0)
-int(0)
-int(0)
-int(0)
-int(0)
-
--- Itearation 3 --
-int(1)
-int(1)
-int(0)
-int(1)
-int(1)
-int(1)
-int(1)
-int(1)
-int(1)
-int(0)
-
--- Itearation 4 --
-int(2)
-int(2)
-int(0)
-int(0)
-int(2)
-int(0)
-int(0)
-int(0)
-int(2)
-int(0)
-
--- Itearation 5 --
-int(24)
-int(24)
-int(2)
-int(2)
-int(5)
-int(24)
-int(24)
-int(5)
-int(5)
-int(5)
-
--- Itearation 6 --
-int(28)
-int(28)
-int(2)
-int(2)
-int(28)
-int(5)
-int(5)
-int(5)
-int(28)
-int(5)
-
--- Itearation 7 --
-int(20)
-int(20)
-int(6)
-int(6)
-int(16)
-int(20)
-int(20)
-int(16)
-int(16)
-int(16)
-
--- Itearation 8 --
-int(21)
-int(21)
-int(6)
-int(6)
-int(21)
-int(16)
-int(16)
-int(16)
-int(21)
-int(16)
-
--- Itearation 9 --
-int(5)
-int(5)
-int(2)
-int(2)
-int(12)
-int(12)
-int(12)
-int(12)
-int(12)
-int(11)
-
--- Itearation 10 --
-int(16)
-int(16)
-int(2)
-int(2)
-int(16)
-int(5)
-int(5)
-int(5)
-int(16)
-int(5)
-
--- Itearation 11 --
-int(0)
-int(0)
-int(2)
-int(2)
-int(2)
-int(2)
-int(2)
-int(2)
-int(2)
-int(2)
-
--- Itearation 12 --
-int(0)
-int(0)
-int(3)
-int(3)
-int(13)
-int(13)
-int(13)
-int(13)
-int(13)
-int(13)
-
--- Itearation 13 --
-int(0)
-int(0)
-int(3)
-int(3)
-int(14)
-int(6)
-int(6)
-int(6)
-int(14)
-int(6)
-
--- Itearation 14 --
-int(5)
-int(5)
-int(2)
-int(2)
-int(11)
-int(11)
-int(11)
-int(11)
-int(11)
-int(11)
-
--- Itearation 15 --
-int(5)
-int(5)
-int(2)
-int(2)
-int(11)
-int(11)
-int(11)
-int(11)
-int(11)
-int(11)
-
--- Itearation 16 --
-int(5)
-int(5)
-int(2)
-int(2)
-int(14)
-int(14)
-int(14)
-int(14)
-int(14)
-int(6)
-
--- Itearation 17 --
+-- Iteration 17 --
 int(21)
 int(21)
 int(2)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/strcspn_variation2.phpt?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/standard/tests/strings/strcspn_variation2.phpt
diff -u 

Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard/tests/network ip_x86_64.phpt

2007-10-02 Thread Antony Dovgal
On 02.10.2007 15:29, Jani Taskinen wrote:
 Oh..there was one for 64bit too..of course I missed that one since I
 tested on 32bit only. Yet another reason to not separate tests.. ;)
 (EXPECT64 :)

Well, I think of suffixes more and more (test_name_64bit.phpt, 
test_name32bit.phpt).
It becomes a real issue since the number of tests constantly increases and we 
have 
to parse  execute more and more SKIPIF sections.

-- 
Wbr, 
Antony Dovgal

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



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard/tests/network ip_x86_64.phpt

2007-10-02 Thread Jani Taskinen
On Tue, 2007-10-02 at 15:44 +0400, Antony Dovgal wrote:
 On 02.10.2007 15:29, Jani Taskinen wrote:
  Oh..there was one for 64bit too..of course I missed that one since I
  tested on 32bit only. Yet another reason to not separate tests.. ;)
  (EXPECT64 :)
 
 Well, I think of suffixes more and more (test_name_64bit.phpt, 
 test_name32bit.phpt).
 It becomes a real issue since the number of tests constantly increases and we 
 have 
 to parse  execute more and more SKIPIF sections.

Well, as the platform shouldn't matter and same code should be used,
just sometimes it gives different expected result, having separate 32/64
bit expected result in same script would be more useful than having
multiple copies of tests..

--Jani

-- 
Patches/Donations: http://pecl.php.net/~jani/

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



[PHP-CVS] cvs: php-src /main/streams unicode_filter.c

2007-10-02 Thread Antony Dovgal
tony2001Tue Oct  2 17:09:22 2007 UTC

  Modified files:  
/php-src/main/streams   unicode_filter.c 
  Log:
  ucnv_toUnicode() in ICU 3.8 requires target buffer size to be even, otherwise 
it bails out with U_ILLEGAL_ARGUMENT_ERROR
  this commit fixes endless loop (due to the absence of error catching) and 
also fixes the cause of the error
  
  
http://cvs.php.net/viewvc.cgi/php-src/main/streams/unicode_filter.c?r1=1.6r2=1.7diff_format=u
Index: php-src/main/streams/unicode_filter.c
diff -u php-src/main/streams/unicode_filter.c:1.6 
php-src/main/streams/unicode_filter.c:1.7
--- php-src/main/streams/unicode_filter.c:1.6   Mon Jan  1 09:29:36 2007
+++ php-src/main/streams/unicode_filter.c   Tue Oct  2 17:09:22 2007
@@ -14,7 +14,7 @@
+--+
 */
 
-/* $Id: unicode_filter.c,v 1.6 2007/01/01 09:29:36 sebastian Exp $ */
+/* $Id: unicode_filter.c,v 1.7 2007/10/02 17:09:22 tony2001 Exp $ */
 
 
 #include php.h
@@ -144,10 +144,18 @@
UErrorCode errCode = U_ZERO_ERROR;
php_stream_bucket *new_bucket;
 
+   if ((destlen  1) != 0) {
+   destlen++;
+   }
+
destp = destbuf = (UChar *)pemalloc(destlen, 
data-is_persistent);
 
ucnv_toUnicode(data-conv, destp, 
(UChar*)((char*)destbuf + destlen), (const char**)src, src + remaining, NULL, 
FALSE, errCode);
-   /* UTODO: Error catching */
+
+   if (errCode != U_ZERO_ERROR) {
+   pefree(destp, data-is_persistent);
+   break;
+   }
 
new_bucket = php_stream_bucket_new_unicode(stream, 
destbuf, destp - destbuf, 1, data-is_persistent TSRMLS_CC);
php_stream_bucket_append(buckets_out, new_bucket 
TSRMLS_CC);
@@ -246,7 +254,6 @@
 };
 /* }}} */
 
-
 /* {{{ unicode.* factory */
 
 static php_stream_filter *php_unicode_filter_create(const char *filtername, 
zval *filterparams, int persistent TSRMLS_DC)

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



Re: [PHP-CVS] cvs: php-src(PHP_5_3) / NEWS configure.in /ext/standard basic_functions.c basic_functions.h config.m4 /ext/standard/tests/array extract_error.phpt /ext/standard/tests/general_function

2007-10-02 Thread Nuno Lopes

 MFH:- Added common getopt implementation to core.
 MFH:- Added long-option feature to getopt().
 MFH:- Made getopt() available on win32 systems.
 MFH:  Patch by: David Soria Parra [EMAIL PROTECTED]
 [DOC]: These changes will be available from 5.3+



uhm, this doesn't sound much thread safe to me:



PHPAPI int php_optidx = -1;

PHPAPI int php_getopt(int argc, char* const *argv, const opt_struct 
opts[], char **optarg, int *optind, int show_err, int arg_start) /* {{{ */

{
 static int optchr = 0;
 static int dash = 0; /* have already seen the - */

 php_optidx = -1;

(...)


Nuno 


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



[PHP-CVS] cvs: php-src / NEWS

2007-10-02 Thread Jani Taskinen
janiTue Oct  2 10:40:58 2007 UTC

  Modified files:  
/php-srcNEWS 
  Log:
  fix news (stuff added in 5.3 wont be needed to mentioned here)
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2151r2=1.2152diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2151 php-src/NEWS:1.2152
--- php-src/NEWS:1.2151 Wed Sep 26 07:16:33 2007
+++ php-src/NEWSTue Oct  2 10:40:57 2007
@@ -2,8 +2,6 @@
 |||
 ?? ??? 20??, PHP 6.0
 - Unicode support. (Andrei, Dmitry, et al)
-- Namespaces. (Dmitry, Stas)
-- Late Static Binding (Dmitry, Etienne Kneuss)
 
 - Changed dl() to be disabled by default. Enabled only when explicitly 
   registered by the SAPI layer. Enabled only with CLI, CGI and EMBED. (Dmitry)
@@ -30,7 +28,7 @@
 false and set_magic_quotes_runtime() to raise an E_CORE_ERROR.
 - Removed support for continue and break operators with non-constant
   operands. (Dmitry)
-- Removed Freetype 1.x and GD 1.x from GD extension. (Pierre)
+- Removed Freetype 1.x and GD 1.x support from GD extension. (Pierre)
 
 - Moved extensions to PECL:
   . ext/ncurses (Hartmut)
@@ -49,8 +47,7 @@
 mhash_keygen_uses_hash, mhash_keygen_uses_salt, mhash_get_keygen_salt_size,
 mhash_keygen.
 
-
-- Added runtime JIT auto-globals fetching and caching (Dmitry, Sara)
+- Added runtime JIT auto-globals fetching and caching. (Dmitry, Sara)
 - Added jump label operator (limited goto). (Dmitry, Sara)
 - Added E_STRICT to E_ALL. (Dmitry)
 - Added an optional parameter to strstr() and stristr() for retrieval of either

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



Re: [PHP-CVS] cvs: php-src /ext/standard/tests/strings strcspn_basic.phpt

2007-10-02 Thread Raghubansh
Hi Antony, Please send me details of the failure.
   PHP version, test generated temp files(.out, .diff, etc ).

Thanks,
Raghubansh

On 10/2/07, Antony Dovgal [EMAIL PROTECTED] wrote:

 Raghubansh, you should really try to debug one of your tests.
 Here is an example for you:
 ext/standard/tests/strings/strcspn_variation10.phpt
 See the diff below.

 Why does it fail? Can you quickly locate the data which demonstrates the
 problem?
 Line 100? Which $string is that? And which $mask_array?
 The diff is completely useless, the test itself is close to that too.
 It should help us to find the problem, but currently it makes the process
 even more complicated.

 100+ int(12)
 101+ int(12)
 100- int(5)
 101- int(5)
 124+ int(2)
 125+ int(2)
 124- int(0)
 125- int(0)
 136+ int(13)
 137+ int(13)
 136- int(0)
 137- int(0)
 148+ int(14)
 149+ int(14)
 148- int(0)
 149- int(0)
 160+ int(11)
 161+ int(11)
 160- int(5)
 161- int(5)
 172+ int(11)
 173+ int(11)
 172- int(5)
 173- int(5)
 184+ int(14)
 185+ int(14)
 184- int(5)
 185- int(5)


 --
 Wbr,
 Antony Dovgal

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




-- 
with Regards,
Raghubansh


[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard html.c

2007-10-02 Thread Stanislav Malyshev
stasWed Oct  3 04:53:06 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard   html.c 
  Log:
  do not accept partial multibyte sequences in html* functions
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/html.c?r1=1.111.2.2.2.14r2=1.111.2.2.2.15diff_format=u
Index: php-src/ext/standard/html.c
diff -u php-src/ext/standard/html.c:1.111.2.2.2.14 
php-src/ext/standard/html.c:1.111.2.2.2.15
--- php-src/ext/standard/html.c:1.111.2.2.2.14  Sun May 27 15:57:11 2007
+++ php-src/ext/standard/html.c Wed Oct  3 04:53:05 2007
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: html.c,v 1.111.2.2.2.14 2007/05/27 15:57:11 nlopess Exp $ */
+/* $Id: html.c,v 1.111.2.2.2.15 2007/10/03 04:53:05 stas Exp $ */
 
 /*
  * HTML entity resources:
@@ -484,18 +484,29 @@
}\
mbseq[mbpos++] = (mbchar); }
 
+#define CHECK_LEN(pos, chars_need) \
+   if((str_len - (pos))  chars_need) {\
+   *status = FAILURE;  \
+   return 0;   
\
+   }
+
 /* {{{ get_next_char
  */
 inline static unsigned short get_next_char(enum entity_charset charset,
unsigned char * str,
+   int str_len,
int * newpos,
unsigned char * mbseq,
-   int * mbseqlen)
+   int * mbseqlen, 
+   int *status)
 {
int pos = *newpos;
int mbpos = 0;
int mbspace = *mbseqlen;
unsigned short this_char = str[pos++];
+   unsigned char next_char;
+
+   *status = SUCCESS;

if (mbspace = 0) {
*mbseqlen = 0;
@@ -517,6 +528,10 @@
do {
if (this_char  0x80) {
more = 0;
+   if(stat) {
+   /* we didn't finish the 
UTF sequence correctly */
+   *status = FAILURE;
+   }
break;
} else if (this_char  0xc0) {
switch (stat) {
@@ -555,6 +570,7 @@
break;
default:
/* invalid */
+   *status = 
FAILURE;
more = 0;
}
}
@@ -562,21 +578,27 @@
else if (this_char  0xe0) {
stat = 0x10;/* 2 byte */
utf = (this_char  0x1f)  6;
+   CHECK_LEN(pos, 1);
} else if (this_char  0xf0) {
stat = 0x20;/* 3 byte */
utf = (this_char  0xf)  12;
+   CHECK_LEN(pos, 2);
} else if (this_char  0xf8) {
stat = 0x30;/* 4 byte */
utf = (this_char  0x7)  18;
+   CHECK_LEN(pos, 3);
} else if (this_char  0xfc) {
stat = 0x40;/* 5 byte */
utf = (this_char  0x3)  24;
+   CHECK_LEN(pos, 4);
} else if (this_char  0xfe) {
stat = 0x50;/* 6 byte */
utf = (this_char  0x1)  30;
+   CHECK_LEN(pos, 5);
} else {
/* invalid; bail */
more = 0;
+   *status = FAILURE;
break;
}
 
@@ -594,7 +616,8 @@
/* check if this is the first of a 2-byte 
sequence */
if (this_char = 0xa1  this_char = 0xfe) {
 

[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard/tests/strings htmlentities-utf.phpt

2007-10-02 Thread Stanislav Malyshev
stasWed Oct  3 04:58:40 2007 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/standard/tests/strings htmlentities-utf.phpt 
  Log:
  add test with invalid sequences
  
  

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/htmlentities-utf.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/strings/htmlentities-utf.phpt
+++ php-src/ext/standard/tests/strings/htmlentities-utf.phpt

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



[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS

2007-10-02 Thread Stanislav Malyshev
stasWed Oct  3 05:03:12 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
  Log:
  add html* utf fix
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.966r2=1.2027.2.547.2.967diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.966 php-src/NEWS:1.2027.2.547.2.967
--- php-src/NEWS:1.2027.2.547.2.966 Mon Oct  1 15:23:15 2007
+++ php-src/NEWSWed Oct  3 05:03:12 2007
@@ -29,6 +29,8 @@
   implementations of the fnmatch(), setlocale() and glob() functions. 
   Reported by Laurent gaffie. (Ilia)
 - Fixed imagerectangle regression with 1x1 rectangle (libgd #106). (Pierre)
+- Fixed htmlentities/htmlspecialchars not to accept partial multibyte
+  sequences. (Stas)
 
 - Fixed bug #42785 (json_encode() formats doubles according to locale rather  
   then following standard syntax). (Ilia)

-- 
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/standard html.c

2007-10-02 Thread Stanislav Malyshev
stasWed Oct  3 05:05:08 2007 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   html.c 
  Log:
  MFB do not accept partial multibyte sequences in html* functions
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/html.c?r1=1.111.2.2.2.14r2=1.111.2.2.2.14.2.1diff_format=u
Index: php-src/ext/standard/html.c
diff -u php-src/ext/standard/html.c:1.111.2.2.2.14 
php-src/ext/standard/html.c:1.111.2.2.2.14.2.1
--- php-src/ext/standard/html.c:1.111.2.2.2.14  Sun May 27 15:57:11 2007
+++ php-src/ext/standard/html.c Wed Oct  3 05:05:08 2007
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: html.c,v 1.111.2.2.2.14 2007/05/27 15:57:11 nlopess Exp $ */
+/* $Id: html.c,v 1.111.2.2.2.14.2.1 2007/10/03 05:05:08 stas Exp $ */
 
 /*
  * HTML entity resources:
@@ -484,18 +484,29 @@
}\
mbseq[mbpos++] = (mbchar); }
 
+#define CHECK_LEN(pos, chars_need) \
+   if((str_len - (pos))  chars_need) {\
+   *status = FAILURE;  \
+   return 0;   
\
+   }
+
 /* {{{ get_next_char
  */
 inline static unsigned short get_next_char(enum entity_charset charset,
unsigned char * str,
+   int str_len,
int * newpos,
unsigned char * mbseq,
-   int * mbseqlen)
+   int * mbseqlen, 
+   int *status)
 {
int pos = *newpos;
int mbpos = 0;
int mbspace = *mbseqlen;
unsigned short this_char = str[pos++];
+   unsigned char next_char;
+
+   *status = SUCCESS;

if (mbspace = 0) {
*mbseqlen = 0;
@@ -555,6 +566,7 @@
break;
default:
/* invalid */
+   *status = 
FAILURE;
more = 0;
}
}
@@ -562,21 +574,27 @@
else if (this_char  0xe0) {
stat = 0x10;/* 2 byte */
utf = (this_char  0x1f)  6;
+   CHECK_LEN(pos, 1);
} else if (this_char  0xf0) {
stat = 0x20;/* 3 byte */
utf = (this_char  0xf)  12;
+   CHECK_LEN(pos, 2);
} else if (this_char  0xf8) {
stat = 0x30;/* 4 byte */
utf = (this_char  0x7)  18;
+   CHECK_LEN(pos, 3);
} else if (this_char  0xfc) {
stat = 0x40;/* 5 byte */
utf = (this_char  0x3)  24;
+   CHECK_LEN(pos, 4);
} else if (this_char  0xfe) {
stat = 0x50;/* 6 byte */
utf = (this_char  0x1)  30;
+   CHECK_LEN(pos, 5);
} else {
/* invalid; bail */
more = 0;
+   *status = FAILURE;
break;
}
 
@@ -594,7 +612,8 @@
/* check if this is the first of a 2-byte 
sequence */
if (this_char = 0xa1  this_char = 0xfe) {
/* peek at the next char */
-   unsigned char next_char = str[pos];
+   CHECK_LEN(pos, 1);
+   next_char = str[pos];
if ((next_char = 0x40  next_char = 
0x7e) ||
(next_char = 0xa1  
next_char = 0xfe)) {
/* yes, this a wide char */
@@ -614,7 +633,8 @@
 (this_char = 0xe0  this_char = 
0xef)
) 

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard/tests/strings htmlentities-utf.phpt

2007-10-02 Thread Stanislav Malyshev
stasWed Oct  3 05:05:37 2007 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/standard/tests/strings htmlentities-utf.phpt 
  Log:
  MFB utf test
  
  

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/htmlentities-utf.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/strings/htmlentities-utf.phpt
+++ php-src/ext/standard/tests/strings/htmlentities-utf.phpt

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



[PHP-CVS] cvs: php-src /ext/standard html.c

2007-10-02 Thread Stanislav Malyshev
stasWed Oct  3 05:07:31 2007 UTC

  Modified files:  
/php-src/ext/standard   html.c 
  Log:
  MFB do not accept partial multibyte sequences in html* functions
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/html.c?r1=1.125r2=1.126diff_format=u
Index: php-src/ext/standard/html.c
diff -u php-src/ext/standard/html.c:1.125 php-src/ext/standard/html.c:1.126
--- php-src/ext/standard/html.c:1.125   Sun Jul 15 19:50:06 2007
+++ php-src/ext/standard/html.c Wed Oct  3 05:07:31 2007
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: html.c,v 1.125 2007/07/15 19:50:06 jani Exp $ */
+/* $Id: html.c,v 1.126 2007/10/03 05:07:31 stas Exp $ */
 
 /*
  * HTML entity resources:
@@ -489,18 +489,29 @@
}\
mbseq[mbpos++] = (mbchar); }
 
+#define CHECK_LEN(pos, chars_need) \
+   if((str_len - (pos))  chars_need) {\
+   *status = FAILURE;  \
+   return 0;   
\
+   }
+
 /* {{{ get_next_char
  */
 inline static unsigned short get_next_char(enum entity_charset charset,
unsigned char * str,
+   int str_len,
int * newpos,
unsigned char * mbseq,
-   int * mbseqlen)
+   int * mbseqlen, 
+   int *status)
 {
int pos = *newpos;
int mbpos = 0;
int mbspace = *mbseqlen;
unsigned short this_char = str[pos++];
+   unsigned char next_char;
+
+   *status = SUCCESS;

if (mbspace = 0) {
*mbseqlen = 0;
@@ -560,6 +571,7 @@
break;
default:
/* invalid */
+   *status = 
FAILURE;
more = 0;
}
}
@@ -567,21 +579,27 @@
else if (this_char  0xe0) {
stat = 0x10;/* 2 byte */
utf = (this_char  0x1f)  6;
+   CHECK_LEN(pos, 1);
} else if (this_char  0xf0) {
stat = 0x20;/* 3 byte */
utf = (this_char  0xf)  12;
+   CHECK_LEN(pos, 2);
} else if (this_char  0xf8) {
stat = 0x30;/* 4 byte */
utf = (this_char  0x7)  18;
+   CHECK_LEN(pos, 3);
} else if (this_char  0xfc) {
stat = 0x40;/* 5 byte */
utf = (this_char  0x3)  24;
+   CHECK_LEN(pos, 4);
} else if (this_char  0xfe) {
stat = 0x50;/* 6 byte */
utf = (this_char  0x1)  30;
+   CHECK_LEN(pos, 5);
} else {
/* invalid; bail */
more = 0;
+   *status = FAILURE;
break;
}
 
@@ -599,7 +617,8 @@
/* check if this is the first of a 2-byte 
sequence */
if (this_char = 0xa1  this_char = 0xfe) {
/* peek at the next char */
-   unsigned char next_char = str[pos];
+   CHECK_LEN(pos, 1);
+   next_char = str[pos];
if ((next_char = 0x40  next_char = 
0x7e) ||
(next_char = 0xa1  
next_char = 0xfe)) {
/* yes, this a wide char */
@@ -619,7 +638,8 @@
 (this_char = 0xe0  this_char = 
0xef)
) {
/* peek at the next char */
-

[PHP-CVS] cvs: php-src /ext/standard/tests/strings htmlentities-utf.phpt

2007-10-02 Thread Stanislav Malyshev
stasWed Oct  3 05:08:47 2007 UTC

  Modified files:  
/php-src/ext/standard/tests/strings htmlentities-utf.phpt 
  Log:
  MFB unicode test
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/htmlentities-utf.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/standard/tests/strings/htmlentities-utf.phpt
diff -u /dev/null php-src/ext/standard/tests/strings/htmlentities-utf.phpt:1.2
--- /dev/null   Wed Oct  3 05:08:47 2007
+++ php-src/ext/standard/tests/strings/htmlentities-utf.phptWed Oct  3 
05:08:47 2007
@@ -0,0 +1,34 @@
+--TEST--
+HTML entities with invalid chars
+--INI--
+output_handler=
+--FILE--
+?php 
+setlocale (LC_CTYPE, C);
+$strings = array(, \xD0, \xD0\x90, \xD0\x90\xD0, \xD0\x90\xD0\xB0, 
\xE0, A\xE0, \xE0\x80, \xE0\x80\xBE);
+foreach($strings as $string) {
+   $sc_encoded = htmlspecialchars ($string, ENT_QUOTES, utf-8);
+   var_dump(bin2hex($sc_encoded));
+   $ent_encoded = htmlentities ($string, ENT_QUOTES, utf-8);
+   var_dump(bin2hex($ent_encoded));
+}
+?
+--EXPECT--
+string(8) 266c743b
+string(8) 266c743b
+string(0) 
+string(0) 
+string(4) d090
+string(4) d090
+string(0) 
+string(0) 
+string(8) d090d0b0
+string(8) d090d0b0
+string(0) 
+string(0) 
+string(0) 
+string(0) 
+string(0) 
+string(0) 
+string(8) 2667743b
+string(8) 2667743b
\ No newline at end of file

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