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

2009-03-16 Thread Moriyoshi Koizumi
moriyoshi   Tue Mar 17 05:31:04 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/iconv  iconv.c 
  Log:
  - MFH: Make iconv filter accept '.' as the delimiter between encoding names as
well as '/'. It's impossible to specify the filter in php://filter without
this fix.
  
  # I hope this to be merged to 5.2 as well. This doesn't break BC as there is
  # no such encoding name that contains '.'. (Andif there were to be such one,
  # the filter is failed in the first place since it also uses '.' for the
  # delimiter between the filter name and the "from" encoding name.
  
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/iconv/iconv.c?r1=1.124.2.8.2.20.2.13&r2=1.124.2.8.2.20.2.14&diff_format=u
Index: php-src/ext/iconv/iconv.c
diff -u php-src/ext/iconv/iconv.c:1.124.2.8.2.20.2.13 
php-src/ext/iconv/iconv.c:1.124.2.8.2.20.2.14
--- php-src/ext/iconv/iconv.c:1.124.2.8.2.20.2.13   Wed Dec 31 11:15:37 2008
+++ php-src/ext/iconv/iconv.c   Tue Mar 17 05:31:04 2009
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: iconv.c,v 1.124.2.8.2.20.2.13 2008/12/31 11:15:37 sebastian Exp $ */
+/* $Id: iconv.c,v 1.124.2.8.2.20.2.14 2009/03/17 05:31:04 moriyoshi Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -2759,7 +2759,7 @@
return NULL;
}
++from_charset;
-   if ((to_charset = strchr(from_charset, '/')) == NULL) {
+   if ((to_charset = strpbrk(from_charset, "/.")) == NULL) {
return NULL;
}
from_charset_len = to_charset - from_charset;



-- 
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/iconv iconv.c

2008-10-21 Thread Arnaud Le Blanc
lbarnaudTue Oct 21 22:07:30 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/iconv  iconv.c 
  Log:
  MFH: initialize optional vars
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/iconv/iconv.c?r1=1.124.2.8.2.20.2.8&r2=1.124.2.8.2.20.2.9&diff_format=u
Index: php-src/ext/iconv/iconv.c
diff -u php-src/ext/iconv/iconv.c:1.124.2.8.2.20.2.8 
php-src/ext/iconv/iconv.c:1.124.2.8.2.20.2.9
--- php-src/ext/iconv/iconv.c:1.124.2.8.2.20.2.8Tue Sep 23 15:18:26 2008
+++ php-src/ext/iconv/iconv.c   Tue Oct 21 22:07:30 2008
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: iconv.c,v 1.124.2.8.2.20.2.8 2008/09/23 15:18:26 nlopess Exp $ */
+/* $Id: iconv.c,v 1.124.2.8.2.20.2.9 2008/10/21 22:07:30 lbarnaud Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1873,7 +1873,7 @@
Returns the character count of str */
 PHP_FUNCTION(iconv_strlen)
 {
-   char *charset;
+   char *charset = ICONVG(internal_encoding);
int charset_len = 0;
char *str;
int str_len; 
@@ -1882,8 +1882,6 @@
 
unsigned int retval;
 
-   charset = ICONVG(internal_encoding);
-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s",
&str, &str_len, &charset, &charset_len) == FAILURE) {
RETURN_FALSE;
@@ -1908,18 +1906,16 @@
Returns specified part of a string */
 PHP_FUNCTION(iconv_substr)
 {
-   char *charset;
+   char *charset = ICONVG(internal_encoding);
int charset_len = 0;
char *str;
int str_len; 
-   long offset, length;
+   long offset, length = 0;
 
php_iconv_err_t err;
 
smart_str retval = {0};
 
-   charset = ICONVG(internal_encoding);
-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|ls",
&str, &str_len, &offset, &length,
&charset, &charset_len) == FAILURE) {
@@ -1950,21 +1946,18 @@
Finds position of first occurrence of needle within part of haystack 
beginning with offset */
 PHP_FUNCTION(iconv_strpos)
 {
-   char *charset;
+   char *charset = ICONVG(internal_encoding);
int charset_len = 0;
char *haystk;
int haystk_len; 
char *ndl;
int ndl_len;
-   long offset;
+   long offset = 0;
 
php_iconv_err_t err;
 
unsigned int retval;
 
-   offset = 0;
-   charset = ICONVG(internal_encoding);
-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|ls",
&haystk, &haystk_len, &ndl, &ndl_len,
&offset, &charset, &charset_len) == FAILURE) {
@@ -2001,7 +1994,7 @@
Finds position of last occurrence of needle within part of haystack 
beginning with offset */
 PHP_FUNCTION(iconv_strrpos)
 {
-   char *charset;
+   char *charset = ICONVG(internal_encoding);
int charset_len = 0;
char *haystk;
int haystk_len; 
@@ -2012,8 +2005,6 @@
 
unsigned int retval;
 
-   charset = ICONVG(internal_encoding);
-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|s",
&haystk, &haystk_len, &ndl, &ndl_len,
&charset, &charset_len) == FAILURE) {
@@ -2167,7 +2158,7 @@
 {
char *encoded_str;
int encoded_str_len;
-   char *charset;
+   char *charset = ICONVG(internal_encoding);
int charset_len = 0;
long mode = 0;

@@ -2175,8 +2166,6 @@
 
php_iconv_err_t err;
 
-   charset = ICONVG(internal_encoding);
-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ls",
&encoded_str, &encoded_str_len, &mode, &charset, &charset_len) 
== FAILURE) {
 
@@ -2210,14 +2199,12 @@
 {
const char *encoded_str;
int encoded_str_len;
-   char *charset;
+   char *charset = ICONVG(internal_encoding);
int charset_len = 0;
long mode = 0;

php_iconv_err_t err = PHP_ICONV_ERR_SUCCESS;
 
-   charset = ICONVG(internal_encoding);
-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ls",
&encoded_str, &encoded_str_len, &mode, &charset, &charset_len) 
== FAILURE) {
 
@@ -2422,7 +2409,7 @@
 PHP_FUNCTION(iconv_get_encoding)
 {
char *type = "all";
-   int type_len;
+   int type_len = sizeof("all")-1;
 
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &type, 
&type_len) == FAILURE)
return;



-- 
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/iconv iconv.c php_iconv.h

2008-05-21 Thread Antony Dovgal
tony2001Wed May 21 15:03:20 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/iconv  iconv.c php_iconv.h 
  Log:
  MFH
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/iconv/iconv.c?r1=1.124.2.8.2.20.2.6&r2=1.124.2.8.2.20.2.7&diff_format=u
Index: php-src/ext/iconv/iconv.c
diff -u php-src/ext/iconv/iconv.c:1.124.2.8.2.20.2.6 
php-src/ext/iconv/iconv.c:1.124.2.8.2.20.2.7
--- php-src/ext/iconv/iconv.c:1.124.2.8.2.20.2.6Mon Dec 31 07:17:09 2007
+++ php-src/ext/iconv/iconv.c   Wed May 21 15:03:20 2008
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: iconv.c,v 1.124.2.8.2.20.2.6 2007/12/31 07:17:09 sebastian Exp $ */
+/* $Id: iconv.c,v 1.124.2.8.2.20.2.7 2008/05/21 15:03:20 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -228,7 +228,7 @@
 /* }}} */
 
 /* {{{ static globals */
-static char _generic_superset_name[] = "UCS-4LE";
+static char _generic_superset_name[] = ICONV_UCS4_ENCODING;
 #define GENERIC_SUPERSET_NAME _generic_superset_name
 #define GENERIC_SUPERSET_NBYTES 4
 /* }}} */
http://cvs.php.net/viewvc.cgi/php-src/ext/iconv/php_iconv.h?r1=1.28.2.2.2.2.2.3&r2=1.28.2.2.2.2.2.4&diff_format=u
Index: php-src/ext/iconv/php_iconv.h
diff -u php-src/ext/iconv/php_iconv.h:1.28.2.2.2.2.2.3 
php-src/ext/iconv/php_iconv.h:1.28.2.2.2.2.2.4
--- php-src/ext/iconv/php_iconv.h:1.28.2.2.2.2.2.3  Wed Jan 30 09:41:12 2008
+++ php-src/ext/iconv/php_iconv.h   Wed May 21 15:03:20 2008
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Revision: 1.28.2.2.2.2.2.3 $ */
+/* $Revision: 1.28.2.2.2.2.2.4 $ */
 
 #ifndef PHP_ICONV_H
 #define PHP_ICONV_H
@@ -83,11 +83,13 @@
 # define ICONV_OUTPUT_ENCODING "ISO8859-1"
 # define ICONV_INTERNAL_ENCODING "ISO8859-1"
 # define ICONV_ASCII_ENCODING "IBM-850"
+# define ICONV_UCS4_ENCODING "UCS-4"
 #else
 # define ICONV_INPUT_ENCODING "ISO-8859-1"
 # define ICONV_OUTPUT_ENCODING "ISO-8859-1"
 # define ICONV_INTERNAL_ENCODING "ISO-8859-1"
 # define ICONV_ASCII_ENCODING "ASCII"
+# define ICONV_UCS4_ENCODING "UCS-4LE"
 #endif
 
 #ifndef ICONV_CSNMAXLEN



-- 
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/iconv iconv.c

2007-11-01 Thread Antony Dovgal
tony2001Thu Nov  1 19:13:39 2007 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/iconv  iconv.c 
  Log:
  MFH: initialize correct variable
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/iconv/iconv.c?r1=1.124.2.8.2.20.2.3&r2=1.124.2.8.2.20.2.4&diff_format=u
Index: php-src/ext/iconv/iconv.c
diff -u php-src/ext/iconv/iconv.c:1.124.2.8.2.20.2.3 
php-src/ext/iconv/iconv.c:1.124.2.8.2.20.2.4
--- php-src/ext/iconv/iconv.c:1.124.2.8.2.20.2.3Sun Oct  7 05:22:04 2007
+++ php-src/ext/iconv/iconv.c   Thu Nov  1 19:13:39 2007
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: iconv.c,v 1.124.2.8.2.20.2.3 2007/10/07 05:22:04 davidw Exp $ */
+/* $Id: iconv.c,v 1.124.2.8.2.20.2.4 2007/11/01 19:13:39 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -2167,9 +2167,9 @@
 PHP_FUNCTION(iconv_mime_decode)
 {
char *encoded_str;
-   int encoded_str_len = 0;
+   int encoded_str_len;
char *charset;
-   int charset_len;
+   int charset_len = 0;
long mode = 0;

smart_str retval = {0};

-- 
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/iconv iconv.c

2007-09-27 Thread Antony Dovgal
tony2001Thu Sep 27 09:18:50 2007 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/iconv  iconv.c 
  Log:
  MFH: fix coverity issue #412
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/iconv/iconv.c?r1=1.124.2.8.2.20&r2=1.124.2.8.2.20.2.1&diff_format=u
Index: php-src/ext/iconv/iconv.c
diff -u php-src/ext/iconv/iconv.c:1.124.2.8.2.20 
php-src/ext/iconv/iconv.c:1.124.2.8.2.20.2.1
--- php-src/ext/iconv/iconv.c:1.124.2.8.2.20Fri Sep 21 13:37:30 2007
+++ php-src/ext/iconv/iconv.c   Thu Sep 27 09:18:50 2007
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: iconv.c,v 1.124.2.8.2.20 2007/09/21 13:37:30 tony2001 Exp $ */
+/* $Id: iconv.c,v 1.124.2.8.2.20.2.1 2007/09/27 09:18:50 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -2271,12 +2271,10 @@
}
 
if (header_name != NULL) {
-   zval **elem;
+   zval **elem, *new_elem;
 
if (zend_hash_find(Z_ARRVAL_P(return_value), 
header_name, header_name_len, (void **)&elem) == SUCCESS) {
if (Z_TYPE_PP(elem) != IS_ARRAY) {
-   zval *new_elem;
-
MAKE_STD_ZVAL(new_elem);
array_init(new_elem);
 

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