[PHP-CVS] com php-src: mb_split() can now handle empty matches like preg_split() does.: NEWS ext/mbstring/php_mbregex.c ext/mbstring/tests/mb_split_empty_match.phpt ext/mbstring/tests/mb_split_variati

2013-02-09 Thread Moriyoshi Koizumi
Commit:0ea83ff8478d867ebf1603a43cd5d3432022cee7
Author:Moriyoshi Koizumi m...@mozo.jp Sun, 10 Feb 2013 15:04:23 
+0900
Parents:   92a7924c1a97563cb73d37c369fdea4794203397
Branches:  PHP-5.4

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=0ea83ff8478d867ebf1603a43cd5d3432022cee7

Log:
mb_split() can now handle empty matches like preg_split() does.

Changed paths:
  M  NEWS
  M  ext/mbstring/php_mbregex.c
  A  ext/mbstring/tests/mb_split_empty_match.phpt
  M  ext/mbstring/tests/mb_split_variation1.phpt


Diff:
diff --git a/NEWS b/NEWS
index 2aff180..e3b5075 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,9 @@ PHP 
   NEWS
 - CLI server:
   . Fixed bug #64128 (buit-in web server is broken on ppc64). (Remi)
 
+- Mbstring:
+  . mb_split() can now handle empty matches like preg_split() does. (Moriyoshi)
+
 ?? ??? 2012, PHP 5.4.12
 
 - Core:
diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c
index a572bd4..145ee0c 100644
--- a/ext/mbstring/php_mbregex.c
+++ b/ext/mbstring/php_mbregex.c
@@ -1055,7 +1055,7 @@ PHP_FUNCTION(mb_split)
php_mb_regex_t *re;
OnigRegion *regs = NULL;
char *string;
-   OnigUChar *pos;
+   OnigUChar *pos, *chunk_pos;
int string_len;
 
int n, err;
@@ -1065,8 +1065,8 @@ PHP_FUNCTION(mb_split)
RETURN_FALSE;
} 
 
-   if (count == 0) {
-   count = 1;
+   if (count  0) {
+   count--;
}
 
/* create regex pattern buffer */
@@ -1076,31 +1076,30 @@ PHP_FUNCTION(mb_split)
 
array_init(return_value);
 
-   pos = (OnigUChar *)string;
+   chunk_pos = pos = (OnigUChar *)string;
err = 0;
regs = onig_region_new();
/* churn through str, generating array entries as we go */
-   while ((--count != 0) 
-  (err = onig_search(re, (OnigUChar *)string, (OnigUChar 
*)(string + string_len), pos, (OnigUChar *)(string + string_len), regs, 0)) = 
0) {
-   if (regs-beg[0] == regs-end[0]) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Empty 
regular expression);
+   while (count != 0  (pos - (OnigUChar *)string)  string_len) {
+   int beg, end;
+   err = onig_search(re, (OnigUChar *)string, (OnigUChar *)(string 
+ string_len), pos, (OnigUChar *)(string + string_len), regs, 0);
+   if (err  0) {
break;
}
-
+   beg = regs-beg[0], end = regs-end[0];
/* add it to the array */
-   if (regs-beg[0]  string_len  regs-beg[0] = (pos - 
(OnigUChar *)string)) {
-   add_next_index_stringl(return_value, (char *)pos, 
((OnigUChar *)(string + regs-beg[0]) - pos), 1);
+   if ((pos - (OnigUChar *)string)  end) {
+   if (beg  string_len  beg = (chunk_pos - (OnigUChar 
*)string)) {
+   add_next_index_stringl(return_value, (char 
*)chunk_pos, ((OnigUChar *)(string + beg) - chunk_pos), 1);
+   --count;
+   } else {
+   err = -2;
+   break;
+   }
+   /* point at our new starting point */
+   chunk_pos = pos = (OnigUChar *)string + end;
} else {
-   err = -2;
-   break;
-   }
-   /* point at our new starting point */
-   n = regs-end[0];
-   if ((pos - (OnigUChar *)string)  n) {
-   pos = (OnigUChar *)string + n;
-   }
-   if (count  0) {
-   count = 0;
+   pos++;
}
onig_region_free(regs, 0);
}
@@ -1117,9 +1116,9 @@ PHP_FUNCTION(mb_split)
}
 
/* otherwise we just have one last element to add to the array */
-   n = ((OnigUChar *)(string + string_len) - pos);
+   n = ((OnigUChar *)(string + string_len) - chunk_pos);
if (n  0) {
-   add_next_index_stringl(return_value, (char *)pos, n, 1);
+   add_next_index_stringl(return_value, (char *)chunk_pos, n, 1);
} else {
add_next_index_stringl(return_value, , 0, 1);
}
diff --git a/ext/mbstring/tests/mb_split_empty_match.phpt 
b/ext/mbstring/tests/mb_split_empty_match.phpt
new file mode 100644
index 000..df3a22c
--- /dev/null
+++ b/ext/mbstring/tests/mb_split_empty_match.phpt
@@ -0,0 +1,23 @@
+--TEST--
+mb_split() empty match
+--
+--SKIPIF--
+?php
+extension_loaded('mbstring') or die('skip');
+function_exists('mb_split') or die(skip mb_split() is not available in this 
build);
+?
+--FILE--
+?php
+mb_regex_set_options('m');
+var_dump(mb_split('^', a\nb\nc));
+--EXPECT--
+array(3) {
+  [0]=
+  string(2) a
+
+  [1

[PHP-CVS] com php-src: mb_split() can now handle empty matches like preg_split() does.: ext/mbstring/php_mbregex.c ext/mbstring/tests/mb_split_empty_match.phpt ext/mbstring/tests/mb_split_variation1.p

2013-02-09 Thread Moriyoshi Koizumi
Commit:20eb33b3212bd6c17d73c569c7345ae23c04d3ef
Author:Moriyoshi Koizumi m...@mozo.jp Sun, 10 Feb 2013 15:04:23 
+0900
Parents:   3d9a31efdfbbc3d73b8c94649f38035277264151
Branches:  PHP-5.5

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=20eb33b3212bd6c17d73c569c7345ae23c04d3ef

Log:
mb_split() can now handle empty matches like preg_split() does.

Changed paths:
  M  ext/mbstring/php_mbregex.c
  A  ext/mbstring/tests/mb_split_empty_match.phpt
  M  ext/mbstring/tests/mb_split_variation1.phpt


Diff:
diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c
index a572bd4..145ee0c 100644
--- a/ext/mbstring/php_mbregex.c
+++ b/ext/mbstring/php_mbregex.c
@@ -1055,7 +1055,7 @@ PHP_FUNCTION(mb_split)
php_mb_regex_t *re;
OnigRegion *regs = NULL;
char *string;
-   OnigUChar *pos;
+   OnigUChar *pos, *chunk_pos;
int string_len;
 
int n, err;
@@ -1065,8 +1065,8 @@ PHP_FUNCTION(mb_split)
RETURN_FALSE;
} 
 
-   if (count == 0) {
-   count = 1;
+   if (count  0) {
+   count--;
}
 
/* create regex pattern buffer */
@@ -1076,31 +1076,30 @@ PHP_FUNCTION(mb_split)
 
array_init(return_value);
 
-   pos = (OnigUChar *)string;
+   chunk_pos = pos = (OnigUChar *)string;
err = 0;
regs = onig_region_new();
/* churn through str, generating array entries as we go */
-   while ((--count != 0) 
-  (err = onig_search(re, (OnigUChar *)string, (OnigUChar 
*)(string + string_len), pos, (OnigUChar *)(string + string_len), regs, 0)) = 
0) {
-   if (regs-beg[0] == regs-end[0]) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Empty 
regular expression);
+   while (count != 0  (pos - (OnigUChar *)string)  string_len) {
+   int beg, end;
+   err = onig_search(re, (OnigUChar *)string, (OnigUChar *)(string 
+ string_len), pos, (OnigUChar *)(string + string_len), regs, 0);
+   if (err  0) {
break;
}
-
+   beg = regs-beg[0], end = regs-end[0];
/* add it to the array */
-   if (regs-beg[0]  string_len  regs-beg[0] = (pos - 
(OnigUChar *)string)) {
-   add_next_index_stringl(return_value, (char *)pos, 
((OnigUChar *)(string + regs-beg[0]) - pos), 1);
+   if ((pos - (OnigUChar *)string)  end) {
+   if (beg  string_len  beg = (chunk_pos - (OnigUChar 
*)string)) {
+   add_next_index_stringl(return_value, (char 
*)chunk_pos, ((OnigUChar *)(string + beg) - chunk_pos), 1);
+   --count;
+   } else {
+   err = -2;
+   break;
+   }
+   /* point at our new starting point */
+   chunk_pos = pos = (OnigUChar *)string + end;
} else {
-   err = -2;
-   break;
-   }
-   /* point at our new starting point */
-   n = regs-end[0];
-   if ((pos - (OnigUChar *)string)  n) {
-   pos = (OnigUChar *)string + n;
-   }
-   if (count  0) {
-   count = 0;
+   pos++;
}
onig_region_free(regs, 0);
}
@@ -1117,9 +1116,9 @@ PHP_FUNCTION(mb_split)
}
 
/* otherwise we just have one last element to add to the array */
-   n = ((OnigUChar *)(string + string_len) - pos);
+   n = ((OnigUChar *)(string + string_len) - chunk_pos);
if (n  0) {
-   add_next_index_stringl(return_value, (char *)pos, n, 1);
+   add_next_index_stringl(return_value, (char *)chunk_pos, n, 1);
} else {
add_next_index_stringl(return_value, , 0, 1);
}
diff --git a/ext/mbstring/tests/mb_split_empty_match.phpt 
b/ext/mbstring/tests/mb_split_empty_match.phpt
new file mode 100644
index 000..df3a22c
--- /dev/null
+++ b/ext/mbstring/tests/mb_split_empty_match.phpt
@@ -0,0 +1,23 @@
+--TEST--
+mb_split() empty match
+--
+--SKIPIF--
+?php
+extension_loaded('mbstring') or die('skip');
+function_exists('mb_split') or die(skip mb_split() is not available in this 
build);
+?
+--FILE--
+?php
+mb_regex_set_options('m');
+var_dump(mb_split('^', a\nb\nc));
+--EXPECT--
+array(3) {
+  [0]=
+  string(2) a
+
+  [1]=
+  string(2) b
+
+  [2]=
+  string(1) c
+}
diff --git a/ext/mbstring/tests/mb_split_variation1.phpt 
b/ext/mbstring/tests/mb_split_variation1.phpt
index be3230e..b508049 100644
--- a/ext/mbstring/tests/mb_split_variation1.phpt
+++ b/ext/mbstring/tests/mb_split_variation1.phpt
@@ -156,16 +156,12 @@ array(1) {
 }
 
 -- Iteration 10 --
-
-Warning: mb_split(): Empty regular expression in %s on line %d
 array

[PHP-CVS] com php-src: Fix bug #62373 (serialize() generates wrong reference to the object): ext/standard/tests/serialize/bug62373.phpt ext/standard/var.c

2012-06-25 Thread Moriyoshi Koizumi
Commit:e42718227945202044516c71f0098fe464987410
Author:Moriyoshi Koizumi m...@mozo.jp Mon, 25 Jun 2012 19:13:23 
+0900
Parents:   5b3f4d25ea047f14d6485fb6f456cece384d33ee
Branches:  PHP-5.3

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=e42718227945202044516c71f0098fe464987410

Log:
Fix bug #62373 (serialize() generates wrong reference to the object)

Bugs:
https://bugs.php.net/62373

Changed paths:
  A  ext/standard/tests/serialize/bug62373.phpt
  M  ext/standard/var.c


Diff:
diff --git a/ext/standard/tests/serialize/bug62373.phpt 
b/ext/standard/tests/serialize/bug62373.phpt
new file mode 100644
index 000..666c33e
--- /dev/null
+++ b/ext/standard/tests/serialize/bug62373.phpt
@@ -0,0 +1,25 @@
+--TEST--
+Bug #62373 (serialize() generates wrong reference to the object)
+--FILE--
+?php
+class A {}
+class B {}
+
+$size_of_ce = (((int)(log(PHP_INT_MAX) / log(2)) + 1 == 32 ? 368: 680) + 15)  
~15;
+$dummy = array();
+$b = new B();
+$period = $size_of_ce  5;
+for ($i = 0; $i  $period * 3; $i++) {
+$a = new A();
+$s = unserialize(serialize(array($b, $a)));
+if ($s[0] === $s[1]) {
+echo OOPS\n;
+break; 
+}
+$dummy[] = $a;
+}
+
+echo OK\n;
+?
+--EXPECT--
+OK
diff --git a/ext/standard/var.c b/ext/standard/var.c
index ddcfde0..3e2a45c 100644
--- a/ext/standard/var.c
+++ b/ext/standard/var.c
@@ -544,12 +544,9 @@ static inline int php_add_var_hash(HashTable *var_hash, 
zval *var, void *var_old
 
/* relies on (long) being a perfect hash function for data pointers,
 * however the actual identity of an object has had to be determined
-* by its object handle and the class entry since 5.0. */
+* by its object handle since 5.0. */
if ((Z_TYPE_P(var) == IS_OBJECT)  Z_OBJ_HT_P(var)-get_class_entry) {
-   p = smart_str_print_long(id + sizeof(id) - 1,
-   (((size_t)Z_OBJCE_P(var)  5)
-   | ((size_t)Z_OBJCE_P(var)  (sizeof(long) * 8 
- 5)))
-   + (long) Z_OBJ_HANDLE_P(var));
+   p = smart_str_print_long(id + sizeof(id) - 1, (long) 
Z_OBJ_HANDLE_P(var));
*(--p) = 'O';
len = id + sizeof(id) - 1 - p;
} else {


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



[PHP-CVS] com php-src: Fix bug #62373 (serialize() generates wrong reference to the object): ext/standard/tests/serialize/bug62373.phpt ext/standard/var.c

2012-06-25 Thread Moriyoshi Koizumi
Commit:91e1df704eed40325fd963a308e466bbbf96184f
Author:Moriyoshi Koizumi m...@mozo.jp Mon, 25 Jun 2012 19:13:23 
+0900
Parents:   ad641950b3d047fc20729b7a18c62b414622cc79
Branches:  PHP-5.4 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=91e1df704eed40325fd963a308e466bbbf96184f

Log:
Fix bug #62373 (serialize() generates wrong reference to the object)

Bugs:
https://bugs.php.net/62373

Changed paths:
  A  ext/standard/tests/serialize/bug62373.phpt
  M  ext/standard/var.c


Diff:
diff --git a/ext/standard/tests/serialize/bug62373.phpt 
b/ext/standard/tests/serialize/bug62373.phpt
new file mode 100644
index 000..666c33e
--- /dev/null
+++ b/ext/standard/tests/serialize/bug62373.phpt
@@ -0,0 +1,25 @@
+--TEST--
+Bug #62373 (serialize() generates wrong reference to the object)
+--FILE--
+?php
+class A {}
+class B {}
+
+$size_of_ce = (((int)(log(PHP_INT_MAX) / log(2)) + 1 == 32 ? 368: 680) + 15)  
~15;
+$dummy = array();
+$b = new B();
+$period = $size_of_ce  5;
+for ($i = 0; $i  $period * 3; $i++) {
+$a = new A();
+$s = unserialize(serialize(array($b, $a)));
+if ($s[0] === $s[1]) {
+echo OOPS\n;
+break; 
+}
+$dummy[] = $a;
+}
+
+echo OK\n;
+?
+--EXPECT--
+OK
diff --git a/ext/standard/var.c b/ext/standard/var.c
index c6126e9..735d0a7 100644
--- a/ext/standard/var.c
+++ b/ext/standard/var.c
@@ -541,12 +541,9 @@ static inline int php_add_var_hash(HashTable *var_hash, 
zval *var, void *var_old
 
/* relies on (long) being a perfect hash function for data pointers,
 * however the actual identity of an object has had to be determined
-* by its object handle and the class entry since 5.0. */
+* by its object handle since 5.0. */
if ((Z_TYPE_P(var) == IS_OBJECT)  Z_OBJ_HT_P(var)-get_class_entry) {
-   p = smart_str_print_long(id + sizeof(id) - 1,
-   (((size_t)Z_OBJCE_P(var)  5)
-   | ((size_t)Z_OBJCE_P(var)  (sizeof(long) * 8 
- 5)))
-   + (long) Z_OBJ_HANDLE_P(var));
+   p = smart_str_print_long(id + sizeof(id) - 1, (long) 
Z_OBJ_HANDLE_P(var));
*(--p) = 'O';
len = id + sizeof(id) - 1 - p;
} else {


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



[PHP-CVS] com php-src: BFN: NEWS

2012-06-25 Thread Moriyoshi Koizumi
Commit:ce2082d24f2461b6403e13563ed18656a95581fa
Author:Moriyoshi Koizumi m...@mozo.jp Mon, 25 Jun 2012 19:20:38 
+0900
Parents:   e42718227945202044516c71f0098fe464987410
Branches:  PHP-5.3

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=ce2082d24f2461b6403e13563ed18656a95581fa

Log:
BFN

Changed paths:
  M  NEWS


Diff:
diff --git a/NEWS b/NEWS
index b9bb009..63e91f5 100644
--- a/NEWS
+++ b/NEWS
@@ -92,6 +92,8 @@ PHP   
 NEWS
 (Anatoliy)
   . Fixed bug #61991 (long overflow in realpath_cache_get()). (Anatoliy)
   . Changed php://fd to be available only for CLI.
+  . Fixed bug #62373 (serialize() generates wrong reference to the object).
+(Moriyoshi)
 
 - Fileinfo:
   . Fixed bug #61812 (Uninitialised value used in libmagic).


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



[PHP-CVS] com php-src: Reset LIBS temporarily to make sure PHP_CHECK_FUNC will look into libc.: NEWS acinclude.m4

2012-04-02 Thread Moriyoshi Koizumi
Commit:a6c95c8a00e9286ccc662e9682f9254e153d6833
Author:Moriyoshi Koizumi m...@mozo.jp Tue, 3 Apr 2012 01:32:42 
+0900
Parents:   8684fb7facd8f5c1589996c1ebfd782f77c245ff
Branches:  PHP-5.3 PHP-5.4 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=a6c95c8a00e9286ccc662e9682f9254e153d6833

Log:
Reset LIBS temporarily to make sure PHP_CHECK_FUNC will look into libc.

See Gentoo bug #364139. https://bugs.gentoo.org/show_bug.cgi?id=364139
Reported by Naohiro Aota.

Bugs:
https://bugs.php.net/364139

Changed paths:
  M  NEWS
  M  acinclude.m4


Diff:
diff --git a/NEWS b/NEWS
index c7cd2c7..736ffe8 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,11 @@ PHP
NEWS
 ?? ??? 2012, PHP 5.3.12
 
 ?? ??? 2012, PHP 5.3.11
+- Iconv extension:
+  . Fixed a bug that iconv extension fails to link to the correct library
+when another extension makes use of a library that links to the iconv
+library. See https://bugs.gentoo.org/show_bug.cgi?id=364139 for detail.
+(Moriyoshi)
 
 (merge after 5.3.11 release)
 
diff --git a/acinclude.m4 b/acinclude.m4
index 5515b3f..ddf7285 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -2438,7 +2438,12 @@ AC_DEFUN([PHP_SETUP_ICONV], [
   dnl
   dnl Check libc first if no path is provided in --with-iconv
   dnl
+
   if test $PHP_ICONV = yes; then
+dnl Reset LIBS temporarily as it may have already been included
+dnl -liconv in.
+LIBS_save=$LIBS
+LIBS=
 AC_CHECK_FUNC(iconv, [
   found_iconv=yes
 ],[
@@ -2448,6 +2453,7 @@ AC_DEFUN([PHP_SETUP_ICONV], [
 found_iconv=yes
   ])
 ])
+LIBS=$LIBS_save
   fi
 
   dnl


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



[PHP-CVS] com php-src: Merge branch 'PHP-5.3' into PHP-5.4: acinclude.m4

2012-04-02 Thread Moriyoshi Koizumi
Commit:43047598c4e4ed76daa82ff509e46c40087f0ea4
Author:Moriyoshi Koizumi m...@mozo.jp Tue, 3 Apr 2012 02:00:23 
+0900
Parents:   374646c36b07956da928e0583854002e55b4013e 
a6c95c8a00e9286ccc662e9682f9254e153d6833
Branches:  PHP-5.4 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=43047598c4e4ed76daa82ff509e46c40087f0ea4

Log:
Merge branch 'PHP-5.3' into PHP-5.4

Conflicts:
NEWS

Changed paths:
  MM  acinclude.m4


Diff:



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



Re: [PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/ mbfilter_utf8.c

2011-10-23 Thread Moriyoshi Koizumi
I thought it was valid in terms of CEF nature of UTF-8, but it turrned out RFC 
states such sequences that start with F5-F7 are not valid.
Thanks for the clarification.

Moriyoshi

On 2011/10/23, at 20:25, Rui Hirokawa wrote:

 Hello, Moriyoshi,
 
 It is because 0xf5-0xf7 is the invalid four byte UTF-8 sequence.
 
 ref: http://en.wikipedia.org/wiki/UTF-8
 
 Rui
 
 Moriyoshi Koizumi wrote:
 Rui, what is the reason behind this change?
 
 Moriyoshi
 
 On 2011/10/18, at 23:04, Rui Hirokawa wrote:
 
 hirokawa Tue, 18 Oct 2011 14:04:13 +
 
 Revision: http://svn.php.net/viewvc?view=revisionrevision=318184
 
 Log:
 MFH: fixed byte length of utf-8.
 
 Changed paths:
   U   
 php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8.c
 
 Modified: 
 php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8.c
 ===
 --- 
 php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8.c   
 2011-10-18 14:03:44 UTC (rev 318183)
 +++ 
 php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8.c   
 2011-10-18 14:04:13 UTC (rev 318184)
 @@ -52,7 +52,7 @@
 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
 -   4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1
 +   4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
 };
 
 static const char *mbfl_encoding_utf8_aliases[] = {utf8, NULL};
 
 -- 
 PHP CVS Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

-- 
Moriyoshi Koizumi
m...@mozo.jp




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



Re: [PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/ mbfilter_utf8.c

2011-10-21 Thread Moriyoshi Koizumi
Rui, what is the reason behind this change?

Moriyoshi

On 2011/10/18, at 23:04, Rui Hirokawa wrote:

 hirokawa Tue, 18 Oct 2011 14:04:13 +
 
 Revision: http://svn.php.net/viewvc?view=revisionrevision=318184
 
 Log:
 MFH: fixed byte length of utf-8.
 
 Changed paths:
U   
 php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8.c
 
 Modified: 
 php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8.c
 ===
 --- php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8.c 
 2011-10-18 14:03:44 UTC (rev 318183)
 +++ php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8.c 
 2011-10-18 14:04:13 UTC (rev 318184)
 @@ -52,7 +52,7 @@
   2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
   2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
   3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
 - 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1
 + 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
 };
 
 static const char *mbfl_encoding_utf8_aliases[] = {utf8, NULL};
 
 -- 
 PHP CVS Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

-- 
Moriyoshi Koizumi
m...@mozo.jp




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



[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/sapi/cli/php_cli_server.c branches/PHP_5_4/sapi/cli/tests/php_cli_server_008.phpt trunk/sapi/cli/php_cli_server.c trunk/sapi/cli/tests/php_cli_server_008.

2011-10-20 Thread Moriyoshi Koizumi
moriyoshiFri, 21 Oct 2011 05:24:30 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=318283

Log:
Add SERVER_PROTOCOL variable to $_SERVER.  Patch by kuzuha.  Thanks.

Changed paths:
U   php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c
A   php/php-src/branches/PHP_5_4/sapi/cli/tests/php_cli_server_008.phpt
U   php/php-src/trunk/sapi/cli/php_cli_server.c
A   php/php-src/trunk/sapi/cli/tests/php_cli_server_008.phpt

Modified: php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c
===
--- php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c  2011-10-21 
01:39:45 UTC (rev 318282)
+++ php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c  2011-10-21 
05:24:30 UTC (rev 318283)
@@ -571,6 +571,12 @@
sapi_cli_server_register_variable(track_vars_array, 
SERVER_SOFTWARE, tmp TSRMLS_CC);
efree(tmp);
}
+   {
+   char *tmp;
+   spprintf(tmp, 0, HTTP/%d.%d, 
client-request.protocol_version / 100, client-request.protocol_version % 100);
+   sapi_cli_server_register_variable(track_vars_array, 
SERVER_PROTOCOL, tmp TSRMLS_CC);
+   efree(tmp);
+   }
sapi_cli_server_register_variable(track_vars_array, REQUEST_URI, 
client-request.request_uri TSRMLS_CC);
sapi_cli_server_register_variable(track_vars_array, REQUEST_METHOD, 
SG(request_info).request_method TSRMLS_CC);
sapi_cli_server_register_variable(track_vars_array, PHP_SELF, 
client-request.vpath TSRMLS_CC);

Added: php/php-src/branches/PHP_5_4/sapi/cli/tests/php_cli_server_008.phpt
===
--- php/php-src/branches/PHP_5_4/sapi/cli/tests/php_cli_server_008.phpt 
(rev 0)
+++ php/php-src/branches/PHP_5_4/sapi/cli/tests/php_cli_server_008.phpt 
2011-10-21 05:24:30 UTC (rev 318283)
@@ -0,0 +1,71 @@
+--TEST--
+SERVER_PROTOCOL header availability
+--SKIPIF--
+?php
+include skipif.inc;
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+die (skip not for Windows);
+}
+?
+--FILE--
+?php
+include php_cli_server.inc;
+php_cli_server_start('var_dump($_SERVER[SERVER_PROTOCOL]);');
+
+list($host, $port) = explode(':', PHP_CLI_SERVER_ADDRESS);
+$port = intval($port)?:80;
+
+$fp = fsockopen($host, $port, $errno, $errstr, 0.5);
+if (!$fp) {
+  die(connect failed);
+}
+
+if(fwrite($fp, HEADER
+GET / HTTP/1.1
+Host: {$host}
+
+
+HEADER
+)) {
+   while (!feof($fp)) {
+   echo fgets($fp);
+   }
+}
+
+fclose($fp);
+
+$fp = fsockopen($host, $port, $errno, $errstr, 0.5);
+if (!$fp) {
+  die(connect failed);
+}
+
+
+if(fwrite($fp, HEADER
+GET / HTTP/1.0
+Host: {$host}
+
+
+HEADER
+)) {
+   while (!feof($fp)) {
+   echo fgets($fp);
+   }
+}
+
+fclose($fp);
+?
+--EXPECTF--
+HTTP/1.1 200 OK
+Host: %s
+Connection: closed
+X-Powered-By: PHP/%s-dev
+Content-type: text/html
+
+string(8) HTTP/1.1
+HTTP/1.0 200 OK
+Host: %s
+Connection: closed
+X-Powered-By: PHP/%s-dev
+Content-type: text/html
+
+string(8) HTTP/1.0

Modified: php/php-src/trunk/sapi/cli/php_cli_server.c
===
--- php/php-src/trunk/sapi/cli/php_cli_server.c 2011-10-21 01:39:45 UTC (rev 
318282)
+++ php/php-src/trunk/sapi/cli/php_cli_server.c 2011-10-21 05:24:30 UTC (rev 
318283)
@@ -571,6 +571,12 @@
sapi_cli_server_register_variable(track_vars_array, 
SERVER_SOFTWARE, tmp TSRMLS_CC);
efree(tmp);
}
+   {
+   char *tmp;
+   spprintf(tmp, 0, HTTP/%d.%d, 
client-request.protocol_version / 100, client-request.protocol_version % 100);
+   sapi_cli_server_register_variable(track_vars_array, 
SERVER_PROTOCOL, tmp TSRMLS_CC);
+   efree(tmp);
+   }
sapi_cli_server_register_variable(track_vars_array, REQUEST_URI, 
client-request.request_uri TSRMLS_CC);
sapi_cli_server_register_variable(track_vars_array, REQUEST_METHOD, 
SG(request_info).request_method TSRMLS_CC);
sapi_cli_server_register_variable(track_vars_array, PHP_SELF, 
client-request.vpath TSRMLS_CC);

Added: php/php-src/trunk/sapi/cli/tests/php_cli_server_008.phpt
===
--- php/php-src/trunk/sapi/cli/tests/php_cli_server_008.phpt
(rev 0)
+++ php/php-src/trunk/sapi/cli/tests/php_cli_server_008.phpt2011-10-21 
05:24:30 UTC (rev 318283)
@@ -0,0 +1,71 @@
+--TEST--
+SERVER_PROTOCOL header availability
+--SKIPIF--
+?php
+include skipif.inc;
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+die (skip not for Windows);
+}
+?
+--FILE--
+?php
+include php_cli_server.inc;
+php_cli_server_start('var_dump($_SERVER[SERVER_PROTOCOL]);');
+
+list($host, $port) = explode(':', PHP_CLI_SERVER_ADDRESS);
+$port = intval($port)?:80;
+
+$fp = fsockopen($host, $port, $errno, $errstr, 

Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/sapi/cli/php_cli_server.c trunk/sapi/cli/php_cli_server.c

2011-09-20 Thread Moriyoshi Koizumi
Hi,

Where does HAVE_BROKEN_GETCWD come from? Isn't simply using VCWD_GETCWD 
sufficient?

Moriyoshi

On 2011/09/20, at 16:06, Xinchen Hui wrote:

 laruence Tue, 20 Sep 2011 07:06:55 +
 
 Revision: http://svn.php.net/viewvc?view=revisionrevision=317040
 
 Log:
 Fix Bug #55726 (Changing the working directory makes router script 
 inaccessible)
 
 Bug: https://bugs.php.net/55726 (Assigned) Changing the working directory 
 makes router script inaccessible
 
 Changed paths:
U   php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c
U   php/php-src/trunk/sapi/cli/php_cli_server.c
 
 Modified: php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c
 ===
 --- php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c2011-09-20 
 05:42:36 UTC (rev 317039)
 +++ php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c2011-09-20 
 07:06:55 UTC (rev 317040)
 @@ -1877,11 +1877,24 @@
   }
   {
   zend_file_handle zfd;
 +#if HAVE_BROKEN_GETCWD
 + int old_cwd_fd = -1;
 + old_cwd_fd = open(., 0);
 +#else
 + char *old_cwd;
 + ALLOCA_FLAG(use_heap)
 +#define OLD_CWD_SIZE 4096
 + old_cwd = do_alloca(OLD_CWD_SIZE, use_heap);
 + old_cwd[0] = '\0';
 + php_ignore_value(VCWD_GETCWD(old_cwd, OLD_CWD_SIZE-1));
 +#endif
 +
   zfd.type = ZEND_HANDLE_FILENAME;
   zfd.filename = server-router;
   zfd.handle.fp = NULL;
   zfd.free_filename = 0;
   zfd.opened_path = NULL;
 +
   zend_try {
   zval *retval = NULL;
   if (SUCCESS == zend_execute_scripts(ZEND_REQUIRE 
 TSRMLS_CC, retval, 1, zfd)) {
 @@ -1893,6 +1906,18 @@
   decline = 1;
   }
   } zend_end_try();
 +
 +#if HAVE_BROKEN_GETCWD
 + if (old_cwd_fd != -1) {
 + fchdir(old_cwd_fd);
 + close(old_cwd_fd);
 + }
 +#else
 + if (old_cwd[0] != '\0') {
 + php_ignore_value(VCWD_CHDIR(old_cwd));
 + }
 + free_alloca(old_cwd, use_heap);
 +#endif
   }
 
   if (decline) {
 
 Modified: php/php-src/trunk/sapi/cli/php_cli_server.c
 ===
 --- php/php-src/trunk/sapi/cli/php_cli_server.c   2011-09-20 05:42:36 UTC 
 (rev 317039)
 +++ php/php-src/trunk/sapi/cli/php_cli_server.c   2011-09-20 07:06:55 UTC 
 (rev 317040)
 @@ -1877,11 +1877,24 @@
   }
   {
   zend_file_handle zfd;
 +#if HAVE_BROKEN_GETCWD
 + int old_cwd_fd = -1;
 + old_cwd_fd = open(., 0);
 +#else
 + char *old_cwd;
 + ALLOCA_FLAG(use_heap)
 +#define OLD_CWD_SIZE 4096
 + old_cwd = do_alloca(OLD_CWD_SIZE, use_heap);
 + old_cwd[0] = '\0';
 + php_ignore_value(VCWD_GETCWD(old_cwd, OLD_CWD_SIZE-1));
 +#endif
 +
   zfd.type = ZEND_HANDLE_FILENAME;
   zfd.filename = server-router;
   zfd.handle.fp = NULL;
   zfd.free_filename = 0;
   zfd.opened_path = NULL;
 +
   zend_try {
   zval *retval = NULL;
   if (SUCCESS == zend_execute_scripts(ZEND_REQUIRE 
 TSRMLS_CC, retval, 1, zfd)) {
 @@ -1893,6 +1906,18 @@
   decline = 1;
   }
   } zend_end_try();
 +
 +#if HAVE_BROKEN_GETCWD
 + if (old_cwd_fd != -1) {
 + fchdir(old_cwd_fd);
 + close(old_cwd_fd);
 + }
 +#else
 + if (old_cwd[0] != '\0') {
 + php_ignore_value(VCWD_CHDIR(old_cwd));
 + }
 + free_alloca(old_cwd, use_heap);
 +#endif
   }
 
   if (decline) {
 
 -- 
 PHP CVS Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

-- 
Moriyoshi Koizumi
m...@mozo.jp




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



[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/sapi/cli/php_cli_server.c trunk/sapi/cli/php_cli_server.c

2011-07-23 Thread Moriyoshi Koizumi
moriyoshiSat, 23 Jul 2011 11:29:26 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=313627

Log:
- Give index.php a precedence over index.html.  Patch by davidc.

Changed paths:
U   php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c
U   php/php-src/trunk/sapi/cli/php_cli_server.c

Modified: php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c
===
--- php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c  2011-07-23 
09:27:15 UTC (rev 313626)
+++ php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c  2011-07-23 
11:29:26 UTC (rev 313627)
@@ -1065,7 +1065,7 @@
 static void php_cli_server_request_translate_vpath(php_cli_server_request 
*request, const char *document_root, size_t document_root_len) /* {{{ */
 {
struct stat sb;
-   static const char *index_files[] = { index.html, index.php, NULL };
+   static const char *index_files[] = { index.php, index.html, NULL };
char *buf = safe_pemalloc(1, request-vpath_len, 1 + document_root_len 
+ 1 + sizeof(index.html), 1);
char *p = buf, *prev_patch = 0, *q, *vpath;
memmove(p, document_root, document_root_len);

Modified: php/php-src/trunk/sapi/cli/php_cli_server.c
===
--- php/php-src/trunk/sapi/cli/php_cli_server.c 2011-07-23 09:27:15 UTC (rev 
313626)
+++ php/php-src/trunk/sapi/cli/php_cli_server.c 2011-07-23 11:29:26 UTC (rev 
313627)
@@ -1065,7 +1065,7 @@
 static void php_cli_server_request_translate_vpath(php_cli_server_request 
*request, const char *document_root, size_t document_root_len) /* {{{ */
 {
struct stat sb;
-   static const char *index_files[] = { index.html, index.php, NULL };
+   static const char *index_files[] = { index.php, index.html, NULL };
char *buf = safe_pemalloc(1, request-vpath_len, 1 + document_root_len 
+ 1 + sizeof(index.html), 1);
char *p = buf, *prev_patch = 0, *q, *vpath;
memmove(p, document_root, document_root_len);

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/sapi/cli/php_cli_server.c trunk/sapi/cli/php_cli_server.c

2011-07-21 Thread Moriyoshi Koizumi
moriyoshiThu, 21 Jul 2011 07:31:29 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=313496

Log:
- Show PHP_VERSION in the banner. Suggested by Chris and others.

Changed paths:
U   php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c
U   php/php-src/trunk/sapi/cli/php_cli_server.c

Modified: php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c
===
--- php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c  2011-07-21 
03:41:21 UTC (rev 313495)
+++ php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c  2011-07-21 
07:31:29 UTC (rev 313496)
@@ -2134,11 +2134,11 @@
gettimeofday(tv, NULL);
php_localtime_r(tv.tv_sec, tm);
php_asctime_r(tm, buf);
-   printf(PHP Development Server started at %s
+   printf(PHP %s Development Server started at %s
Listening on %s\n
Document root is %s\n
Press Ctrl-C to quit.\n,
-   buf, server_bind_address, document_root);
+   PHP_VERSION, buf, server_bind_address, 
document_root);
}

 #if defined(HAVE_SIGNAL_H)  defined(SIGINT)

Modified: php/php-src/trunk/sapi/cli/php_cli_server.c
===
--- php/php-src/trunk/sapi/cli/php_cli_server.c 2011-07-21 03:41:21 UTC (rev 
313495)
+++ php/php-src/trunk/sapi/cli/php_cli_server.c 2011-07-21 07:31:29 UTC (rev 
313496)
@@ -2134,11 +2134,11 @@
gettimeofday(tv, NULL);
php_localtime_r(tv.tv_sec, tm);
php_asctime_r(tm, buf);
-   printf(PHP Development Server started at %s
+   printf(PHP %s Development Server started at %s
Listening on %s\n
Document root is %s\n
Press Ctrl-C to quit.\n,
-   buf, server_bind_address, document_root);
+   PHP_VERSION, buf, server_bind_address, 
document_root);
}

 #if defined(HAVE_SIGNAL_H)  defined(SIGINT)

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/sapi/cli/php_cli_server.c trunk/sapi/cli/php_cli_server.c

2011-07-20 Thread Moriyoshi Koizumi
moriyoshiWed, 20 Jul 2011 08:43:12 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=313466

Log:
- Better error handling.

Changed paths:
U   php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c
U   php/php-src/trunk/sapi/cli/php_cli_server.c

Modified: php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c
===
--- php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c  2011-07-20 
07:48:08 UTC (rev 313465)
+++ php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c  2011-07-20 
08:43:12 UTC (rev 313466)
@@ -1805,9 +1805,9 @@
int err = 0;
int port = 3000;
php_socket_t server_sock = SOCK_ERR;
+   char *p = NULL;

if (addr[0] == '[') {
-   char *p;
host = pestrdup(addr + 1, 1);
if (!host) {
return FAILURE;
@@ -1817,27 +1817,32 @@
*p++ = '\0';
if (*p == ':') {
port = strtol(p + 1, p, 10);
+   if (port = 0) {
+   p = NULL;
+   }
} else if (*p != '\0') {
p = NULL;
}
}
-   if (!p) {
-   fprintf(stderr, Invalid IPv6 address: %s\n, host);
-   retval = FAILURE;
-   goto out;
-   }
} else {
-   char *p;
host = pestrdup(addr, 1);
if (!host) {
return FAILURE;
}
-   p = strrchr(host, ':');
+   p = strchr(host, ':');
if (p) {
*p++ = '\0';
port = strtol(p, p, 10);
+   if (port = 0) {
+   p = NULL;
+   }
}
}
+   if (!p) {
+   fprintf(stderr, Invalid address: %s\n, addr);
+   retval = FAILURE;
+   goto out;
+   }

server_sock = php_network_listen_socket(host, port, SOCK_STREAM, 
server-address_family, server-socklen, errstr TSRMLS_CC);
if (server_sock == SOCK_ERR) {

Modified: php/php-src/trunk/sapi/cli/php_cli_server.c
===
--- php/php-src/trunk/sapi/cli/php_cli_server.c 2011-07-20 07:48:08 UTC (rev 
313465)
+++ php/php-src/trunk/sapi/cli/php_cli_server.c 2011-07-20 08:43:12 UTC (rev 
313466)
@@ -1805,9 +1805,9 @@
int err = 0;
int port = 3000;
php_socket_t server_sock = SOCK_ERR;
+   char *p = NULL;

if (addr[0] == '[') {
-   char *p;
host = pestrdup(addr + 1, 1);
if (!host) {
return FAILURE;
@@ -1817,27 +1817,32 @@
*p++ = '\0';
if (*p == ':') {
port = strtol(p + 1, p, 10);
+   if (port = 0) {
+   p = NULL;
+   }
} else if (*p != '\0') {
p = NULL;
}
}
-   if (!p) {
-   fprintf(stderr, Invalid IPv6 address: %s\n, host);
-   retval = FAILURE;
-   goto out;
-   }
} else {
-   char *p;
host = pestrdup(addr, 1);
if (!host) {
return FAILURE;
}
-   p = strrchr(host, ':');
+   p = strchr(host, ':');
if (p) {
*p++ = '\0';
port = strtol(p, p, 10);
+   if (port = 0) {
+   p = NULL;
+   }
}
}
+   if (!p) {
+   fprintf(stderr, Invalid address: %s\n, addr);
+   retval = FAILURE;
+   goto out;
+   }

server_sock = php_network_listen_socket(host, port, SOCK_STREAM, 
server-address_family, server-socklen, errstr TSRMLS_CC);
if (server_sock == SOCK_ERR) {

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/sapi/cli/php_cli_server.c trunk/sapi/cli/php_cli_server.c

2011-07-20 Thread Moriyoshi Koizumi
moriyoshiWed, 20 Jul 2011 09:00:20 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=313467

Log:
Fixed bug #55071.  Maybe a bit overkill?

Bug: https://bugs.php.net/55071 (Re-Opened) Change in-built web server 
description
  
Changed paths:
U   php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c
U   php/php-src/trunk/sapi/cli/php_cli_server.c

Modified: php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c
===
--- php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c  2011-07-20 
08:43:12 UTC (rev 313466)
+++ php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c  2011-07-20 
09:00:20 UTC (rev 313467)
@@ -2127,7 +2127,19 @@
}
sapi_module.phpinfo_as_text = 0;

-   printf(PHP Development Server is listening on %s in %s ... Press 
Ctrl-C to quit.\n, server_bind_address, document_root);
+   {
+   struct timeval tv;
+   struct tm tm;
+   char buf[52];
+   gettimeofday(tv, NULL);
+   php_localtime_r(tv.tv_sec, tm);
+   php_asctime_r(tm, buf);
+   printf(PHP Development Server started at %s
+   Listening on %s\n
+   Document root is %s\n
+   Press Ctrl-C to quit.\n,
+   buf, server_bind_address, document_root);
+   }

 #if defined(HAVE_SIGNAL_H)  defined(SIGINT)
signal(SIGINT, php_cli_server_sigint_handler);

Modified: php/php-src/trunk/sapi/cli/php_cli_server.c
===
--- php/php-src/trunk/sapi/cli/php_cli_server.c 2011-07-20 08:43:12 UTC (rev 
313466)
+++ php/php-src/trunk/sapi/cli/php_cli_server.c 2011-07-20 09:00:20 UTC (rev 
313467)
@@ -2127,7 +2127,19 @@
}
sapi_module.phpinfo_as_text = 0;

-   printf(PHP Development Server is listening on %s in %s ... Press 
Ctrl-C to quit.\n, server_bind_address, document_root);
+   {
+   struct timeval tv;
+   struct tm tm;
+   char buf[52];
+   gettimeofday(tv, NULL);
+   php_localtime_r(tv.tv_sec, tm);
+   php_asctime_r(tm, buf);
+   printf(PHP Development Server started at %s
+   Listening on %s\n
+   Document root is %s\n
+   Press Ctrl-C to quit.\n,
+   buf, server_bind_address, document_root);
+   }

 #if defined(HAVE_SIGNAL_H)  defined(SIGINT)
signal(SIGINT, php_cli_server_sigint_handler);

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/sapi/cli/php_cli_server.c trunk/sapi/cli/php_cli_server.c

2011-07-19 Thread Moriyoshi Koizumi
moriyoshiTue, 19 Jul 2011 17:47:34 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=313441

Log:
- Print HTTP method as well in the log.
- Print response code also when the request is processed by a script.
- Those changes partly closes #55109.

Bug: https://bugs.php.net/55109 (Assigned) Friendly log messages
  
Changed paths:
U   php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c
U   php/php-src/trunk/sapi/cli/php_cli_server.c

Modified: php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c
===
--- php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c  2011-07-19 
16:17:07 UTC (rev 313440)
+++ php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c  2011-07-19 
17:47:34 UTC (rev 313441)
@@ -1479,7 +1479,7 @@
 static void php_cli_server_close_connection(php_cli_server *server, 
php_cli_server_client *client TSRMLS_DC) /* {{{ */
 {
 #ifdef DEBUG
-   php_cli_server_logf(%s: Closing TSRMLS_CC, client-addr_str);
+   php_cli_server_logf(%s Closing TSRMLS_CC, client-addr_str);
 #endif
zend_hash_index_del(server-clients, client-sock);
 } /* }}} */
@@ -1575,7 +1575,7 @@
php_cli_server_buffer_prepend(client-content_sender.buffer, 
chunk);
}

-   php_cli_server_logf(%s: %s - Sending error page (%d) TSRMLS_CC, 
client-addr_str, client-request.request_uri, status);
+   php_cli_server_logf(%s %s %s - Sending error page (%d) TSRMLS_CC, 
client-addr_str, php_http_method_str(client-request.request_method), 
client-request.request_uri, status);
php_cli_server_poller_add(server-poller, POLLOUT, client-sock);
efree(escaped_request_uri);
return SUCCESS;
@@ -1612,6 +1612,8 @@
} zend_end_try();
}

+   php_cli_server_logf(%s %s %s - Response sent successfully (%d) 
TSRMLS_CC, client-addr_str, 
php_http_method_str(client-request.request_method), 
client-request.request_uri, SG(sapi_headers).http_response_code);
+
php_request_shutdown(0);
php_cli_server_close_connection(server, client TSRMLS_CC);
destroy_request_info(SG(request_info));
@@ -1627,10 +1629,10 @@
if (fd  0) {
char *errstr = get_last_error();
if (errstr) {
-   php_cli_server_logf(%s: %s - %s TSRMLS_CC, 
client-addr_str, client-request.request_uri, errstr);
+   php_cli_server_logf(%s %s %s - %s TSRMLS_CC, 
client-addr_str, php_http_method_str(client-request.request_method), 
client-request.request_uri, errstr);
pefree(errstr, 1);
} else {
-   php_cli_server_logf(%s: %s - ? TSRMLS_CC, 
client-addr_str, client-request.request_uri);
+   php_cli_server_logf(%s %s %s - ? TSRMLS_CC, 
client-addr_str, php_http_method_str(client-request.request_method), 
client-request.request_uri);
}
return php_cli_server_send_error_page(server, client, 404 
TSRMLS_CC);
}
@@ -1880,12 +1882,12 @@
char *errstr = NULL;
int status = php_cli_server_client_read_request(client, errstr 
TSRMLS_CC);
if (status  0) {
-   php_cli_server_logf(%s: Invalid request (%s) TSRMLS_CC, 
client-addr_str, errstr);
+   php_cli_server_logf(%s Invalid request (%s) TSRMLS_CC, 
client-addr_str, errstr);
efree(errstr);
php_cli_server_close_connection(server, client TSRMLS_CC);
return FAILURE;
} else if (status == 1) {
-   php_cli_server_logf(%s: %s TSRMLS_CC, client-addr_str, 
client-request.request_uri);
+   php_cli_server_logf(%s %s %s - Request read TSRMLS_CC, 
client-addr_str, php_http_method_str(client-request.request_method), 
client-request.request_uri);
php_cli_server_poller_remove(server-poller, POLLIN, 
client-sock);
php_cli_server_dispatch(server, client TSRMLS_CC);
} else {
@@ -1970,7 +1972,7 @@
return SUCCESS;
}
 #ifdef DEBUG
-   php_cli_server_logf(%s: Accepted TSRMLS_CC, client-addr_str);
+   php_cli_server_logf(%s Accepted TSRMLS_CC, client-addr_str);
 #endif
zend_hash_index_update(server-clients, client_sock, client, 
sizeof(client), NULL);
php_cli_server_recv_event_read_request(server, client 
TSRMLS_CC);

Modified: php/php-src/trunk/sapi/cli/php_cli_server.c
===
--- php/php-src/trunk/sapi/cli/php_cli_server.c 2011-07-19 16:17:07 UTC (rev 
313440)
+++ php/php-src/trunk/sapi/cli/php_cli_server.c 2011-07-19 17:47:34 UTC (rev 
313441)
@@ -1479,7 +1479,7 @@
 static void php_cli_server_close_connection(php_cli_server *server, 
php_cli_server_client *client TSRMLS_DC) /* {{{ */
 {
 #ifdef DEBUG
-   php_cli_server_logf(%s: Closing 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/sapi/cli/php_cli_server.c trunk/sapi/cli/php_cli_server.c

2011-07-19 Thread Moriyoshi Koizumi
moriyoshiTue, 19 Jul 2011 18:00:16 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=313442

Log:
- Buffers are local to the blocks where they belong.

Changed paths:
U   php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c
U   php/php-src/trunk/sapi/cli/php_cli_server.c

Modified: php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c
===
--- php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c  2011-07-19 
17:47:34 UTC (rev 313441)
+++ php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c  2011-07-19 
18:00:16 UTC (rev 313442)
@@ -2048,6 +2048,7 @@
extern const opt_struct OPTIONS[];
const char *document_root = NULL;
const char *router = NULL;
+   char document_root_buf[MAXPATHLEN];

while ((c = php_getopt(argc, argv, OPTIONS, php_optarg, php_optind, 
0, 2))!=-1) {
switch (c) {
@@ -2062,7 +2063,6 @@

if (document_root) {
struct stat sb;
-   char resolved_path[MAXPATHLEN];

if (stat(document_root, sb)) {
fprintf(stderr, Directory %s does not exist.\n, 
document_root);
@@ -2072,19 +2072,18 @@
fprintf(stderr, %s is not a directory.\n, 
document_root);
return 1;
}
-   if (VCWD_REALPATH(document_root, resolved_path)) {
-   document_root = resolved_path;
+   if (VCWD_REALPATH(document_root, document_root_buf)) {
+   document_root = document_root_buf;
}
} else {
-   char path[MAXPATHLEN];
char *ret = NULL;

 #if HAVE_GETCWD
-   ret = VCWD_GETCWD(path, MAXPATHLEN);
+   ret = VCWD_GETCWD(document_root_buf, MAXPATHLEN);
 #elif HAVE_GETWD
-   ret = VCWD_GETWD(path);
+   ret = VCWD_GETWD(document_root_buf);
 #endif
-   document_root = ret ? path : .;
+   document_root = ret ? document_root_buf: .;
}

if (argc  php_optind) {

Modified: php/php-src/trunk/sapi/cli/php_cli_server.c
===
--- php/php-src/trunk/sapi/cli/php_cli_server.c 2011-07-19 17:47:34 UTC (rev 
313441)
+++ php/php-src/trunk/sapi/cli/php_cli_server.c 2011-07-19 18:00:16 UTC (rev 
313442)
@@ -2048,6 +2048,7 @@
extern const opt_struct OPTIONS[];
const char *document_root = NULL;
const char *router = NULL;
+   char document_root_buf[MAXPATHLEN];

while ((c = php_getopt(argc, argv, OPTIONS, php_optarg, php_optind, 
0, 2))!=-1) {
switch (c) {
@@ -2062,7 +2063,6 @@

if (document_root) {
struct stat sb;
-   char resolved_path[MAXPATHLEN];

if (stat(document_root, sb)) {
fprintf(stderr, Directory %s does not exist.\n, 
document_root);
@@ -2072,19 +2072,18 @@
fprintf(stderr, %s is not a directory.\n, 
document_root);
return 1;
}
-   if (VCWD_REALPATH(document_root, resolved_path)) {
-   document_root = resolved_path;
+   if (VCWD_REALPATH(document_root, document_root_buf)) {
+   document_root = document_root_buf;
}
} else {
-   char path[MAXPATHLEN];
char *ret = NULL;

 #if HAVE_GETCWD
-   ret = VCWD_GETCWD(path, MAXPATHLEN);
+   ret = VCWD_GETCWD(document_root_buf, MAXPATHLEN);
 #elif HAVE_GETWD
-   ret = VCWD_GETWD(path);
+   ret = VCWD_GETWD(document_root_buf);
 #endif
-   document_root = ret ? path : .;
+   document_root = ret ? document_root_buf: .;
}

if (argc  php_optind) {

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/sapi/cli/php_cli_server.c trunk/sapi/cli/php_cli_server.c

2011-07-19 Thread Moriyoshi Koizumi
moriyoshiTue, 19 Jul 2011 18:17:25 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=313444

Log:
- Fixed bug #55107 (Null bytes in URL cause insecure behavior (code execution / 
code disclosure)).

Bug: https://bugs.php.net/55107 (Verified) Null bytes in URL cause insecure 
behavior (code execution / code disclosure)
  
Changed paths:
U   php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c
U   php/php-src/trunk/sapi/cli/php_cli_server.c

Modified: php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c
===
--- php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c  2011-07-19 
18:08:09 UTC (rev 313443)
+++ php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c  2011-07-19 
18:17:25 UTC (rev 313444)
@@ -242,6 +242,7 @@
 };

 static php_cli_server_http_reponse_status_code_pair template_map[] = {
+   { 400, h1 class=\h\%s/h1pYour browser sent a request that this 
server could not understand./p },
{ 404, h1 class=\h\%s/h1pThe requested resource %s was not 
found on this server./p },
{ 500, h1 class=\h\%s/h1pThe server is temporality 
unavaiable./p }
 };
@@ -1600,6 +1601,11 @@
destroy_request_info(SG(request_info));
return FAILURE;
}
+   if (strlen(client-request.path_translated) != 
client-request.path_translated_len) {
+   /* can't handle paths that contain nul bytes */
+   destroy_request_info(SG(request_info));
+   return php_cli_server_send_error_page(server, client, 400 
TSRMLS_CC);
+   }
{
zend_file_handle zfd;
zfd.type = ZEND_HANDLE_FILENAME;
@@ -1625,6 +1631,11 @@
int fd;
int status = 200;

+   if (client-request.path_translated  
strlen(client-request.path_translated) != client-request.path_translated_len) 
{
+   /* can't handle paths that contain nul bytes */
+   return php_cli_server_send_error_page(server, client, 400 
TSRMLS_CC);
+   }
+
fd = client-request.path_translated ? 
open(client-request.path_translated, O_RDONLY): -1;
if (fd  0) {
char *errstr = get_last_error();

Modified: php/php-src/trunk/sapi/cli/php_cli_server.c
===
--- php/php-src/trunk/sapi/cli/php_cli_server.c 2011-07-19 18:08:09 UTC (rev 
313443)
+++ php/php-src/trunk/sapi/cli/php_cli_server.c 2011-07-19 18:17:25 UTC (rev 
313444)
@@ -242,6 +242,7 @@
 };

 static php_cli_server_http_reponse_status_code_pair template_map[] = {
+   { 400, h1 class=\h\%s/h1pYour browser sent a request that this 
server could not understand./p },
{ 404, h1 class=\h\%s/h1pThe requested resource %s was not 
found on this server./p },
{ 500, h1 class=\h\%s/h1pThe server is temporality 
unavaiable./p }
 };
@@ -1600,6 +1601,11 @@
destroy_request_info(SG(request_info));
return FAILURE;
}
+   if (strlen(client-request.path_translated) != 
client-request.path_translated_len) {
+   /* can't handle paths that contain nul bytes */
+   destroy_request_info(SG(request_info));
+   return php_cli_server_send_error_page(server, client, 400 
TSRMLS_CC);
+   }
{
zend_file_handle zfd;
zfd.type = ZEND_HANDLE_FILENAME;
@@ -1625,6 +1631,11 @@
int fd;
int status = 200;

+   if (client-request.path_translated  
strlen(client-request.path_translated) != client-request.path_translated_len) 
{
+   /* can't handle paths that contain nul bytes */
+   return php_cli_server_send_error_page(server, client, 400 
TSRMLS_CC);
+   }
+
fd = client-request.path_translated ? 
open(client-request.path_translated, O_RDONLY): -1;
if (fd  0) {
char *errstr = get_last_error();

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/sapi/cli/php_cli_server.c trunk/sapi/cli/php_cli_server.c

2011-07-19 Thread Moriyoshi Koizumi
moriyoshiWed, 20 Jul 2011 04:34:01 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=313464

Log:
- Fixed bug #55073 (PHP-CLI-webserver does not listen on ipv6 interfaces), 
letting getaddrinfo(3) validate IPv6 addresses.

Bug: https://bugs.php.net/55073 (Assigned) PHP-CLI-webserver does not listen on 
ipv6 interfaces
  
Changed paths:
U   php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c
U   php/php-src/trunk/sapi/cli/php_cli_server.c

Modified: php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c
===
--- php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c  2011-07-20 
03:11:53 UTC (rev 313463)
+++ php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c  2011-07-20 
04:34:01 UTC (rev 313464)
@@ -1806,19 +1806,35 @@
int port = 3000;
php_socket_t server_sock = SOCK_ERR;

-   host = pestrdup(addr, 1);
-   if (!host || *host == ':' ) {
-   if (host) {
-   pefree(host, 1);
+   if (addr[0] == '[') {
+   char *p;
+   host = pestrdup(addr + 1, 1);
+   if (!host) {
+   return FAILURE;
}
-   fprintf(stderr, Invalid built-in web-server addr:port 
argument\n);
-   return FAILURE;
-   }
-
-   {
-   char *p = strchr(host, ':');
+   p = strchr(host, ']');
if (p) {
*p++ = '\0';
+   if (*p == ':') {
+   port = strtol(p + 1, p, 10);
+   } else if (*p != '\0') {
+   p = NULL;
+   }
+   }
+   if (!p) {
+   fprintf(stderr, Invalid IPv6 address: %s\n, host);
+   retval = FAILURE;
+   goto out;
+   }
+   } else {
+   char *p;
+   host = pestrdup(addr, 1);
+   if (!host) {
+   return FAILURE;
+   }
+   p = strrchr(host, ':');
+   if (p) {
+   *p++ = '\0';
port = strtol(p, p, 10);
}
}
@@ -2106,7 +2122,7 @@
}
sapi_module.phpinfo_as_text = 0;

-   printf(PHP Development Server is listening on %s:%d in %s ... Press 
Ctrl-C to quit.\n, server.host, server.port, document_root);
+   printf(PHP Development Server is listening on %s in %s ... Press 
Ctrl-C to quit.\n, server_bind_address, document_root);

 #if defined(HAVE_SIGNAL_H)  defined(SIGINT)
signal(SIGINT, php_cli_server_sigint_handler);

Modified: php/php-src/trunk/sapi/cli/php_cli_server.c
===
--- php/php-src/trunk/sapi/cli/php_cli_server.c 2011-07-20 03:11:53 UTC (rev 
313463)
+++ php/php-src/trunk/sapi/cli/php_cli_server.c 2011-07-20 04:34:01 UTC (rev 
313464)
@@ -1806,19 +1806,35 @@
int port = 3000;
php_socket_t server_sock = SOCK_ERR;

-   host = pestrdup(addr, 1);
-   if (!host || *host == ':' ) {
-   if (host) {
-   pefree(host, 1);
+   if (addr[0] == '[') {
+   char *p;
+   host = pestrdup(addr + 1, 1);
+   if (!host) {
+   return FAILURE;
}
-   fprintf(stderr, Invalid built-in web-server addr:port 
argument\n);
-   return FAILURE;
-   }
-
-   {
-   char *p = strchr(host, ':');
+   p = strchr(host, ']');
if (p) {
*p++ = '\0';
+   if (*p == ':') {
+   port = strtol(p + 1, p, 10);
+   } else if (*p != '\0') {
+   p = NULL;
+   }
+   }
+   if (!p) {
+   fprintf(stderr, Invalid IPv6 address: %s\n, host);
+   retval = FAILURE;
+   goto out;
+   }
+   } else {
+   char *p;
+   host = pestrdup(addr, 1);
+   if (!host) {
+   return FAILURE;
+   }
+   p = strrchr(host, ':');
+   if (p) {
+   *p++ = '\0';
port = strtol(p, p, 10);
}
}
@@ -2106,7 +2122,7 @@
}
sapi_module.phpinfo_as_text = 0;

-   printf(PHP Development Server is listening on %s:%d in %s ... Press 
Ctrl-C to quit.\n, server.host, server.port, document_root);
+   printf(PHP Development Server is listening on %s in %s ... Press 
Ctrl-C to quit.\n, server_bind_address, document_root);

 #if defined(HAVE_SIGNAL_H)  defined(SIGINT)
signal(SIGINT, 

Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/sapi/cli/config.m4 branches/PHP_5_4/sapi/cli/config.w32 branches/PHP_5_4/sapi/cli/php_cli.c branches/PHP_5_4/sapi/cli/php_cli_server.c branches/PHP_5_

2011-06-21 Thread Moriyoshi Koizumi
Thanks!

On 2011/06/21, at 8:36, Felipe Pena wrote:

 Fixed.
 
 2011/6/20 Johannes Schlüter johan...@schlueters.de
 
 Hi,
 
 On Mon, 2011-06-20 at 20:27 +, Moriyoshi Koizumi wrote:
 moriyoshiMon, 20 Jun 2011 20:27:39 +
 
 Revision: http://svn.php.net/viewvc?view=revisionrevision=312344
 
 Log:
 - Add built-in web server to CLI SAPI. See the RFC for detail.
 
 This broke the -d option. Causing this error on make:
 
 | Generating phar.phar
 | PEAR package PHP_Archive not installed: generated phar will require
 | PHP's phar extension be enabled.
 | Creating phar files is disabled by ini setting 'phar.readonly'.
 | make: *** [ext/phar/phar.phar] Error 1
 
 which can be reduced to this simple test case:
 
 $ sapi/cli/php -n -d phar.readonly=0 -r 'echo ini_get(phar.readonly);'
 1
 
 I see that php_cli.c now handles parsing -d options before calling
 sapi_startup() whic seems to cause this.
 
 
 johannes
 
 
 
 --
 PHP CVS Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 
 -- 
 Regards,
 Felipe Pena


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



[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/sapi/cli/config.m4 branches/PHP_5_4/sapi/cli/config.w32 branches/PHP_5_4/sapi/cli/php_cli.c branches/PHP_5_4/sapi/cli/php_cli_server.c branches/PHP_5_4/sa

2011-06-20 Thread Moriyoshi Koizumi
moriyoshiMon, 20 Jun 2011 20:27:39 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=312344

Log:
- Add built-in web server to CLI SAPI. See the RFC for detail.

Changed paths:
U   php/php-src/branches/PHP_5_4/sapi/cli/config.m4
U   php/php-src/branches/PHP_5_4/sapi/cli/config.w32
U   php/php-src/branches/PHP_5_4/sapi/cli/php_cli.c
A   php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c
A   php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.h
A   php/php-src/branches/PHP_5_4/sapi/cli/php_http_parser.c
A   php/php-src/branches/PHP_5_4/sapi/cli/php_http_parser.h
U   php/php-src/trunk/sapi/cli/config.m4
U   php/php-src/trunk/sapi/cli/config.w32
U   php/php-src/trunk/sapi/cli/php_cli.c
A   php/php-src/trunk/sapi/cli/php_cli_server.c
A   php/php-src/trunk/sapi/cli/php_cli_server.h
A   php/php-src/trunk/sapi/cli/php_http_parser.c
A   php/php-src/trunk/sapi/cli/php_http_parser.h

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/NEWS branches/PHP_5_4/main/network.c branches/PHP_5_4/main/php_main.h branches/PHP_5_4/main/php_network.h trunk/main/network.c trunk/main/php_main.h trunk

2011-06-20 Thread Moriyoshi Koizumi
moriyoshiMon, 20 Jun 2011 20:30:36 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=312345

Log:
- Forgot to commit these.

Changed paths:
U   php/php-src/branches/PHP_5_4/NEWS
U   php/php-src/branches/PHP_5_4/main/network.c
U   php/php-src/branches/PHP_5_4/main/php_main.h
U   php/php-src/branches/PHP_5_4/main/php_network.h
U   php/php-src/trunk/main/network.c
U   php/php-src/trunk/main/php_main.h
U   php/php-src/trunk/main/php_network.h

Modified: php/php-src/branches/PHP_5_4/NEWS
===
--- php/php-src/branches/PHP_5_4/NEWS   2011-06-20 20:27:39 UTC (rev 312344)
+++ php/php-src/branches/PHP_5_4/NEWS   2011-06-20 20:30:36 UTC (rev 312345)
@@ -112,15 +112,17 @@
 instruction without previous ZEND_FETCH_CLASS.
   . zend_stack and zend_ptr_stack allocation is delayed until actual usage.

-- Improved CLI SAPI: (Johannes)
+- Improved CLI SAPI: (Johannes, Moriyoshi)
   . Added command line option --rz name which shows information of the
-named Zend extension.
-  . Interactive readline shell improvements:
+named Zend extension. (Johannes)
+  . Interactive readline shell improvements: (Johannes)
 . Added cli.pager php.ini setting to set a pager for output.
 . Added cli.prompt php.ini setting to configure the shell prompt.
 . Added shortcut #inisetting=value to change ini settings at run-time.
 . Changed shell not to terminate on fatal errors.
 . Interactive shell works with shared readline extension. FR #53878.
+  . Added built-in web server that is intended for testing purpose.
+(Moriyoshi)

 - Improved FastCGI SAPI: (Dmitry)
   . Added apache compatible functions: apache_child_terminate(),

Modified: php/php-src/branches/PHP_5_4/main/network.c
===
--- php/php-src/branches/PHP_5_4/main/network.c 2011-06-20 20:27:39 UTC (rev 
312344)
+++ php/php-src/branches/PHP_5_4/main/network.c 2011-06-20 20:30:36 UTC (rev 
312345)
@@ -148,7 +148,7 @@

 /* {{{ php_network_freeaddresses
  */
-static void php_network_freeaddresses(struct sockaddr **sal)
+PHPAPI void php_network_freeaddresses(struct sockaddr **sal)
 {
struct sockaddr **sap;

@@ -163,7 +163,7 @@
 /* {{{ php_network_getaddresses
  * Returns number of addresses, 0 for none/error
  */
-static int php_network_getaddresses(const char *host, int socktype, struct 
sockaddr ***sal, char **error_string TSRMLS_DC)
+PHPAPI int php_network_getaddresses(const char *host, int socktype, struct 
sockaddr ***sal, char **error_string TSRMLS_DC)
 {
struct sockaddr **sap;
int n;

Modified: php/php-src/branches/PHP_5_4/main/php_main.h
===
--- php/php-src/branches/PHP_5_4/main/php_main.h2011-06-20 20:27:39 UTC 
(rev 312344)
+++ php/php-src/branches/PHP_5_4/main/php_main.h2011-06-20 20:30:36 UTC 
(rev 312345)
@@ -35,6 +35,7 @@
 PHPAPI void php_module_shutdown_for_exec(void);
 PHPAPI int php_module_shutdown_wrapper(sapi_module_struct *sapi_globals);
 PHPAPI int php_request_startup_for_hook(TSRMLS_D);
+PHPAPI void php_request_shutdown_for_hook(void *dummy);

 PHPAPI int php_register_extensions(zend_module_entry **ptr, int count 
TSRMLS_DC);


Modified: php/php-src/branches/PHP_5_4/main/php_network.h
===
--- php/php-src/branches/PHP_5_4/main/php_network.h 2011-06-20 20:27:39 UTC 
(rev 312344)
+++ php/php-src/branches/PHP_5_4/main/php_network.h 2011-06-20 20:30:36 UTC 
(rev 312345)
@@ -194,10 +194,12 @@
 /* it is safe to FD_SET too many fd's under win32; the macro will simply ignore
  * descriptors that go beyond the default FD_SETSIZE */
 # define PHP_SAFE_FD_SET(fd, set)  FD_SET(fd, set)
+# define PHP_SAFE_FD_CLR(fd, set)  FD_CLR(fd, set)
 # define PHP_SAFE_FD_ISSET(fd, set)FD_ISSET(fd, set)
 # define PHP_SAFE_MAX_FD(m, n) do { if (n + 1 = FD_SETSIZE) { 
_php_emit_fd_setsize_warning(n); }} while(0)
 #else
 # define PHP_SAFE_FD_SET(fd, set)  do { if (fd  FD_SETSIZE) FD_SET(fd, 
set); } while(0)
+# define PHP_SAFE_FD_CLR(fd, set)  do { if (fd  FD_SETSIZE) FD_CLR(fd, 
set); } while(0)
 # define PHP_SAFE_FD_ISSET(fd, set)((fd  FD_SETSIZE)  FD_ISSET(fd, set))
 # define PHP_SAFE_MAX_FD(m, n) do { if (m = FD_SETSIZE) { 
_php_emit_fd_setsize_warning(m); m = FD_SETSIZE - 1; }} while(0)
 #endif
@@ -220,6 +222,9 @@
 #endif

 BEGIN_EXTERN_C()
+PHPAPI int php_network_getaddresses(const char *host, int socktype, struct 
sockaddr ***sal, char **error_string TSRMLS_DC);
+PHPAPI void php_network_freeaddresses(struct sockaddr **sal);
+
 PHPAPI php_socket_t php_network_connect_socket_to_host(const char *host, 
unsigned short port,
int socktype, int asynchronous, struct timeval *timeout, char 
**error_string,
int *error_code, char 

[PHP-CVS] svn: /php/php-src/trunk/ ext/mbstring/mbstring.c main/rfc1867.c

2011-03-05 Thread Moriyoshi Koizumi
moriyoshiSun, 06 Mar 2011 07:06:55 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=308951

Log:
Fix ZTS build.

Changed paths:
U   php/php-src/trunk/ext/mbstring/mbstring.c
U   php/php-src/trunk/main/rfc1867.c

Modified: php/php-src/trunk/ext/mbstring/mbstring.c
===
--- php/php-src/trunk/ext/mbstring/mbstring.c   2011-03-06 07:00:30 UTC (rev 
308950)
+++ php/php-src/trunk/ext/mbstring/mbstring.c   2011-03-06 07:06:55 UTC (rev 
308951)
@@ -1132,14 +1132,14 @@
char quote = *str;

str++;
-   return php_mb_rfc1867_substring_conf(encoding, str, 
strlen(str), quote);
+   return php_mb_rfc1867_substring_conf(encoding, str, 
strlen(str), quote TSRMLS_CC);
} else {
char *strend = str;

while (*strend  !isspace(*(unsigned char *)strend)) {
++strend;
}
-   return php_mb_rfc1867_substring_conf(encoding, str, strend - 
str, 0);
+   return php_mb_rfc1867_substring_conf(encoding, str, strend - 
str, 0 TSRMLS_CC);
}
 }
 /* }}} */
@@ -1154,8 +1154,8 @@
 * the full path of the file on the user's filesystem, which means that 
unless
 * the user does basename() they get a bogus file name. Until IE's user 
base drops
 * to nill or problem is fixed this code must remain enabled for all 
systems. */
-   s = php_mb_safe_strrchr_ex(filename, '\\', filename_len, (const 
mbfl_encoding *)encoding TSRMLS_CC);
-   if ((tmp = php_mb_safe_strrchr_ex(filename, '/', filename_len, (const 
mbfl_encoding *)encoding TSRMLS_CC))  s) {
+   s = php_mb_safe_strrchr_ex(filename, '\\', filename_len, (const 
mbfl_encoding *)encoding);
+   if ((tmp = php_mb_safe_strrchr_ex(filename, '/', filename_len, (const 
mbfl_encoding *)encoding))  s) {
s = tmp;
}
if (s) {

Modified: php/php-src/trunk/main/rfc1867.c
===
--- php/php-src/trunk/main/rfc1867.c2011-03-06 07:00:30 UTC (rev 308950)
+++ php/php-src/trunk/main/rfc1867.c2011-03-06 07:06:55 UTC (rev 308951)
@@ -743,7 +743,7 @@
}

/* Initialize the buffer */
-   if (!(mbuff = multipart_buffer_new(boundary, boundary_len))) {
+   if (!(mbuff = multipart_buffer_new(boundary, boundary_len TSRMLS_CC))) {
sapi_module.sapi_error(E_WARNING, Unable to initialize the 
input buffer);
return;
}

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

[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/win32/build/ Makefile config.w32

2011-03-02 Thread Moriyoshi Koizumi
moriyoshiWed, 02 Mar 2011 18:35:10 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=308863

Log:
- Merge from trunk.

Changed paths:
U   php/php-src/branches/PHP_5_3/win32/build/Makefile
U   php/php-src/branches/PHP_5_3/win32/build/config.w32

Modified: php/php-src/branches/PHP_5_3/win32/build/Makefile
===
--- php/php-src/branches/PHP_5_3/win32/build/Makefile   2011-03-02 18:08:27 UTC 
(rev 308862)
+++ php/php-src/branches/PHP_5_3/win32/build/Makefile   2011-03-02 18:35:10 UTC 
(rev 308863)
@@ -93,7 +93,7 @@
@cd $(BUILD_DIR)
@for %D in ($(BUILD_DIRS_SUB)) do @if not exist %D @mkdir %D  NUL
@if not exist $(BUILD_DIR_DEV) @mkdir $(BUILD_DIR_DEV)  NUL
-   @cd $(PHP_SRC_DIR)
+   @cd $(PHP_SRC_DIR)


 clean-sapi:
@@ -107,7 +107,7 @@
@echo Cleaning distribution build dirs
@cd $(BUILD_DIR)
@for %D in (_x $(BUILD_DIRS_SUB)) do @if exist %D @del /F /Q %D\*.*  
NUL
-   @cd $(PHP_SRC_DIR)
+   @cd $(PHP_SRC_DIR)
-@del /F /Q $(BUILD_DIR)\*.res $(BUILD_DIR)\*.lib $(BUILD_DIR)\*.ilk 
$(BUILD_DIR)\*.pdb $(BUILD_DIR)\*.exp $(PHPDEF) 
$(BUILD_DIR)\php-$(PHP_VERSION_STRING)-Win32.zip 
$(BUILD_DIR)\pecl-$(PHP_VERSION_STRING)-Win32.zip  NUL
-rd /s /q $(BUILD_DIR)\php-$(PHP_VERSION_STRING)

@@ -119,7 +119,7 @@
@echo Cleaning standard build dirs
@cd $(BUILD_DIR)
@for %D in (_x $(BUILD_DIRS_SUB)) do @if exist %D @rd /s /q %D
-   @cd $(PHP_SRC_DIR)
+   @cd $(PHP_SRC_DIR)
-@del /f /q $(BUILD_DIR)\*.res $(BUILD_DIR)\*.lib $(BUILD_DIR)\*.ilk 
$(BUILD_DIR)\*.pdb $(BUILD_DIR)\*.exp $(PHPDEF) $(BUILD_DIR)\*.rc 
$(BUILD_DIR)\*.dbg $(BUILD_DIR)\*.bin $(BUILD_DIR)\php*.dll 
$(BUILD_DIR)\php*.exe  NUL

 test:

Modified: php/php-src/branches/PHP_5_3/win32/build/config.w32
===
--- php/php-src/branches/PHP_5_3/win32/build/config.w32 2011-03-02 18:08:27 UTC 
(rev 308862)
+++ php/php-src/branches/PHP_5_3/win32/build/config.w32 2011-03-02 18:35:10 UTC 
(rev 308863)
@@ -266,7 +266,7 @@
 var php_usual_lib_suspects = PHP_PHP_BUILD+\\lib;

 ADD_FLAG(CFLAGS, '/I ' + php_usual_include_suspects + ' ');
-ADD_FLAG(LDFLAGS, '/libpath:\\' + php_usual_lib_suspects + '\\ ');
+ADD_FLAG(LDFLAGS, '/libpath:' + php_usual_lib_suspects + ' ');

 // Poke around for some headers
 function probe_basic_headers()

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

Re: [PHP-CVS] svn: /php/php-src/trunk/win32/build/ Makefile config.w32

2011-03-02 Thread Moriyoshi Koizumi
Hi,

On Wed, Mar 2, 2011 at 5:58 PM, Pierre Joye pierre@gmail.com wrote:
 hi,

 Please merge to 5.3

Done.


 On Wed, Mar 2, 2011 at 6:22 AM, Moriyoshi Koizumi moriyo...@php.net wrote:
 moriyoshi                                Wed, 02 Mar 2011 05:22:22 +

 Modified: php/php-src/trunk/win32/build/config.w32
 ===
 --- php/php-src/trunk/win32/build/config.w32    2011-03-02 03:59:38 UTC (rev 
 308838)
 +++ php/php-src/trunk/win32/build/config.w32    2011-03-02 05:22:22 UTC (rev 
 308839)
 @@ -271,7 +271,7 @@
  var php_usual_lib_suspects = PHP_PHP_BUILD+\\lib;

  ADD_FLAG(CFLAGS, '/I ' + php_usual_include_suspects + ' ');
 -ADD_FLAG(LDFLAGS, '/libpath:\\' + php_usual_lib_suspects + '\\ ');
 +ADD_FLAG(LDFLAGS, '/libpath:' + php_usual_lib_suspects + ' ');

 Why this change?

The library path needs to be quoted just once. It appears old compiler
frontends (VC6, 7?) used to have a bug with which arguments to the
linker containing whitespaces weren't properly dealt with.

Regards,
Moriyoshi


 Cheers,
 --
 Pierre

 @pierrejoye | http://blog.thepimp.net | http://www.libgd.org

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



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



Re: [PHP-CVS] svn: /php/php-src/trunk/win32/build/ Makefile config.w32

2011-03-02 Thread Moriyoshi Koizumi
On Thu, Mar 3, 2011 at 3:42 AM, Pierre Joye pierre@gmail.com wrote:
 hi,

 On Wed, Mar 2, 2011 at 7:35 PM, Moriyoshi Koizumi m...@mozo.jp wrote:
 The library path needs to be quoted just once. It appears old compiler
 frontends (VC6, 7?) used to have a bug with which arguments to the
 linker containing whitespaces weren't properly dealt with.

 Did you test this specific change with VC6?

Not yet, but trunk only supports VC9 or later versions.  Is it really
necessary for 5.3 to support VC6?

Regards,
Moriyoshi


 Cheers
 --
 Pierre

 @pierrejoye | http://blog.thepimp.net | http://www.libgd.org


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



[PHP-CVS] svn: /php/php-src/trunk/win32/build/ Makefile config.w32

2011-03-01 Thread Moriyoshi Koizumi
moriyoshiWed, 02 Mar 2011 05:22:22 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=308839

Log:
- Enable windows build system to accept paths containing spaces.

Changed paths:
U   php/php-src/trunk/win32/build/Makefile
U   php/php-src/trunk/win32/build/config.w32

Modified: php/php-src/trunk/win32/build/Makefile
===
--- php/php-src/trunk/win32/build/Makefile  2011-03-02 03:59:38 UTC (rev 
308838)
+++ php/php-src/trunk/win32/build/Makefile  2011-03-02 05:22:22 UTC (rev 
308839)
@@ -93,7 +93,7 @@
@cd $(BUILD_DIR)
@for %D in ($(BUILD_DIRS_SUB)) do @if not exist %D @mkdir %D  NUL
@if not exist $(BUILD_DIR_DEV) @mkdir $(BUILD_DIR_DEV)  NUL
-   @cd $(PHP_SRC_DIR)
+   @cd $(PHP_SRC_DIR)


 clean-sapi:
@@ -107,7 +107,7 @@
@echo Cleaning distribution build dirs
@cd $(BUILD_DIR)
@for %D in (_x $(BUILD_DIRS_SUB)) do @if exist %D @del /F /Q %D\*.*  
NUL
-   @cd $(PHP_SRC_DIR)
+   @cd $(PHP_SRC_DIR)
-@del /F /Q $(BUILD_DIR)\*.res $(BUILD_DIR)\*.lib $(BUILD_DIR)\*.ilk 
$(BUILD_DIR)\*.pdb $(BUILD_DIR)\*.exp $(PHPDEF) 
$(BUILD_DIR)\php-$(PHP_VERSION_STRING)-Win32.zip 
$(BUILD_DIR)\pecl-$(PHP_VERSION_STRING)-Win32.zip  NUL
-rd /s /q $(BUILD_DIR)\php-$(PHP_VERSION_STRING)

@@ -119,7 +119,7 @@
@echo Cleaning standard build dirs
@cd $(BUILD_DIR)
@for %D in (_x $(BUILD_DIRS_SUB)) do @if exist %D @rd /s /q %D
-   @cd $(PHP_SRC_DIR)
+   @cd $(PHP_SRC_DIR)
-@del /f /q $(BUILD_DIR)\*.res $(BUILD_DIR)\*.lib $(BUILD_DIR)\*.ilk 
$(BUILD_DIR)\*.pdb $(BUILD_DIR)\*.exp $(PHPDEF) $(BUILD_DIR)\*.rc 
$(BUILD_DIR)\*.dbg $(BUILD_DIR)\*.bin $(BUILD_DIR)\php*.dll 
$(BUILD_DIR)\php*.exe  NUL

 test:

Modified: php/php-src/trunk/win32/build/config.w32
===
--- php/php-src/trunk/win32/build/config.w322011-03-02 03:59:38 UTC (rev 
308838)
+++ php/php-src/trunk/win32/build/config.w322011-03-02 05:22:22 UTC (rev 
308839)
@@ -271,7 +271,7 @@
 var php_usual_lib_suspects = PHP_PHP_BUILD+\\lib;

 ADD_FLAG(CFLAGS, '/I ' + php_usual_include_suspects + ' ');
-ADD_FLAG(LDFLAGS, '/libpath:\\' + php_usual_lib_suspects + '\\ ');
+ADD_FLAG(LDFLAGS, '/libpath:' + php_usual_lib_suspects + ' ');

 // Poke around for some headers
 function probe_basic_headers()

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

[PHP-CVS] svn: /php/php-src/trunk/Zend/ zend_multibyte.c

2010-12-24 Thread Moriyoshi Koizumi
moriyoshiFri, 24 Dec 2010 08:42:21 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=306613

Log:
- Fix startup warnings.

Changed paths:
U   php/php-src/trunk/Zend/zend_multibyte.c

Modified: php/php-src/trunk/Zend/zend_multibyte.c
===
--- php/php-src/trunk/Zend/zend_multibyte.c 2010-12-24 08:38:27 UTC (rev 
306612)
+++ php/php-src/trunk/Zend/zend_multibyte.c 2010-12-24 08:42:21 UTC (rev 
306613)
@@ -52,7 +52,9 @@

 static int dummy_encoding_list_parser(const char *encoding_list, size_t 
encoding_list_len, const zend_encoding ***return_list, size_t *return_size, int 
persistent TSRMLS_DC)
 {
-   return FAILURE;
+   *return_list = pemalloc(0, persistent);
+   return_size = 0;
+   return SUCCESS;
 }

 static const zend_encoding *dummy_internal_encoding_getter(TSRMLS_D)

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

Re: [PHP-CVS] svn: /php/php-src/trunk/ Zend/zend.c Zend/zend_compile.c Zend/zend_globals.h Zend/zend_language_scanner.c Zend/zend_language_scanner.h Zend/zend_language_scanner.l Zend/zend_language_sca

2010-12-22 Thread Moriyoshi Koizumi
Okay, I'm gonna take a look into it.  Thanks.

Moriyoshi

On Tue, Dec 21, 2010 at 10:39 PM, Antony Dovgal t...@daylessday.org wrote:
 To reproduce, use the following configure line:
 ./configure --enable-exif

 On 12/21/2010 12:34 PM, Antony Dovgal wrote:
 ext/exif doesn't compile after this patch because of this:

 ext/exif/exif.o: In function `OnUpdateEncode':
 /local/qa/HEAD_non-ZTS/ext/exif/exif.c:169: undefined reference to 
 `zend_multibyte_check_encoding_list'
 ext/exif/exif.o: In function `OnUpdateDecode':
 /local/qa/HEAD_non-ZTS/ext/exif/exif.c:178: undefined reference to 
 `zend_multibyte_check_encoding_list'

 And if I change the code to use zend_multibyte_fetch_encoding(), the error 
 messages are back:
 ./sapi/cli/php -v
 PHP Warning:  PHP Startup: Illegal encoding ignored: 'ISO-8859-15' in 
 Unknown on line 0
 PHP Warning:  PHP Startup: Illegal encoding ignored: 'UCS-2BE' in Unknown on 
 line 0
 PHP Warning:  PHP Startup: Illegal encoding ignored: 'UCS-2LE' in Unknown on 
 line 0
 PHP Warning:  PHP Startup: Illegal encoding ignored: 'JIS' in Unknown on 
 line 0
 PHP Warning:  PHP Startup: Illegal encoding ignored: 'JIS' in Unknown on 
 line 0
 PHP 5.3.99-dev (cli) (built: Dec 21 2010 00:21:28) (DEBUG)
 Copyright (c) 1997-2010 The PHP Group
 Zend Engine v2.4.0, Copyright (c) 1998-2010 Zend Technologies

 --
 Wbr,
 Antony Dovgal
 ---
 http://pinba.org - realtime statistics for PHP


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



[PHP-CVS] svn: /php/php-src/trunk/ext/exif/ exif.c

2010-12-22 Thread Moriyoshi Koizumi
moriyoshiWed, 22 Dec 2010 10:25:33 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=306572

Log:
- Fix build.

Changed paths:
U   php/php-src/trunk/ext/exif/exif.c

Modified: php/php-src/trunk/ext/exif/exif.c
===
--- php/php-src/trunk/ext/exif/exif.c   2010-12-22 06:50:39 UTC (rev 306571)
+++ php/php-src/trunk/ext/exif/exif.c   2010-12-22 10:25:33 UTC (rev 306572)
@@ -166,18 +166,30 @@

 ZEND_INI_MH(OnUpdateEncode)
 {
-   if (new_value  strlen(new_value)  
!zend_multibyte_check_encoding_list(new_value TSRMLS_CC)) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Illegal encoding 
ignored: '%s', new_value);
-   return FAILURE;
+   if (new_value  new_value_length) {
+   const zend_encoding **return_list;
+   size_t return_size;
+   if (FAILURE == zend_multibyte_parse_encoding_list(new_value, 
new_value_length,
+   return_list, return_size, 0 TSRMLS_CC)) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Illegal 
encoding ignored: '%s', new_value);
+   return FAILURE;
+   }
+   efree(return_list);
}
return OnUpdateString(entry, new_value, new_value_length, mh_arg1, 
mh_arg2, mh_arg3, stage TSRMLS_CC);
 }

 ZEND_INI_MH(OnUpdateDecode)
 {
-   if (!zend_multibyte_check_encoding_list(new_value TSRMLS_CC)) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Illegal encoding 
ignored: '%s', new_value);
-   return FAILURE;
+   if (new_value) {
+   const zend_encoding **return_list;
+   size_t return_size;
+   if (FAILURE == zend_multibyte_parse_encoding_list(new_value, 
new_value_length,
+   return_list, return_size, 0 TSRMLS_CC)) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Illegal 
encoding ignored: '%s', new_value);
+   return FAILURE;
+   }
+   efree(return_list);
}
return OnUpdateString(entry, new_value, new_value_length, mh_arg1, 
mh_arg2, mh_arg3, stage TSRMLS_CC);
 }

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

[PHP-CVS] svn: /php/php-src/trunk/ php.ini-development php.ini-production

2010-12-20 Thread Moriyoshi Koizumi
moriyoshiTue, 21 Dec 2010 06:57:46 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=306535

Log:
- Update ini descriptions.  It is still possible that zend.multibyte will be 
removed in the near future as it is confirmed to not impose any significant 
overhead with the standard configuration even when it is enabled.

Changed paths:
U   php/php-src/trunk/php.ini-development
U   php/php-src/trunk/php.ini-production

Modified: php/php-src/trunk/php.ini-development
===
--- php/php-src/trunk/php.ini-development   2010-12-21 05:49:13 UTC (rev 
306534)
+++ php/php-src/trunk/php.ini-development   2010-12-21 06:57:46 UTC (rev 
306535)
@@ -352,6 +352,18 @@
 ; http://php.net/realpath-cache-ttl
 ;realpath_cache_ttl = 120

+; If enabled, scripts may be written in encodings that are incompatible with
+; the scanner.  CP936, Big5, CP949 and Shift_JIS are the examples of such
+; encodings.  To use this feature, mbstring extension must be enabled.
+; Default: Off
+;zend.multibyte = Off
+
+; Allows to set the default encoding for the scripts.  This value will be used
+; unless declare(encoding=...) directive appears at the top of the script.
+; Only affects if zend.multibyte is set.
+; Default: 
+;zend.script_encoding =
+
 ;
 ; Miscellaneous ;
 ;
@@ -1734,10 +1746,6 @@
 ; Default: mbstring.http_output_conv_mimetype=^(text/|application/xhtml\+xml)
 ;mbstring.http_output_conv_mimetype=

-; Allows to set script encoding. Only affects if PHP is compiled with 
--enable-zend-multibyte
-; Default: 
-;mbstring.script_encoding=
-
 [gd]
 ; Tell the jpeg decode to ignore warnings and try to create
 ; a gd image. The warning will then be displayed as notices

Modified: php/php-src/trunk/php.ini-production
===
--- php/php-src/trunk/php.ini-production2010-12-21 05:49:13 UTC (rev 
306534)
+++ php/php-src/trunk/php.ini-production2010-12-21 06:57:46 UTC (rev 
306535)
@@ -352,6 +352,18 @@
 ; http://php.net/realpath-cache-ttl
 ;realpath_cache_ttl = 120

+; If enabled, scripts may be written in encodings that are incompatible with
+; the scanner.  CP936, Big5, CP949 and Shift_JIS are the examples of such
+; encodings.  To use this feature, mbstring extension must be enabled.
+; Default: Off
+;zend.multibyte = Off
+
+; Allows to set the default encoding for the scripts.  This value will be used
+; unless declare(encoding=...) directive appears at the top of the script.
+; Only affects if zend.multibyte is set.
+; Default: 
+;zend.script_encoding =
+
 ;
 ; Miscellaneous ;
 ;
@@ -1730,10 +1742,6 @@
 ; Default: mbstring.http_output_conv_mimetype=^(text/|application/xhtml\+xml)
 ;mbstring.http_output_conv_mimetype=

-; Allows to set script encoding. Only affects if PHP is compiled with 
--enable-zend-multibyte
-; Default: 
-;mbstring.script_encoding=
-
 [gd]
 ; Tell the jpeg decode to ignore warnings and try to create
 ; a gd image. The warning will then be displayed as notices

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

[PHP-CVS] svn: /php/php-src/trunk/Zend/ zend_multibyte.c

2010-12-19 Thread Moriyoshi Koizumi
moriyoshiSun, 19 Dec 2010 17:29:21 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=306460

Log:
WS

Changed paths:
U   php/php-src/trunk/Zend/zend_multibyte.c

Modified: php/php-src/trunk/Zend/zend_multibyte.c
===
--- php/php-src/trunk/Zend/zend_multibyte.c 2010-12-19 17:28:57 UTC (rev 
306459)
+++ php/php-src/trunk/Zend/zend_multibyte.c 2010-12-19 17:29:21 UTC (rev 
306460)
@@ -32,7 +32,7 @@

 static const char *dummy_encoding_name_getter(const zend_encoding *encoding)
 {
-return NULL;
+   return NULL;
 }

 static int dummy_encoding_lexer_compatibility_checker(const zend_encoding 
*encoding)
@@ -66,9 +66,9 @@
 }

 static zend_multibyte_functions multibyte_functions = {
-NULL,
+   NULL,
dummy_encoding_fetcher,
-dummy_encoding_name_getter,
+   dummy_encoding_name_getter,
dummy_encoding_lexer_compatibility_checker,
dummy_encoding_detector,
dummy_encoding_converter,
@@ -120,7 +120,7 @@

 ZEND_API const zend_multibyte_functions *zend_multibyte_get_functions(TSRMLS_D)
 {
-return multibyte_functions.provider_name ? multibyte_functions: NULL;
+   return multibyte_functions.provider_name ? multibyte_functions: NULL;
 }

 ZEND_API const zend_encoding *zend_multibyte_fetch_encoding(const char *name 
TSRMLS_DC)
@@ -216,11 +216,11 @@

 ZEND_API size_t zend_multibyte_internal_encoding_filter(unsigned char **to, 
size_t *to_length, const unsigned char *from, size_t from_length TSRMLS_DC)
 {
-const zend_encoding *internal_encoding = 
zend_multibyte_get_internal_encoding(TSRMLS_C);
+   const zend_encoding *internal_encoding = 
zend_multibyte_get_internal_encoding(TSRMLS_C);
const zend_encoding *script_encoding = LANG_SCNG(script_encoding);
-if (!internal_encoding || 
!zend_multibyte_check_lexer_compatibility(internal_encoding)) {
+   if (!internal_encoding || 
!zend_multibyte_check_lexer_compatibility(internal_encoding)) {
internal_encoding = zend_multibyte_encoding_utf8;
-}
+   }
if (!zend_multibyte_check_lexer_compatibility(script_encoding)) {
script_encoding = zend_multibyte_encoding_utf8;
}

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

[PHP-CVS] svn: /php/php-src/trunk/Zend/ zend_multibyte.c

2010-12-19 Thread Moriyoshi Koizumi
moriyoshiMon, 20 Dec 2010 03:11:41 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=306485

Log:
- Fix a bug that the script gets wrongly converted into UTF-8 when the script 
encoding is not GL-safe.

Changed paths:
U   php/php-src/trunk/Zend/zend_multibyte.c

Modified: php/php-src/trunk/Zend/zend_multibyte.c
===
--- php/php-src/trunk/Zend/zend_multibyte.c 2010-12-20 02:19:31 UTC (rev 
306484)
+++ php/php-src/trunk/Zend/zend_multibyte.c 2010-12-20 03:11:41 UTC (rev 
306485)
@@ -217,15 +217,11 @@
 ZEND_API size_t zend_multibyte_internal_encoding_filter(unsigned char **to, 
size_t *to_length, const unsigned char *from, size_t from_length TSRMLS_DC)
 {
const zend_encoding *internal_encoding = 
zend_multibyte_get_internal_encoding(TSRMLS_C);
-   const zend_encoding *script_encoding = LANG_SCNG(script_encoding);
if (!internal_encoding || 
!zend_multibyte_check_lexer_compatibility(internal_encoding)) {
internal_encoding = zend_multibyte_encoding_utf8;
}
-   if (!zend_multibyte_check_lexer_compatibility(script_encoding)) {
-   script_encoding = zend_multibyte_encoding_utf8;
-   }
return zend_multibyte_encoding_converter(to, to_length, from, 
from_length,
-script_encoding, internal_encoding TSRMLS_CC);
+LANG_SCNG(script_encoding), internal_encoding TSRMLS_CC);
 }

 /*

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

[PHP-CVS] svn: /php/php-src/trunk/Zend/ zend_language_scanner.h zend_language_scanner.l

2010-12-19 Thread Moriyoshi Koizumi
moriyoshiMon, 20 Dec 2010 03:16:09 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=306486

Log:
- Avoid allocating extra buffers. This makes parsing with zend.multibyte 
enabled as fast as with it disabled.

Changed paths:
U   php/php-src/trunk/Zend/zend_language_scanner.h
U   php/php-src/trunk/Zend/zend_language_scanner.l

Modified: php/php-src/trunk/Zend/zend_language_scanner.h
===
--- php/php-src/trunk/Zend/zend_language_scanner.h	2010-12-20 03:11:41 UTC (rev 306485)
+++ php/php-src/trunk/Zend/zend_language_scanner.h	2010-12-20 03:16:09 UTC (rev 306486)
@@ -56,9 +56,7 @@
 ZEND_API void zend_save_lexical_state(zend_lex_state *lex_state TSRMLS_DC);
 ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state TSRMLS_DC);
 ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_DC);
-ZEND_API int zend_multibyte_read_script(unsigned char *buf, size_t n TSRMLS_DC);
 ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter, zend_encoding *old_encoding TSRMLS_DC);
-ZEND_API int zend_multibyte_yyinput(zend_file_handle *file_handle, char *buf, size_t len TSRMLS_DC);
 ZEND_API int zend_multibyte_set_filter(const zend_encoding *onetime_encoding TSRMLS_DC);

 END_EXTERN_C()

Modified: php/php-src/trunk/Zend/zend_language_scanner.l
===
--- php/php-src/trunk/Zend/zend_language_scanner.l	2010-12-20 03:11:41 UTC (rev 306485)
+++ php/php-src/trunk/Zend/zend_language_scanner.l	2010-12-20 03:16:09 UTC (rev 306486)
@@ -207,10 +207,6 @@
 	CG(zend_lineno) = lex_state-lineno;
 	zend_restore_compiled_filename(lex_state-filename TSRMLS_CC);

-	if (SCNG(script_org)) {
-		efree(SCNG(script_org));
-		SCNG(script_org) = NULL;
-	}
 	if (SCNG(script_filtered)) {
 		efree(SCNG(script_filtered));
 		SCNG(script_filtered) = NULL;
@@ -462,31 +458,23 @@

 	if (size != -1) {
 		if (CG(multibyte)) {
-			if (zend_multibyte_read_script((unsigned char *)buf, size TSRMLS_CC) != 0) {
-return FAILURE;
-			}
+			SCNG(script_org) = buf;
+			SCNG(script_org_size) = n;
+			SCNG(script_filtered) = NULL;

-			SCNG(yy_in) = NULL;
-
 			zend_multibyte_set_filter(NULL TSRMLS_CC);

-			if (!SCNG(input_filter)) {
-SCNG(script_filtered) = (unsigned char*)emalloc(SCNG(script_org_size)+1);
-memcpy(SCNG(script_filtered), SCNG(script_org), SCNG(script_org_size)+1);
-SCNG(script_filtered_size) = SCNG(script_org_size);
-			} else {
-SCNG(input_filter)(SCNG(script_filtered), SCNG(script_filtered_size), SCNG(script_org), SCNG(script_org_size) TSRMLS_CC);
-if (SCNG(script_filtered) == NULL) {
+			if (SCNG(input_filter)) {
+if ((size_t)-1 == SCNG(input_filter)(SCNG(script_filtered), SCNG(script_filtered_size), SCNG(script_org), SCNG(script_org_size) TSRMLS_CC)) {
 	zend_error_noreturn(E_COMPILE_ERROR, Could not convert the script from the detected 
 			encoding \%s\ to a compatible encoding, zend_multibyte_get_encoding_name(LANG_SCNG(script_encoding)));
 }
+buf = SCNG(script_filtered);
+size = SCNG(script_filtered_size);
 			}
-			SCNG(yy_start) = SCNG(script_filtered) - offset;
-			yy_scan_buffer((char *)SCNG(script_filtered), SCNG(script_filtered_size) TSRMLS_CC);
-		} else {
-			SCNG(yy_start) = (unsigned char *)buf - offset;
-			yy_scan_buffer(buf, size TSRMLS_CC);
 		}
+		SCNG(yy_start) = (unsigned char *)buf - offset;
+		yy_scan_buffer(buf, size TSRMLS_CC);
 	} else {
 		zend_error_noreturn(E_COMPILE_ERROR, zend_stream_mmap() failed);
 	}
@@ -615,6 +603,9 @@

 ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_DC)
 {
+	char *buf;
+	size_t size;
+
 	/* enforce two trailing NULLs for flex... */
 	if (IS_INTERNED(str-value.str.val)) {
 		char *tmp = safe_emalloc(1, str-value.str.len, ZEND_MMAP_AHEAD);
@@ -626,28 +617,31 @@

 	memset(str-value.str.val + str-value.str.len, 0, ZEND_MMAP_AHEAD);

-	SCNG(yy_in)=NULL;
+	SCNG(yy_in) = NULL;
 	SCNG(yy_start) = NULL;

+	buf = str-value.str.val;
+	size = str-value.str.len;
+
 	if (CG(multibyte)) {
-		SCNG(script_org) = (unsigned char *)estrdup(str-value.str.val);
-		SCNG(script_org_size) = str-value.str.len;
+		SCNG(script_org) = buf;
+		SCNG(script_org_size) = size;
+		SCNG(script_filtered) = NULL;

 		zend_multibyte_set_filter(zend_multibyte_get_internal_encoding(TSRMLS_C) TSRMLS_CC);

-		if (!SCNG(input_filter)) {
-			SCNG(script_filtered) = (unsigned char*)emalloc(SCNG(script_org_size)+1);
-			memcpy(SCNG(script_filtered), SCNG(script_org), SCNG(script_org_size)+1);
-			SCNG(script_filtered_size) = SCNG(script_org_size);
-		} else {
-			SCNG(input_filter)(SCNG(script_filtered), SCNG(script_filtered_size), SCNG(script_org), SCNG(script_org_size) TSRMLS_CC);
+		if (SCNG(input_filter)) {
+			if ((size_t)-1 == SCNG(input_filter)(SCNG(script_filtered), SCNG(script_filtered_size), SCNG(script_org), 

Re: [PHP-CVS] svn: /php/php-src/trunk/ NEWS Zend/zend_compile.c Zend/zend_globals.h Zend/zend_multibyte.c Zend/zend_multibyte.h ext/exif/exif.c ext/mbstring/mbstring.c ext/standard/html.c main/rfc1867

2010-12-09 Thread Moriyoshi Koizumi
I was thinking that this is rather a *big* change, so we'd better roll
our patches into one and commit it altogether.  I am fine if that
works for anyone else.

Regards,
Moriyoshi

On Thu, Dec 9, 2010 at 6:11 PM, Dmitry Stogov dmi...@zend.com wrote:
 Hi Moriyoshi,

 Ops, sorry. I didn't understand your disagreement, and I didn't see any
 other objections. So I committed the patch as it was planned. Could you
 prepare a patch on top of this one?

 I'm also going to look into your recommendation of moving
 mbstring.script_encoding into zend.script_encoding instead of
 zend.multibyte.

 Thanks. Dmitry.

 On 12/09/2010 09:02 AM, Moriyoshi Koizumi wrote:

 Please revert.

 On Thu, Dec 9, 2010 at 3:00 PM, Moriyoshi Koizumim...@mozo.jp  wrote:

 Hey, I don't think there was agreement on this yet.  I've actually
 been preparing a patch that minimizes the extra hook points in SAPI.

 Moriyoshi

 On Wed, Dec 8, 2010 at 8:27 PM, Dmitry Stogovdmi...@php.net  wrote:

 dmitry                                   Wed, 08 Dec 2010 11:27:34 +

 Revision: http://svn.php.net/viewvc?view=revisionrevision=306077

 Log:
 Removed compile time dependency from ext/mbstring

 Changed paths:
    U   php/php-src/trunk/NEWS
    U   php/php-src/trunk/Zend/zend_compile.c
    U   php/php-src/trunk/Zend/zend_globals.h
    U   php/php-src/trunk/Zend/zend_multibyte.c
    U   php/php-src/trunk/Zend/zend_multibyte.h
    U   php/php-src/trunk/ext/exif/exif.c
    U   php/php-src/trunk/ext/mbstring/mbstring.c
    U   php/php-src/trunk/ext/standard/html.c
    U   php/php-src/trunk/main/rfc1867.c
    U   php/php-src/trunk/main/rfc1867.h
    A   php/php-src/trunk/tests/basic/028.phpt
    A   php/php-src/trunk/tests/basic/029.phpt


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





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



Re: [PHP-CVS] svn: /php/php-src/trunk/ NEWS Zend/zend_compile.c Zend/zend_globals.h Zend/zend_multibyte.c Zend/zend_multibyte.h ext/exif/exif.c ext/mbstring/mbstring.c ext/standard/html.c main/rfc1867

2010-12-08 Thread Moriyoshi Koizumi
Hey, I don't think there was agreement on this yet.  I've actually
been preparing a patch that minimizes the extra hook points in SAPI.

Moriyoshi

On Wed, Dec 8, 2010 at 8:27 PM, Dmitry Stogov dmi...@php.net wrote:
 dmitry                                   Wed, 08 Dec 2010 11:27:34 +

 Revision: http://svn.php.net/viewvc?view=revisionrevision=306077

 Log:
 Removed compile time dependency from ext/mbstring

 Changed paths:
    U   php/php-src/trunk/NEWS
    U   php/php-src/trunk/Zend/zend_compile.c
    U   php/php-src/trunk/Zend/zend_globals.h
    U   php/php-src/trunk/Zend/zend_multibyte.c
    U   php/php-src/trunk/Zend/zend_multibyte.h
    U   php/php-src/trunk/ext/exif/exif.c
    U   php/php-src/trunk/ext/mbstring/mbstring.c
    U   php/php-src/trunk/ext/standard/html.c
    U   php/php-src/trunk/main/rfc1867.c
    U   php/php-src/trunk/main/rfc1867.h
    A   php/php-src/trunk/tests/basic/028.phpt
    A   php/php-src/trunk/tests/basic/029.phpt


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


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



Re: [PHP-CVS] svn: /php/php-src/trunk/ NEWS Zend/zend_compile.c Zend/zend_globals.h Zend/zend_multibyte.c Zend/zend_multibyte.h ext/exif/exif.c ext/mbstring/mbstring.c ext/standard/html.c main/rfc1867

2010-12-08 Thread Moriyoshi Koizumi
Please revert.

On Thu, Dec 9, 2010 at 3:00 PM, Moriyoshi Koizumi m...@mozo.jp wrote:
 Hey, I don't think there was agreement on this yet.  I've actually
 been preparing a patch that minimizes the extra hook points in SAPI.

 Moriyoshi

 On Wed, Dec 8, 2010 at 8:27 PM, Dmitry Stogov dmi...@php.net wrote:
 dmitry                                   Wed, 08 Dec 2010 11:27:34 +

 Revision: http://svn.php.net/viewvc?view=revisionrevision=306077

 Log:
 Removed compile time dependency from ext/mbstring

 Changed paths:
    U   php/php-src/trunk/NEWS
    U   php/php-src/trunk/Zend/zend_compile.c
    U   php/php-src/trunk/Zend/zend_globals.h
    U   php/php-src/trunk/Zend/zend_multibyte.c
    U   php/php-src/trunk/Zend/zend_multibyte.h
    U   php/php-src/trunk/ext/exif/exif.c
    U   php/php-src/trunk/ext/mbstring/mbstring.c
    U   php/php-src/trunk/ext/standard/html.c
    U   php/php-src/trunk/main/rfc1867.c
    U   php/php-src/trunk/main/rfc1867.h
    A   php/php-src/trunk/tests/basic/028.phpt
    A   php/php-src/trunk/tests/basic/029.phpt


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



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



[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/ext/mbstring/tests/mb_strcut_missing_boundary_check.phpt branches/PHP_5_3/NEWS branches/PHP_5_3/ext/mbstring/libmbfl/mbfl/mbfilter.c branches/PHP_5_3/ext/

2010-11-08 Thread Moriyoshi Koizumi
moriyoshiTue, 09 Nov 2010 03:23:04 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=305214

Log:
- Fix bug #53273 (mb_strcut() returns garbage with the excessive length 
parameter).

Bug: http://bugs.php.net/53273 (Open) mb_strcut() returns garbage with the 
excessive length parameter
  
Changed paths:
A   
php/php-src/branches/PHP_5_2/ext/mbstring/tests/mb_strcut_missing_boundary_check.phpt
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/mbfl/mbfilter.c
A   
php/php-src/branches/PHP_5_3/ext/mbstring/tests/mb_strcut_missing_boundary_check.phpt
U   php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfilter.c
A   
php/php-src/trunk/ext/mbstring/tests/mb_strcut_missing_boundary_check.phpt

Added: 
php/php-src/branches/PHP_5_2/ext/mbstring/tests/mb_strcut_missing_boundary_check.phpt
===
--- 
php/php-src/branches/PHP_5_2/ext/mbstring/tests/mb_strcut_missing_boundary_check.phpt
   (rev 0)
+++ 
php/php-src/branches/PHP_5_2/ext/mbstring/tests/mb_strcut_missing_boundary_check.phpt
   2010-11-09 03:23:04 UTC (rev 305214)
@@ -0,0 +1,62 @@
+--TEST--
+mb_strcut() missing boundary check.
+--SKIPIF--
+?php
+extension_loaded('mbstring') or die('skip');
+function_exists('mb_convert_encoding') or die(skip mb_convert_encoding() is 
not available in this build);
+?
+--FILE--
+?php
+mb_internal_encoding(UCS-4LE);
+var_dump(bin2hex(mb_strcut(\x61\x00\x00\x00\x62\x00\x00\x00\x63\x00\x00\x00, 
0, 32)));
+mb_internal_encoding(UCS-4BE);
+var_dump(bin2hex(mb_strcut(\x00\x00\x00\x61\x00\x00\x00\x62\x00\x00\x00\x63, 
0, 32)));
+mb_internal_encoding(UCS-2LE);
+var_dump(bin2hex(mb_strcut(\x61\x00\x62\x00\x63\x00, 0, 32)));
+mb_internal_encoding(UCS-2BE);
+var_dump(bin2hex(mb_strcut(\x00\x61\x00\x62\x00\x63, 0, 32)));
+mb_internal_encoding(UTF-16);
+var_dump(bin2hex(mb_strcut(\x00\x61\x00\x62\x00\x63, 0, 32)));
+mb_internal_encoding(UTF-8);
+var_dump(bin2hex(mb_strcut(abc, 0, 32)));
+mb_internal_encoding(ISO-8859-1);
+var_dump(bin2hex(mb_strcut(abc, 0, 32)));
+--EXPECT--
+string(24) 610062006300
+string(24) 006100620063
+string(12) 610062006300
+string(12) 006100620063
+string(12) 006100620063
+string(6) 616263
+string(6) 616263
+--TEST--
+mb_strcut() missing boundary check.
+--SKIPIF--
+?php
+extension_loaded('mbstring') or die('skip');
+function_exists('mb_convert_encoding') or die(skip mb_convert_encoding() is 
not available in this build);
+?
+--FILE--
+?php
+mb_internal_encoding(UCS-4LE);
+var_dump(bin2hex(mb_strcut(\x61\x00\x00\x00\x62\x00\x00\x00\x63\x00\x00\x00, 
0, 32)));
+mb_internal_encoding(UCS-4BE);
+var_dump(bin2hex(mb_strcut(\x00\x00\x00\x61\x00\x00\x00\x62\x00\x00\x00\x63, 
0, 32)));
+mb_internal_encoding(UCS-2LE);
+var_dump(bin2hex(mb_strcut(\x61\x00\x62\x00\x63\x00, 0, 32)));
+mb_internal_encoding(UCS-2BE);
+var_dump(bin2hex(mb_strcut(\x00\x61\x00\x62\x00\x63, 0, 32)));
+mb_internal_encoding(UTF-16);
+var_dump(bin2hex(mb_strcut(\x00\x61\x00\x62\x00\x63, 0, 32)));
+mb_internal_encoding(UTF-8);
+var_dump(bin2hex(mb_strcut(abc, 0, 32)));
+mb_internal_encoding(ISO-8859-1);
+var_dump(bin2hex(mb_strcut(abc, 0, 32)));
+--EXPECT--
+string(24) 610062006300
+string(24) 006100620063
+string(12) 610062006300
+string(12) 006100620063
+string(12) 006100620063
+string(6) 616263
+string(6) 616263

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2010-11-09 00:56:00 UTC (rev 305213)
+++ php/php-src/branches/PHP_5_3/NEWS   2010-11-09 03:23:04 UTC (rev 305214)
@@ -55,6 +55,7 @@
 - Fixed the filter extension accepting IPv4 octets with a leading 0 as that
   belongs to the unsupported dotted octal representation. (Gustavo)

+- Fixed bug #53273 (mb_strcut() returns garbage with the excessive length 
parameter). (CVE-2010-4156) (Mateusz Kocielski, Pierre, Moriyoshi)
 - Fixed bug #53248 (rawurlencode RFC 3986 EBCDIC support misses tilde char).
   (Justin Martin)
 - Fixed bug #53241 (stream casting that relies on fdopen/fopencookie fails

Modified: php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/mbfl/mbfilter.c
===
--- php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/mbfl/mbfilter.c   
2010-11-09 00:56:00 UTC (rev 305213)
+++ php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/mbfl/mbfilter.c   
2010-11-09 03:23:04 UTC (rev 305214)
@@ -1397,6 +1397,10 @@
start = string-val + from;
end   = start + (length  -4);
} else if ((encoding-flag  MBFL_ENCTYPE_SBCS)) {
+   if (from + length = string-len) {
+   length = string-len - from;
+   }
+
start = string-val + from;

[PHP-CVS] svn: /php/php-src/branches/PHP_5_2/ext/mbstring/tests/ mb_strcut_missing_boundary_check.phpt

2010-11-08 Thread Moriyoshi Koizumi
moriyoshiTue, 09 Nov 2010 03:27:11 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=305215

Log:
- Remove duplicate portion.

Changed paths:
U   
php/php-src/branches/PHP_5_2/ext/mbstring/tests/mb_strcut_missing_boundary_check.phpt

Modified: 
php/php-src/branches/PHP_5_2/ext/mbstring/tests/mb_strcut_missing_boundary_check.phpt
===
--- 
php/php-src/branches/PHP_5_2/ext/mbstring/tests/mb_strcut_missing_boundary_check.phpt
   2010-11-09 03:23:04 UTC (rev 305214)
+++ 
php/php-src/branches/PHP_5_2/ext/mbstring/tests/mb_strcut_missing_boundary_check.phpt
   2010-11-09 03:27:11 UTC (rev 305215)
@@ -29,34 +29,3 @@
 string(12) 006100620063
 string(6) 616263
 string(6) 616263
---TEST--
-mb_strcut() missing boundary check.
---SKIPIF--
-?php
-extension_loaded('mbstring') or die('skip');
-function_exists('mb_convert_encoding') or die(skip mb_convert_encoding() is 
not available in this build);
-?
---FILE--
-?php
-mb_internal_encoding(UCS-4LE);
-var_dump(bin2hex(mb_strcut(\x61\x00\x00\x00\x62\x00\x00\x00\x63\x00\x00\x00, 
0, 32)));
-mb_internal_encoding(UCS-4BE);
-var_dump(bin2hex(mb_strcut(\x00\x00\x00\x61\x00\x00\x00\x62\x00\x00\x00\x63, 
0, 32)));
-mb_internal_encoding(UCS-2LE);
-var_dump(bin2hex(mb_strcut(\x61\x00\x62\x00\x63\x00, 0, 32)));
-mb_internal_encoding(UCS-2BE);
-var_dump(bin2hex(mb_strcut(\x00\x61\x00\x62\x00\x63, 0, 32)));
-mb_internal_encoding(UTF-16);
-var_dump(bin2hex(mb_strcut(\x00\x61\x00\x62\x00\x63, 0, 32)));
-mb_internal_encoding(UTF-8);
-var_dump(bin2hex(mb_strcut(abc, 0, 32)));
-mb_internal_encoding(ISO-8859-1);
-var_dump(bin2hex(mb_strcut(abc, 0, 32)));
---EXPECT--
-string(24) 610062006300
-string(24) 006100620063
-string(12) 610062006300
-string(12) 006100620063
-string(12) 006100620063
-string(6) 616263
-string(6) 616263

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/ext/mbstring/config.w32 branches/PHP_5_2/ext/mbstring/libmbfl/config.h.vc6 branches/PHP_5_2/ext/mbstring/libmbfl/config.h.w32 branches/PHP_5_3/ext/mbstrin

2010-03-15 Thread Moriyoshi Koizumi
moriyoshiMon, 15 Mar 2010 14:19:51 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=296242

Log:
- Fix win32 build. (notified by Rob. Thanks)

Changed paths:
U   php/php-src/branches/PHP_5_2/ext/mbstring/config.w32
D   php/php-src/branches/PHP_5_2/ext/mbstring/libmbfl/config.h.vc6
A   php/php-src/branches/PHP_5_2/ext/mbstring/libmbfl/config.h.w32
A   php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/config.h.w32
U   php/php-src/trunk/ext/mbstring/config.w32
A   php/php-src/trunk/ext/mbstring/libmbfl/config.h.w32

Modified: php/php-src/branches/PHP_5_2/ext/mbstring/config.w32
===
--- php/php-src/branches/PHP_5_2/ext/mbstring/config.w322010-03-15 
13:56:12 UTC (rev 296241)
+++ php/php-src/branches/PHP_5_2/ext/mbstring/config.w322010-03-15 
14:19:51 UTC (rev 296242)
@@ -7,7 +7,7 @@

 if (PHP_MBSTRING == yes) {

-   FSO.CopyFile(ext\\mbstring\\libmbfl\\config.h.vc6,
+   FSO.CopyFile(ext\\mbstring\\libmbfl\\config.h.w32,
ext\\mbstring\\libmbfl\\config.h, true);
FSO.CopyFile(ext\\mbstring\\oniguruma\\win32\\config.h,
ext\\mbstring\\oniguruma\\config.h, true);

Deleted: php/php-src/branches/PHP_5_2/ext/mbstring/libmbfl/config.h.vc6
===
--- php/php-src/branches/PHP_5_2/ext/mbstring/libmbfl/config.h.vc6  
2010-03-15 13:56:12 UTC (rev 296241)
+++ php/php-src/branches/PHP_5_2/ext/mbstring/libmbfl/config.h.vc6  
2010-03-15 14:19:51 UTC (rev 296242)
@@ -1,12 +0,0 @@
-#define HAVE_STDIO_H 1
-#define HAVE_STDLIB_H 1
-#define HAVE_STDDEF_H 1
-#define HAVE_ASSERT_H 1
-#define HAVE_MEMORY_H 1
-/* #undef HAVE_STRINGS_H */
-#define HAVE_STRING_H 1
-/* #undef HAVE_STRCASECMP */
-#define HAVE_STRICMP 1
-#define HAVE_WIN32_NATIVE_THREAD 1
-#define USE_WIN32_NATIVE_THREAD 1
-#define ENABLE_THREADS 1

Added: php/php-src/branches/PHP_5_2/ext/mbstring/libmbfl/config.h.w32
===
--- php/php-src/branches/PHP_5_2/ext/mbstring/libmbfl/config.h.w32  
(rev 0)
+++ php/php-src/branches/PHP_5_2/ext/mbstring/libmbfl/config.h.w32  
2010-03-15 14:19:51 UTC (rev 296242)
@@ -0,0 +1,12 @@
+#define HAVE_STDIO_H 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STDDEF_H 1
+#define HAVE_ASSERT_H 1
+#define HAVE_MEMORY_H 1
+/* #undef HAVE_STRINGS_H */
+#define HAVE_STRING_H 1
+/* #undef HAVE_STRCASECMP */
+#define HAVE_STRICMP 1
+#define HAVE_WIN32_NATIVE_THREAD 1
+#define USE_WIN32_NATIVE_THREAD 1
+#define ENABLE_THREADS 1

Added: php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/config.h.w32
===
--- php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/config.h.w32  
(rev 0)
+++ php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/config.h.w32  
2010-03-15 14:19:51 UTC (rev 296242)
@@ -0,0 +1,12 @@
+#define HAVE_STDIO_H 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STDDEF_H 1
+#define HAVE_ASSERT_H 1
+#define HAVE_MEMORY_H 1
+/* #undef HAVE_STRINGS_H */
+#define HAVE_STRING_H 1
+/* #undef HAVE_STRCASECMP */
+#define HAVE_STRICMP 1
+#define HAVE_WIN32_NATIVE_THREAD 1
+#define USE_WIN32_NATIVE_THREAD 1
+#define ENABLE_THREADS 1

Modified: php/php-src/trunk/ext/mbstring/config.w32
===
--- php/php-src/trunk/ext/mbstring/config.w32   2010-03-15 13:56:12 UTC (rev 
296241)
+++ php/php-src/trunk/ext/mbstring/config.w32   2010-03-15 14:19:51 UTC (rev 
296242)
@@ -7,7 +7,7 @@

 if (PHP_MBSTRING != no) {

-   FSO.CopyFile(ext\\mbstring\\libmbfl\\config.h.vc6,
+   FSO.CopyFile(ext\\mbstring\\libmbfl\\config.h.w32,
ext\\mbstring\\libmbfl\\config.h, true);
FSO.CopyFile(ext\\mbstring\\oniguruma\\win32\\config.h,
ext\\mbstring\\oniguruma\\config.h, true);

Added: php/php-src/trunk/ext/mbstring/libmbfl/config.h.w32
===
--- php/php-src/trunk/ext/mbstring/libmbfl/config.h.w32 
(rev 0)
+++ php/php-src/trunk/ext/mbstring/libmbfl/config.h.w32 2010-03-15 14:19:51 UTC 
(rev 296242)
@@ -0,0 +1,12 @@
+#define HAVE_STDIO_H 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STDDEF_H 1
+#define HAVE_ASSERT_H 1
+#define HAVE_MEMORY_H 1
+/* #undef HAVE_STRINGS_H */
+#define HAVE_STRING_H 1
+/* #undef HAVE_STRCASECMP */
+#define HAVE_STRICMP 1
+#define HAVE_WIN32_NATIVE_THREAD 1
+#define USE_WIN32_NATIVE_THREAD 1
+#define ENABLE_THREADS 1

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

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

2010-03-12 Thread Moriyoshi Koizumi
moriyoshiFri, 12 Mar 2010 14:44:35 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=296118

Log:
- Oops.

Changed paths:
U   php/php-src/trunk/ext/standard/html.c

Modified: php/php-src/trunk/ext/standard/html.c
===
--- php/php-src/trunk/ext/standard/html.c   2010-03-12 13:46:52 UTC (rev 
296117)
+++ php/php-src/trunk/ext/standard/html.c   2010-03-12 14:44:35 UTC (rev 
296118)
@@ -747,8 +747,8 @@
return cs_eucjp;

case mbfl_no_encoding_sjis:
-   case mbfl_no_encoding_sjis_win:
-   case mbfl_no_encoding_sjis_mac:
+   case mbfl_no_encoding_sjis_open:
+   case mbfl_no_encoding_cp932:
return cs_sjis;

case mbfl_no_encoding_cp1252:

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

Re: [PHP-CVS] svn: /php/php-src/trunk/ext/standard/ html.c

2010-03-12 Thread Moriyoshi Koizumi
I forgot to apply the patch to trunk at that time. So 5_3 should have
been working. Doesn't it?

Moriyoshi

On Fri, Mar 12, 2010 at 11:53 PM, Felipe Pena felipe...@gmail.com wrote:
 and 5_3? Thanks.

 2010/3/12 Moriyoshi Koizumi moriyo...@php.net

 moriyoshi                                Fri, 12 Mar 2010 14:44:35 +

 Revision: http://svn.php.net/viewvc?view=revisionrevision=296118

 Log:
 - Oops.

 Changed paths:
    U   php/php-src/trunk/ext/standard/html.c

 Modified: php/php-src/trunk/ext/standard/html.c
 ===
 --- php/php-src/trunk/ext/standard/html.c       2010-03-12 13:46:52 UTC
 (rev 296117)
 +++ php/php-src/trunk/ext/standard/html.c       2010-03-12 14:44:35 UTC
 (rev 296118)
 @@ -747,8 +747,8 @@
                        return cs_eucjp;

                case mbfl_no_encoding_sjis:
 -               case mbfl_no_encoding_sjis_win:
 -               case mbfl_no_encoding_sjis_mac:
 +               case mbfl_no_encoding_sjis_open:
 +               case mbfl_no_encoding_cp932:
                        return cs_sjis;

                case mbfl_no_encoding_cp1252:


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




 --
 Regards,
 Felipe Pena


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



[PHP-CVS] svn: /php/php-src/branches/ PHP_5_2/ext/standard/html.c PHP_5_3/ext/standard/html.c PHP_5_4/ext/standard/html.c

2010-03-12 Thread Moriyoshi Koizumi
moriyoshiFri, 12 Mar 2010 16:19:25 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=296121

Log:
- Forgot to commit this patch. Sorry.

Changed paths:
U   php/php-src/branches/PHP_5_2/ext/standard/html.c
U   php/php-src/branches/PHP_5_3/ext/standard/html.c
U   php/php-src/branches/PHP_5_4/ext/standard/html.c

Modified: php/php-src/branches/PHP_5_2/ext/standard/html.c
===
--- php/php-src/branches/PHP_5_2/ext/standard/html.c2010-03-12 15:01:14 UTC 
(rev 296120)
+++ php/php-src/branches/PHP_5_2/ext/standard/html.c2010-03-12 16:19:25 UTC 
(rev 296121)
@@ -742,8 +742,8 @@
return cs_eucjp;

case mbfl_no_encoding_sjis:
-   case mbfl_no_encoding_sjis_win:
-   case mbfl_no_encoding_sjis_mac:
+   case mbfl_no_encoding_sjis_open:
+   case mbfl_no_encoding_cp932:
return cs_sjis;

case mbfl_no_encoding_cp1252:

Modified: php/php-src/branches/PHP_5_3/ext/standard/html.c
===
--- php/php-src/branches/PHP_5_3/ext/standard/html.c2010-03-12 15:01:14 UTC 
(rev 296120)
+++ php/php-src/branches/PHP_5_3/ext/standard/html.c2010-03-12 16:19:25 UTC 
(rev 296121)
@@ -741,8 +741,8 @@
return cs_eucjp;

case mbfl_no_encoding_sjis:
-   case mbfl_no_encoding_sjis_win:
-   case mbfl_no_encoding_sjis_mac:
+   case mbfl_no_encoding_sjis_open:
+   case mbfl_no_encoding_cp932:
return cs_sjis;

case mbfl_no_encoding_cp1252:

Modified: php/php-src/branches/PHP_5_4/ext/standard/html.c
===
--- php/php-src/branches/PHP_5_4/ext/standard/html.c2010-03-12 15:01:14 UTC 
(rev 296120)
+++ php/php-src/branches/PHP_5_4/ext/standard/html.c2010-03-12 16:19:25 UTC 
(rev 296121)
@@ -741,8 +741,8 @@
return cs_eucjp;

case mbfl_no_encoding_sjis:
-   case mbfl_no_encoding_sjis_win:
-   case mbfl_no_encoding_sjis_mac:
+   case mbfl_no_encoding_sjis_open:
+   case mbfl_no_encoding_cp932:
return cs_sjis;

case mbfl_no_encoding_cp1252:

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

[PHP-CVS] svn: /php/php-src/branches/PHP_5_2/ext/standard/ html.c

2010-03-12 Thread Moriyoshi Koizumi
moriyoshiFri, 12 Mar 2010 16:23:18 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=296122

Log:
- Revert accidental commit.

Changed paths:
U   php/php-src/branches/PHP_5_2/ext/standard/html.c

Modified: php/php-src/branches/PHP_5_2/ext/standard/html.c
===
--- php/php-src/branches/PHP_5_2/ext/standard/html.c2010-03-12 16:19:25 UTC 
(rev 296121)
+++ php/php-src/branches/PHP_5_2/ext/standard/html.c2010-03-12 16:23:18 UTC 
(rev 296122)
@@ -742,8 +742,8 @@
return cs_eucjp;

case mbfl_no_encoding_sjis:
-   case mbfl_no_encoding_sjis_open:
-   case mbfl_no_encoding_cp932:
+   case mbfl_no_encoding_sjis_win:
+   case mbfl_no_encoding_sjis_mac:
return cs_sjis;

case mbfl_no_encoding_cp1252:

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mbstring/config.m4 branches/PHP_5_3/ext/mbstring/config.w32 branches/PHP_5_3/ext/mbstring/libmbfl/Makefile.am branches/PHP_5_3/ext/mbstring/libmbfl/Ma

2010-03-11 Thread Moriyoshi Koizumi
moriyoshiFri, 12 Mar 2010 04:55:37 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=296101

Log:
- Update the bundled libmbfl to the latest on upstream.

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/mbstring/config.m4
U   php/php-src/branches/PHP_5_3/ext/mbstring/config.w32
U   php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/Makefile.am
D   php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/Makefile.bcc32
D   php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/config.h.bcc32
U   php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/config.h.in
D   php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/config.h.vc6
U   php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/configure.in
U   php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/Makefile.am
D   php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/Makefile.bcc32
A   
php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_cp5022x.c
A   
php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_cp5022x.h
U   
php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_cp51932.c
U   
php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_cp932.c
U   
php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_cp932.h
U   
php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_htmlent.c
U   
php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_iso2022_jp_ms.c
U   
php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_iso2022_kr.c
U   php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_jis.c
A   
php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_sjis_open.c
A   
php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_sjis_open.h
A   
php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_tl_jisx0201_jisx0208.c
A   
php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_tl_jisx0201_jisx0208.h
U   
php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_utf7.c
A   
php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/translit_kana_jisx0201_jisx0208.h
D   php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/libmbfl.dsp
D   php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/libmbfl.dsw
D   php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/libmbfl.sln
D   php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/libmbfl.vcproj
U   php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/mbfl/Makefile.am
D   php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/mbfl/Makefile.bcc32
U   php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/mbfl/eaw_table.h
U   php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/mbfl/mbfilter.c
U   php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/mbfl/mbfilter.h
U   php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/mbfl/mbfilter_8bit.h
U   php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/mbfl/mbfilter_pass.h
U   php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/mbfl/mbfilter_wchar.h
U   php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/mbfl/mbfl_convert.c
U   php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/mbfl/mbfl_convert.h
U   php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/mbfl/mbfl_encoding.c
U   php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/mbfl/mbfl_encoding.h
U   
php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/mbfl/mbfl_filter_output.c
U   
php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/mbfl/mbfl_filter_output.h
U   php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/mbfl/mbfl_ident.c
D   php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/mbfl.def
D   php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/mbfl.rc
D   php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/mksbcc32.bat
U   php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/nls/Makefile.am
D   php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/nls/Makefile.bcc32
D   php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/rules.mak.bcc32
U   
php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/tests/conv_encoding.tests/Makefile.am
A   
php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/tests/conv_encoding.tests/gen_exp.c
A   
php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/tests/conv_encoding.tests/yensign.exp
U   php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/tests/sample.c
U   
php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/tests/strcut.tests/iso2022jp.exp
U   php/php-src/trunk/ext/mbstring/config.m4
U   php/php-src/trunk/ext/mbstring/config.w32
U   php/php-src/trunk/ext/mbstring/libmbfl/Makefile.am
D   php/php-src/trunk/ext/mbstring/libmbfl/Makefile.bcc32
D   php/php-src/trunk/ext/mbstring/libmbfl/config.h.bcc32
U   php/php-src/trunk/ext/mbstring/libmbfl/config.h.in
D   php/php-src/trunk/ext/mbstring/libmbfl/config.h.vc6
 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/NEWS branches/PHP_5_2/acinclude.m4 branches/PHP_5_2/ext/iconv/iconv.c branches/PHP_5_2/ext/iconv/php_iconv.h branches/PHP_5_3/acinclude.m4 branches/PHP_5_

2010-03-05 Thread Moriyoshi Koizumi
moriyoshiFri, 05 Mar 2010 09:12:13 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=295848

Log:
- Fixed bug #49267 (linking fails for iconv)

Bug: http://bugs.php.net/49267 (No Feedback) Linking fails for iconv: 
Undefined symbols: _libiconv
  
Changed paths:
U   php/php-src/branches/PHP_5_2/NEWS
U   php/php-src/branches/PHP_5_2/acinclude.m4
U   php/php-src/branches/PHP_5_2/ext/iconv/iconv.c
U   php/php-src/branches/PHP_5_2/ext/iconv/php_iconv.h
U   php/php-src/branches/PHP_5_3/acinclude.m4
U   php/php-src/branches/PHP_5_3/ext/iconv/iconv.c
U   php/php-src/branches/PHP_5_3/ext/iconv/php_iconv.h
U   php/php-src/trunk/acinclude.m4
U   php/php-src/trunk/ext/iconv/iconv.c
U   php/php-src/trunk/ext/iconv/php_iconv.h

Modified: php/php-src/branches/PHP_5_2/NEWS
===
--- php/php-src/branches/PHP_5_2/NEWS   2010-03-05 06:45:28 UTC (rev 295847)
+++ php/php-src/branches/PHP_5_2/NEWS   2010-03-05 09:12:13 UTC (rev 295848)
@@ -11,6 +11,7 @@
   an invalid option is provided). (Ilia)
 - Fixed bug #51086 (DBA DB4 doesn't work with Berkeley DB 4.8). (Chris Jones)
 - Fixed bug #51062 (DBA DB4 uses mismatched headers and libraries). (Chris 
Jones)
+- Fixed bug #49267 (Linking fails for iconv). (Moriyosh)
 - Fixed bug #43314 (iconv_mime_encode(), broken Q scheme). (Rasmus)
 - Fixed bug #23229 (syslog function truncates messages). (Adam)


Modified: php/php-src/branches/PHP_5_2/acinclude.m4
===
--- php/php-src/branches/PHP_5_2/acinclude.m4   2010-03-05 06:45:28 UTC (rev 
295847)
+++ php/php-src/branches/PHP_5_2/acinclude.m4   2010-03-05 09:12:13 UTC (rev 
295848)
@@ -2424,6 +2424,7 @@
   echo  ext/iconv/php_have_libiconv.h
   echo  ext/iconv/php_have_iconv.h
   echo  ext/iconv/php_php_iconv_impl.h
+  echo  ext/iconv/php_have_libiconv_in_libiconv.h
   echo  ext/iconv/php_php_iconv_h_path.h
   echo  ext/iconv/php_iconv_supports_errno.h

@@ -2471,6 +2472,8 @@
 found_iconv=yes
 PHP_DEFINE(HAVE_LIBICONV,1,[ext/iconv])
 AC_DEFINE(HAVE_LIBICONV,1,[ ])
+PHP_DEFINE([HAVE_LIBICONV_IN_LIBICONV],1,[ext/iconv])
+AC_DEFINE([HAVE_LIBICONV_IN_LIBICONV],1,[iconv() is aliased to 
libiconv() in -liconv])
   ], [
 PHP_CHECK_LIBRARY($iconv_lib_name, iconv, [
   found_iconv=yes

Modified: php/php-src/branches/PHP_5_2/ext/iconv/iconv.c
===
--- php/php-src/branches/PHP_5_2/ext/iconv/iconv.c  2010-03-05 06:45:28 UTC 
(rev 295847)
+++ php/php-src/branches/PHP_5_2/ext/iconv/iconv.c  2010-03-05 09:12:13 UTC 
(rev 295848)
@@ -193,7 +193,7 @@
 }
 /* }}} */

-#ifdef HAVE_LIBICONV
+#if defined(HAVE_LIBICONV)  defined(HAVE_LIBICONV_IN_LIBICONV)
 #define iconv libiconv
 #endif


Modified: php/php-src/branches/PHP_5_2/ext/iconv/php_iconv.h
===
--- php/php-src/branches/PHP_5_2/ext/iconv/php_iconv.h  2010-03-05 06:45:28 UTC 
(rev 295847)
+++ php/php-src/branches/PHP_5_2/ext/iconv/php_iconv.h  2010-03-05 09:12:13 UTC 
(rev 295848)
@@ -35,6 +35,7 @@
 #ifdef PHP_ATOM_INC
 #include ext/iconv/php_have_iconv.h
 #include ext/iconv/php_have_libiconv.h
+#include ext/iconv/php_have_libiconv_in_libiconv.h
 #include ext/iconv/php_have_glibc_iconv.h
 #include ext/iconv/php_have_bsd_iconv.h
 #include ext/iconv/php_iconv_supports_errno.h

Modified: php/php-src/branches/PHP_5_3/acinclude.m4
===
--- php/php-src/branches/PHP_5_3/acinclude.m4   2010-03-05 06:45:28 UTC (rev 
295847)
+++ php/php-src/branches/PHP_5_3/acinclude.m4   2010-03-05 09:12:13 UTC (rev 
295848)
@@ -2424,6 +2424,7 @@
   echo  ext/iconv/php_have_libiconv.h
   echo  ext/iconv/php_have_iconv.h
   echo  ext/iconv/php_php_iconv_impl.h
+  echo  ext/iconv/php_have_libiconv_in_libiconv.h
   echo  ext/iconv/php_php_iconv_h_path.h
   echo  ext/iconv/php_iconv_supports_errno.h

@@ -2471,6 +2472,8 @@
 found_iconv=yes
 PHP_DEFINE(HAVE_LIBICONV,1,[ext/iconv])
 AC_DEFINE(HAVE_LIBICONV,1,[ ])
+PHP_DEFINE([HAVE_LIBICONV_IN_LIBICONV],1,[ext/iconv])
+AC_DEFINE([HAVE_LIBICONV_IN_LIBICONV],1,[iconv() is aliased to 
libiconv() in -liconv])
   ], [
 PHP_CHECK_LIBRARY($iconv_lib_name, iconv, [
   found_iconv=yes

Modified: php/php-src/branches/PHP_5_3/ext/iconv/iconv.c
===
--- php/php-src/branches/PHP_5_3/ext/iconv/iconv.c  2010-03-05 06:45:28 UTC 
(rev 295847)
+++ php/php-src/branches/PHP_5_3/ext/iconv/iconv.c  2010-03-05 09:12:13 UTC 
(rev 295848)
@@ -182,7 +182,7 @@
 }
 /* }}} */

-#ifdef HAVE_LIBICONV
+#if defined(HAVE_LIBICONV)  defined(HAVE_LIBICONV_IN_LIBICONV)
 #define iconv libiconv
 #endif


Modified: 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c trunk/ext/mbstring/libmbfl/filters/

2010-02-28 Thread Moriyoshi Koizumi
moriyoshiSun, 28 Feb 2010 09:33:05 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=295576

Log:
- Merge from upstream (note: this is no behavioral change, so need not to be
  merged to 5.3.2 branch)

Changed paths:
U   
php/php-src/branches/PHP_5_2/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c
U   
php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c
U   php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c

Modified: 
php/php-src/branches/PHP_5_2/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c
===
--- 
php/php-src/branches/PHP_5_2/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c 
2010-02-28 07:49:36 UTC (rev 295575)
+++ 
php/php-src/branches/PHP_5_2/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c 
2010-02-28 09:33:05 UTC (rev 295576)
@@ -327,8 +327,10 @@
c1 = 0;
c2 = cp932ext1_ucs_table_max - cp932ext1_ucs_table_min;
while (c1  c2) {   /* CP932 vendor ext1 
(13ku) */
+   const int oh = cp932ext1_ucs_table_min / 94;
+
if (c == cp932ext1_ucs_table[c1]) {
-   s1 = ((c1/94 + 0x2d)  8) + (c1%94 + 
0x21);
+   s1 = ((c1 / 94 + oh + 0x21)  8) + (c1 
% 94 + 0x21);
break;
}
c1++;

Modified: 
php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c
===
--- 
php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c 
2010-02-28 07:49:36 UTC (rev 295575)
+++ 
php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c 
2010-02-28 09:33:05 UTC (rev 295576)
@@ -327,8 +327,10 @@
c1 = 0;
c2 = cp932ext1_ucs_table_max - cp932ext1_ucs_table_min;
while (c1  c2) {   /* CP932 vendor ext1 
(13ku) */
+   const int oh = cp932ext1_ucs_table_min / 94;
+
if (c == cp932ext1_ucs_table[c1]) {
-   s1 = ((c1/94 + 0x2d)  8) + (c1%94 + 
0x21);
+   s1 = ((c1 / 94 + oh + 0x21)  8) + (c1 
% 94 + 0x21);
break;
}
c1++;

Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c
===
--- php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c
2010-02-28 07:49:36 UTC (rev 295575)
+++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c
2010-02-28 09:33:05 UTC (rev 295576)
@@ -327,8 +327,10 @@
c1 = 0;
c2 = cp932ext1_ucs_table_max - cp932ext1_ucs_table_min;
while (c1  c2) {   /* CP932 vendor ext1 
(13ku) */
+   const int oh = cp932ext1_ucs_table_min / 94;
+
if (c == cp932ext1_ucs_table[c1]) {
-   s1 = ((c1/94 + 0x2d)  8) + (c1%94 + 
0x21);
+   s1 = ((c1 / 94 + oh + 0x21)  8) + (c1 
% 94 + 0x21);
break;
}
c1++;

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c trunk/ext/mbstring/libmbfl/filters/

2010-02-27 Thread Moriyoshi Koizumi
moriyoshiSun, 28 Feb 2010 07:49:36 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=295575

Log:
- Whitespaces.

Changed paths:
U   
php/php-src/branches/PHP_5_2/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c
U   
php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c
U   php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c

Modified: 
php/php-src/branches/PHP_5_2/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c
===
--- 
php/php-src/branches/PHP_5_2/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c 
2010-02-28 04:02:52 UTC (rev 295574)
+++ 
php/php-src/branches/PHP_5_2/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c 
2010-02-28 07:49:36 UTC (rev 295575)
@@ -153,8 +153,8 @@
w = cp932ext1_ucs_table[s - 
cp932ext1_ucs_table_min];
} else if (s = 0  s  
jisx0208_ucs_table_size) { /* X 0208 */
w = jisx0208_ucs_table[s];
-   } else if (s = (84*94)) {  /* user 
(85ku - 94ku) */
-   w = s - (84*94) + 0xe000;
+   } else if (s = (84 * 94)) {/* user 
(85ku - 94ku) */
+   w = s - (84 * 94) + 0xe000;
}
}
if (w = 0) {

Modified: 
php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c
===
--- 
php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c 
2010-02-28 04:02:52 UTC (rev 295574)
+++ 
php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c 
2010-02-28 07:49:36 UTC (rev 295575)
@@ -153,8 +153,8 @@
w = cp932ext1_ucs_table[s - 
cp932ext1_ucs_table_min];
} else if (s = 0  s  
jisx0208_ucs_table_size) { /* X 0208 */
w = jisx0208_ucs_table[s];
-   } else if (s = (84*94)) {  /* user 
(85ku - 94ku) */
-   w = s - (84*94) + 0xe000;
+   } else if (s = (84 * 94)) {/* user 
(85ku - 94ku) */
+   w = s - (84 * 94) + 0xe000;
}
}
if (w = 0) {

Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c
===
--- php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c
2010-02-28 04:02:52 UTC (rev 295574)
+++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c
2010-02-28 07:49:36 UTC (rev 295575)
@@ -153,8 +153,8 @@
w = cp932ext1_ucs_table[s - 
cp932ext1_ucs_table_min];
} else if (s = 0  s  
jisx0208_ucs_table_size) { /* X 0208 */
w = jisx0208_ucs_table[s];
-   } else if (s = (84*94)) {  /* user 
(85ku - 94ku) */
-   w = s - (84*94) + 0xe000;
+   } else if (s = (84 * 94)) {/* user 
(85ku - 94ku) */
+   w = s - (84 * 94) + 0xe000;
}
}
if (w = 0) {

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

[PHP-CVS] svn: /php/php-src/trunk/ext/standard/ html.c tests/strings/html_entity_decode_html4.phpt tests/strings/htmlentities_html4.phpt

2009-12-24 Thread Moriyoshi Koizumi
moriyoshiThu, 24 Dec 2009 09:32:52 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=292588

Log:
- MFB: Fix bug #46478 (htmlentities() uses obsolete mapping table for character
  entity references)
  (this should be gone to r292467)

Bug: http://bugs.php.net/46478 (Closed) htmlentities() uses obsolete mapping 
table for character entity references
  
Changed paths:
U   php/php-src/trunk/ext/standard/html.c
A   
php/php-src/trunk/ext/standard/tests/strings/html_entity_decode_html4.phpt
A   php/php-src/trunk/ext/standard/tests/strings/htmlentities_html4.phpt

Modified: php/php-src/trunk/ext/standard/html.c
===
--- php/php-src/trunk/ext/standard/html.c	2009-12-24 09:00:56 UTC (rev 292587)
+++ php/php-src/trunk/ext/standard/html.c	2009-12-24 09:32:52 UTC (rev 292588)
@@ -150,7 +150,7 @@
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	thetasym, upsih,
 	NULL, NULL, NULL,
-	piv
+	piv
 };

 static entity_table_t ent_uni_punct[] = {
@@ -160,7 +160,7 @@
 	NULL, NULL, NULL, ndash, mdash, NULL, NULL, NULL,
 	/* 8216 */
 	lsquo, rsquo, sbquo, NULL, ldquo, rdquo, bdquo, NULL,
-	dagger, Dagger,	bull, NULL, NULL, NULL, hellip,
+	dagger, Dagger, bull, NULL, NULL, NULL, hellip,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, permil, NULL,
 	/* 8242 */
 	prime, Prime, NULL, NULL, NULL, NULL, NULL, lsaquo, rsaquo, NULL,
@@ -200,39 +200,39 @@
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	/* 8656 (0x21d0) */
-	lArr, uArr, rArr, dArr, hArr, vArr, NULL, NULL,
-	NULL, NULL, lAarr, rAarr, NULL, rarrw, NULL, NULL,
+	lArr, uArr, rArr, dArr, hArr, NULL, NULL, NULL,
+	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	/* 8672 (0x21e0) */
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	/* 8704 (0x2200) */
-	forall, comp, part, exist, nexist, empty, NULL, nabla,
-	isin, notin, epsis, ni, notni, bepsi, NULL, prod,
+	forall, NULL, part, exist, NULL, empty, NULL, nabla,
+	isin, notin, NULL, ni, NULL, NULL, NULL, prod,
 	/* 8720 (0x2210) */
-	coprod, sum, minus, mnplus, plusdo, NULL, setmn, lowast,
-	compfn, NULL, radic, NULL, NULL, prop, infin, ang90,
+	NULL, sum, minus, NULL, NULL, NULL, NULL, lowast,
+	NULL, NULL, radic, NULL, NULL, prop, infin, NULL,
 	/* 8736 (0x2220) */
-	ang, angmsd, angsph, mid, nmid, par, npar, and,
-	or, cap, cup, int, NULL, NULL, conint, NULL,
+	ang, NULL, NULL, NULL, NULL, NULL, NULL, and,
+	or, cap, cup, int, NULL, NULL, NULL, NULL,
 	/* 8752 (0x2230) */
-	NULL, NULL, NULL, NULL, there4, becaus, NULL, NULL,
-	NULL, NULL, NULL, NULL, sim, bsim, NULL, NULL,
+	NULL, NULL, NULL, NULL, there4, NULL, NULL, NULL,
+	NULL, NULL, NULL, NULL, sim, NULL, NULL, NULL,
 	/* 8768 (0x2240) */
-	wreath, nsim, NULL, sime, nsime, cong, NULL, ncong,
-	asymp, nap, ape, NULL, bcong, asymp, bump, bumpe,
+	NULL, NULL, NULL, NULL, NULL, cong, NULL, NULL,
+	asymp, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	/* 8784 (0x2250) */
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	/* 8800 (0x2260) */
-	ne, equiv, NULL, NULL, le, ge, lE, gE,
-	lnE, gnE, Lt, Gt, twixt, NULL, nlt, ngt,
+	ne, equiv, NULL, NULL, le, ge, NULL, NULL,
+	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	/* 8816 (0x2270) */
-	nles, nges, lsim, gsim, NULL, NULL, lg, gl,
-	NULL, NULL, pr, sc, cupre, sscue, prsim, scsim,
+	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	/* 8832 (0x2280) */
-	npr, nsc, sub, sup, nsub, nsup, sube, supe,
+	NULL, NULL, sub, sup, nsub, NULL, sube, supe,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	/* 8848 (0x2290) */
 	NULL, NULL, NULL, NULL, NULL, oplus, NULL, otimes,

Added: php/php-src/trunk/ext/standard/tests/strings/html_entity_decode_html4.phpt
===
--- php/php-src/trunk/ext/standard/tests/strings/html_entity_decode_html4.phpt	(rev 0)
+++ php/php-src/trunk/ext/standard/tests/strings/html_entity_decode_html4.phpt	2009-12-24 09:32:52 UTC (rev 292588)
@@ -0,0 +1,516 @@
+--TEST--
+html_entity_decode() conformance check (HTML 4)
+--FILE--
+?php
+$map = array(
+quot;,
+amp;,
+lt;,
+gt;,
+nbsp;,
+iexcl;,
+cent;,
+pound;,
+curren;,
+yen;,
+brvbar;,
+sect;,
+uml;,
+copy;,
+ordf;,
+laquo;,
+not;,
+shy;,
+reg;,
+macr;,
+deg;,
+plusmn;,
+sup2;,
+sup3;,
+acute;,
+micro;,
+para;,
+middot;,
+cedil;,
+sup1;,
+ordm;,
+raquo;,
+frac14;,
+frac12;,
+frac34;,
+iquest;,
+Agrave;,
+Aacute;,
+Acirc;,
+Atilde;,
+Auml;,
+Aring;,
+AElig;,
+Ccedil;,
+

Re: [PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ NEWS ext/standard/html.c ext/standard/tests/strings/html_entity_decode_html4.phpt ext/standard/tests/strings/htmlentities_html4.phpt

2009-12-23 Thread Moriyoshi Koizumi
I just forgot about HEAD. The change will be available shortly.

Moriyoshi

On Thu, Dec 24, 2009 at 5:56 AM, Jani Taskinen jani.taski...@sci.fi wrote:
 You seem to have forgot to commit to HEAD first and then _merge_ to branch
 again. Or was this something that isn't needed in HEAD or what?

 --Jani


 22.12.2009 7:50, Moriyoshi Koizumi wrote:

 moriyoshi                                Tue, 22 Dec 2009 05:50:34 +

 Revision: http://svn.php.net/viewvc?view=revisionrevision=292467

 Log:
 - Fix bug #46478 (htmlentities() uses obsolete mapping table for character
   entity references)

 Bug: http://bugs.php.net/46478 (Assigned) htmlentities() uses obsolete
 mapping table for character entity references

 Changed paths:
     U   php/php-src/branches/PHP_5_3/NEWS
     U   php/php-src/branches/PHP_5_3/ext/standard/html.c
     A
 php/php-src/branches/PHP_5_3/ext/standard/tests/strings/html_entity_decode_html4.phpt
     A
 php/php-src/branches/PHP_5_3/ext/standard/tests/strings/htmlentities_html4.phpt




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



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



[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ NEWS ext/standard/html.c ext/standard/tests/strings/html_entity_decode_html4.phpt ext/standard/tests/strings/htmlentities_html4.phpt

2009-12-22 Thread Moriyoshi Koizumi
moriyoshiTue, 22 Dec 2009 05:50:34 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=292467

Log:
- Fix bug #46478 (htmlentities() uses obsolete mapping table for character
  entity references)

Bug: http://bugs.php.net/46478 (Assigned) htmlentities() uses obsolete mapping 
table for character entity references
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/standard/html.c
A   
php/php-src/branches/PHP_5_3/ext/standard/tests/strings/html_entity_decode_html4.phpt
A   
php/php-src/branches/PHP_5_3/ext/standard/tests/strings/htmlentities_html4.phpt

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS	2009-12-22 03:19:47 UTC (rev 292466)
+++ php/php-src/branches/PHP_5_3/NEWS	2009-12-22 05:50:34 UTC (rev 292467)
@@ -134,6 +134,8 @@
 - Fixed bug #49174 (crash when extending PDOStatement and trying to set
   queryString property). (Felipe)
 - Fixed bug #47848 (importNode doesn't preserve attribute namespaces). (Rob)
+- Fixed bug #46478 (htmlentities() uses obsolete mapping table for character
+  entity references). (Moriyoshi)
 - Fixed bug #45599 (strip_tags() truncates rest of string with invalid
   attribute). (Ilia, hradtke)
 - Fixed bug #45120 (PDOStatement-execute() returns true then false for same

Modified: php/php-src/branches/PHP_5_3/ext/standard/html.c
===
--- php/php-src/branches/PHP_5_3/ext/standard/html.c	2009-12-22 03:19:47 UTC (rev 292466)
+++ php/php-src/branches/PHP_5_3/ext/standard/html.c	2009-12-22 05:50:34 UTC (rev 292467)
@@ -144,7 +144,7 @@
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	thetasym, upsih,
 	NULL, NULL, NULL,
-	piv
+	piv
 };

 static entity_table_t ent_uni_punct[] = {
@@ -154,7 +154,7 @@
 	NULL, NULL, NULL, ndash, mdash, NULL, NULL, NULL,
 	/* 8216 */
 	lsquo, rsquo, sbquo, NULL, ldquo, rdquo, bdquo, NULL,
-	dagger, Dagger,	bull, NULL, NULL, NULL, hellip,
+	dagger, Dagger, bull, NULL, NULL, NULL, hellip,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, permil, NULL,
 	/* 8242 */
 	prime, Prime, NULL, NULL, NULL, NULL, NULL, lsaquo, rsaquo, NULL,
@@ -194,39 +194,39 @@
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	/* 8656 (0x21d0) */
-	lArr, uArr, rArr, dArr, hArr, vArr, NULL, NULL,
-	NULL, NULL, lAarr, rAarr, NULL, rarrw, NULL, NULL,
+	lArr, uArr, rArr, dArr, hArr, NULL, NULL, NULL,
+	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	/* 8672 (0x21e0) */
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	/* 8704 (0x2200) */
-	forall, comp, part, exist, nexist, empty, NULL, nabla,
-	isin, notin, epsis, ni, notni, bepsi, NULL, prod,
+	forall, NULL, part, exist, NULL, empty, NULL, nabla,
+	isin, notin, NULL, ni, NULL, NULL, NULL, prod,
 	/* 8720 (0x2210) */
-	coprod, sum, minus, mnplus, plusdo, NULL, setmn, lowast,
-	compfn, NULL, radic, NULL, NULL, prop, infin, ang90,
+	NULL, sum, minus, NULL, NULL, NULL, NULL, lowast,
+	NULL, NULL, radic, NULL, NULL, prop, infin, NULL,
 	/* 8736 (0x2220) */
-	ang, angmsd, angsph, mid, nmid, par, npar, and,
-	or, cap, cup, int, NULL, NULL, conint, NULL,
+	ang, NULL, NULL, NULL, NULL, NULL, NULL, and,
+	or, cap, cup, int, NULL, NULL, NULL, NULL,
 	/* 8752 (0x2230) */
-	NULL, NULL, NULL, NULL, there4, becaus, NULL, NULL,
-	NULL, NULL, NULL, NULL, sim, bsim, NULL, NULL,
+	NULL, NULL, NULL, NULL, there4, NULL, NULL, NULL,
+	NULL, NULL, NULL, NULL, sim, NULL, NULL, NULL,
 	/* 8768 (0x2240) */
-	wreath, nsim, NULL, sime, nsime, cong, NULL, ncong,
-	asymp, nap, ape, NULL, bcong, asymp, bump, bumpe,
+	NULL, NULL, NULL, NULL, NULL, cong, NULL, NULL,
+	asymp, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	/* 8784 (0x2250) */
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	/* 8800 (0x2260) */
-	ne, equiv, NULL, NULL, le, ge, lE, gE,
-	lnE, gnE, Lt, Gt, twixt, NULL, nlt, ngt,
+	ne, equiv, NULL, NULL, le, ge, NULL, NULL,
+	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	/* 8816 (0x2270) */
-	nles, nges, lsim, gsim, NULL, NULL, lg, gl,
-	NULL, NULL, pr, sc, cupre, sscue, prsim, scsim,
+	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	/* 8832 (0x2280) */
-	npr, nsc, sub, sup, nsub, nsup, sube, supe,
+	NULL, NULL, sub, sup, nsub, NULL, sube, supe,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	/* 8848 (0x2290) */
 	NULL, NULL, NULL, NULL, NULL, oplus, NULL, otimes,

Added: php/php-src/branches/PHP_5_3/ext/standard/tests/strings/html_entity_decode_html4.phpt
===
--- 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/ext/standard/html.c branches/PHP_5_2/ext/standard/tests/strings/bug49785.phpt branches/PHP_5_3/ext/standard/html.c branches/PHP_5_3/ext/standard/tests/str

2009-12-07 Thread Moriyoshi Koizumi
moriyoshiMon, 07 Dec 2009 15:41:43 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=291821

Log:
- Take account of surrogate pairs.

Changed paths:
U   php/php-src/branches/PHP_5_2/ext/standard/html.c
U   php/php-src/branches/PHP_5_2/ext/standard/tests/strings/bug49785.phpt
U   php/php-src/branches/PHP_5_3/ext/standard/html.c
U   php/php-src/branches/PHP_5_3/ext/standard/tests/strings/bug49785.phpt
U   php/php-src/trunk/ext/standard/html.c
U   php/php-src/trunk/ext/standard/tests/strings/bug49785.phpt

Modified: php/php-src/branches/PHP_5_2/ext/standard/html.c
===
--- php/php-src/branches/PHP_5_2/ext/standard/html.c2009-12-07 15:34:13 UTC 
(rev 291820)
+++ php/php-src/branches/PHP_5_2/ext/standard/html.c2009-12-07 15:41:43 UTC 
(rev 291821)
@@ -566,6 +566,8 @@
this_char = ((c  0x0f)  12) | 
((str[pos + 1]  0x3f)  6) | (str[pos + 2]  0x3f);
if (this_char  0x800) {
MB_FAILURE(pos);
+   } else if (this_char = 0xd800  
this_char = 0xdfff) {
+   MB_FAILURE(pos);
}
MB_WRITE((unsigned char)c);
MB_WRITE((unsigned char)str[pos + 1]);

Modified: php/php-src/branches/PHP_5_2/ext/standard/tests/strings/bug49785.phpt
===
--- php/php-src/branches/PHP_5_2/ext/standard/tests/strings/bug49785.phpt   
2009-12-07 15:34:13 UTC (rev 291820)
+++ php/php-src/branches/PHP_5_2/ext/standard/tests/strings/bug49785.phpt   
2009-12-07 15:41:43 UTC (rev 291821)
@@ -36,10 +36,14 @@
 var_dump(_bin2hex(htmlentities(\xf8\x88\x80\x80\x80, ENT_QUOTES, UTF-8)));

 echo --\n;
-// UTF-8: alternative (invalid) UTF-8 sequence
+// UTF-8: alternative (invalid) UTF-8 sequence / surrogate pairs
 var_dump(_bin2hex(htmlspecialchars(\xc0\xa6, ENT_QUOTES, 'UTF-8')));
 var_dump(_bin2hex(htmlspecialchars(\xe0\x80\xa6, ENT_QUOTES, 'UTF-8')));
 var_dump(_bin2hex(htmlspecialchars(\xf0\x80\x80\xa6, ENT_QUOTES, 'UTF-8')));
+var_dump(_bin2hex(htmlspecialchars(\xec\xbf\xbf, ENT_QUOTES, 'UTF-8')));
+var_dump(_bin2hex(htmlspecialchars(\xed\xa0\x80, ENT_QUOTES, 'UTF-8')));
+var_dump(_bin2hex(htmlspecialchars(\xed\xbf\xbf, ENT_QUOTES, 'UTF-8')));
+var_dump(_bin2hex(htmlspecialchars(\xee\x80\x80, ENT_QUOTES, 'UTF-8')));

 // Shift_JIS: non-lead byte = 0x80
 var_dump(_bin2hex(htmlspecialchars(\x80, ENT_QUOTES, 'Shift_JIS')));
@@ -158,6 +162,10 @@
 string(0) 
 string(0) 
 string(0) 
+string(6) ecbfbf
+string(0) 
+string(0) 
+string(6) ee8080
 string(2) 80
 string(2) a0
 string(2) a1

Modified: php/php-src/branches/PHP_5_3/ext/standard/html.c
===
--- php/php-src/branches/PHP_5_3/ext/standard/html.c2009-12-07 15:34:13 UTC 
(rev 291820)
+++ php/php-src/branches/PHP_5_3/ext/standard/html.c2009-12-07 15:41:43 UTC 
(rev 291821)
@@ -565,6 +565,8 @@
this_char = ((c  0x0f)  12) | 
((str[pos + 1]  0x3f)  6) | (str[pos + 2]  0x3f);
if (this_char  0x800) {
MB_FAILURE(pos);
+   } else if (this_char = 0xd800  
this_char = 0xdfff) {
+   MB_FAILURE(pos);
}
MB_WRITE((unsigned char)c);
MB_WRITE((unsigned char)str[pos + 1]);

Modified: php/php-src/branches/PHP_5_3/ext/standard/tests/strings/bug49785.phpt
===
--- php/php-src/branches/PHP_5_3/ext/standard/tests/strings/bug49785.phpt   
2009-12-07 15:34:13 UTC (rev 291820)
+++ php/php-src/branches/PHP_5_3/ext/standard/tests/strings/bug49785.phpt   
2009-12-07 15:41:43 UTC (rev 291821)
@@ -42,10 +42,14 @@
 var_dump(_bin2hex(htmlentities(\xf0\x80\x80\x80\xf0\x90\x80\x80, ENT_QUOTES 
| ENT_IGNORE, UTF-8)));

 echo --\n;
-// UTF-8: alternative (invalid) UTF-8 sequence
+// UTF-8: alternative (invalid) UTF-8 sequence / surrogate pairs
 var_dump(_bin2hex(htmlspecialchars(\xc0\xa6, ENT_QUOTES, 'UTF-8')));
 var_dump(_bin2hex(htmlspecialchars(\xe0\x80\xa6, ENT_QUOTES, 'UTF-8')));
 var_dump(_bin2hex(htmlspecialchars(\xf0\x80\x80\xa6, ENT_QUOTES, 'UTF-8')));
+var_dump(_bin2hex(htmlspecialchars(\xec\xbf\xbf, ENT_QUOTES, 'UTF-8')));
+var_dump(_bin2hex(htmlspecialchars(\xed\xa0\x80, ENT_QUOTES, 'UTF-8')));
+var_dump(_bin2hex(htmlspecialchars(\xed\xbf\xbf, ENT_QUOTES, 'UTF-8')));
+var_dump(_bin2hex(htmlspecialchars(\xee\x80\x80, ENT_QUOTES, 'UTF-8')));

 // 

Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/ext/standard/html.c branches/PHP_5_2/ext/standard/tests/strings/bug49785.phpt branches/PHP_5_3/ext/standard/html.c branches/PHP_5_3/ext/standard/tes

2009-10-12 Thread Moriyoshi Koizumi
Right.

Moriyoshi

On Mon, Oct 12, 2009 at 5:28 PM, Pierre Joye pierre@gmail.com wrote:
 hi,

 Is it about  #49785?

 Cheers,
 --
 Pierre

 On Mon, Oct 12, 2009 at 1:52 AM, Moriyoshi Koizumi moriyo...@php.net wrote:
 moriyoshi                                Sun, 11 Oct 2009 23:52:33 +

 Revision: http://svn.php.net/viewvc?view=revisionrevision=289554

 Log:
 - A couple more fix for my previous fix.
  (one of the fix by Arnaud Le Blanc. Thanks!)

 Changed paths:
    U   php/php-src/branches/PHP_5_2/ext/standard/html.c
    U   php/php-src/branches/PHP_5_2/ext/standard/tests/strings/bug49785.phpt
    U   php/php-src/branches/PHP_5_3/ext/standard/html.c
    U   php/php-src/branches/PHP_5_3/ext/standard/tests/strings/bug49785.phpt
    U   
 php/php-src/branches/PHP_5_3/ext/standard/tests/strings/htmlentities-utf-2.phpt
    U   
 php/php-src/branches/PHP_5_3/ext/standard/tests/strings/htmlentities-utf.phpt
    U   php/php-src/trunk/ext/standard/html.c
    U   php/php-src/trunk/ext/standard/tests/strings/bug49785.phpt
    U   php/php-src/trunk/ext/standard/tests/strings/htmlentities-utf-2.phpt
    U   php/php-src/trunk/ext/standard/tests/strings/htmlentities-utf.phpt


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




 --
 Pierre

 http://blog.thepimp.net | http://www.libgd.org

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



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



[PHP-CVS] svn: /php/php-src/branches/PHP_5_2/ext/standard/ html.c

2009-10-12 Thread Moriyoshi Koizumi
moriyoshiMon, 12 Oct 2009 14:25:51 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=289565

Log:
- Bug #49785: take 3 - fixed infinite loop bug (only for 5.2) (reported by 
T.Komura. Thanks)

Bug: http://bugs.php.net/49785 (Closed) htmlspecialchars() should check byte 
sequence more strictly
  
Changed paths:
U   php/php-src/branches/PHP_5_2/ext/standard/html.c

Modified: php/php-src/branches/PHP_5_2/ext/standard/html.c
===
--- php/php-src/branches/PHP_5_2/ext/standard/html.c2009-10-12 14:23:29 UTC 
(rev 289564)
+++ php/php-src/branches/PHP_5_2/ext/standard/html.c2009-10-12 14:25:51 UTC 
(rev 289565)
@@ -484,15 +484,26 @@
}\
mbseq[mbpos++] = (mbchar); }

+/* skip one byte and return */
 #define MB_FAILURE(pos) do { \
+   *newpos = pos + 1; \
*status = FAILURE; \
return 0; \
 } while (0)

 #define CHECK_LEN(pos, chars_need) \
-   if((str_len - (pos))  chars_need) {\
-   *status = FAILURE;  \
-   return 0;   
\
+   if (chars_need  1) {   \
+   if((str_len - (pos))  chars_need) {\
+   *newpos = pos;  
\
+   *status = FAILURE;  
\
+   return 0;   
\
+   }   
\
+   } else {
\
+   if((str_len - (pos))  chars_need) {\
+   *newpos = pos + 1;  
\
+   *status = FAILURE;  
\
+   return 0;   
\
+   }   
\
}

 /* {{{ get_next_char

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/ext/standard/html.c branches/PHP_5_3/ext/standard/html.c trunk/ext/standard/html.c

2009-10-12 Thread Moriyoshi Koizumi
moriyoshiMon, 12 Oct 2009 14:29:45 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=289567

Log:
- Bug #49785: take 4 - typo. this flaw is unharmful since the return value of 
get_next_char() is only used when UTF-8 is specified to the third argument.

Bug: http://bugs.php.net/49785 (Closed) htmlspecialchars() should check byte 
sequence more strictly
  
Changed paths:
U   php/php-src/branches/PHP_5_2/ext/standard/html.c
U   php/php-src/branches/PHP_5_3/ext/standard/html.c
U   php/php-src/trunk/ext/standard/html.c

Modified: php/php-src/branches/PHP_5_2/ext/standard/html.c
===
--- php/php-src/branches/PHP_5_2/ext/standard/html.c2009-10-12 14:26:47 UTC 
(rev 289566)
+++ php/php-src/branches/PHP_5_2/ext/standard/html.c2009-10-12 14:29:45 UTC 
(rev 289567)
@@ -689,7 +689,7 @@
MB_WRITE(this_char);
MB_WRITE(next_char);
MB_WRITE(next2_char);
-   this_char = (this_char  16) | 
(next_char  8) | next_char;
+   this_char = (this_char  16) | 
(next_char  8) | next2_char;
} else {
MB_FAILURE(pos);
}

Modified: php/php-src/branches/PHP_5_3/ext/standard/html.c
===
--- php/php-src/branches/PHP_5_3/ext/standard/html.c2009-10-12 14:26:47 UTC 
(rev 289566)
+++ php/php-src/branches/PHP_5_3/ext/standard/html.c2009-10-12 14:29:45 UTC 
(rev 289567)
@@ -688,7 +688,7 @@
MB_WRITE(this_char);
MB_WRITE(next_char);
MB_WRITE(next2_char);
-   this_char = (this_char  16) | 
(next_char  8) | next_char;
+   this_char = (this_char  16) | 
(next_char  8) | next2_char;
} else {
MB_FAILURE(pos);
}

Modified: php/php-src/trunk/ext/standard/html.c
===
--- php/php-src/trunk/ext/standard/html.c   2009-10-12 14:26:47 UTC (rev 
289566)
+++ php/php-src/trunk/ext/standard/html.c   2009-10-12 14:29:45 UTC (rev 
289567)
@@ -694,7 +694,7 @@
MB_WRITE(this_char);
MB_WRITE(next_char);
MB_WRITE(next2_char);
-   this_char = (this_char  16) | 
(next_char  8) | next_char;
+   this_char = (this_char  16) | 
(next_char  8) | next2_char;
} else {
MB_FAILURE(pos);
}

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/ext/standard/html.c branches/PHP_5_2/ext/standard/tests/strings/bug49785.phpt branches/PHP_5_3/ext/standard/html.c branches/PHP_5_3/ext/standard/tests/str

2009-10-12 Thread Moriyoshi Koizumi
moriyoshiTue, 13 Oct 2009 05:18:37 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=289605

Log:
- Bug #49785: take 5. What the hell happened to me...

Bug: http://bugs.php.net/49785 (Closed) htmlspecialchars() should check byte 
sequence more strictly
  
Changed paths:
U   php/php-src/branches/PHP_5_2/ext/standard/html.c
U   php/php-src/branches/PHP_5_2/ext/standard/tests/strings/bug49785.phpt
U   php/php-src/branches/PHP_5_3/ext/standard/html.c
U   php/php-src/branches/PHP_5_3/ext/standard/tests/strings/bug49785.phpt
U   php/php-src/trunk/ext/standard/html.c
U   php/php-src/trunk/ext/standard/tests/strings/bug49785.phpt

Modified: php/php-src/branches/PHP_5_2/ext/standard/html.c
===
--- php/php-src/branches/PHP_5_2/ext/standard/html.c	2009-10-13 04:32:39 UTC (rev 289604)
+++ php/php-src/branches/PHP_5_2/ext/standard/html.c	2009-10-13 05:18:37 UTC (rev 289605)
@@ -539,19 +539,18 @@
 c = str[pos];
 if (c  0x80) {
 	MB_WRITE(c);
-this_char = c;
+	this_char = c;
 	pos++;
 } else if (c  0xc0) {
 	MB_FAILURE(pos);
 } else if (c  0xe0) {
 	CHECK_LEN(pos, 2);
 	if (str[pos + 1]  0x80 || str[pos + 1]  0xbf) {
-MB_FAILURE(pos);
+		MB_FAILURE(pos);
 	}
 	this_char = ((c  0x1f)  6) | (str[pos + 1]  0x3f);
 	if (this_char  0x80) {
-		*status = FAILURE;
-		return 0;
+		MB_FAILURE(pos);
 	}
 	MB_WRITE((unsigned char)c);
 	MB_WRITE((unsigned char)str[pos + 1]);
@@ -559,14 +558,14 @@
 } else if (c  0xf0) {
 	CHECK_LEN(pos, 3);
 	if (str[pos + 1]  0x80 || str[pos + 1]  0xbf) {
-MB_FAILURE(pos);
+		MB_FAILURE(pos);
 	}
 	if (str[pos + 2]  0x80 || str[pos + 2]  0xbf) {
-MB_FAILURE(pos);
+		MB_FAILURE(pos);
 	}
 	this_char = ((c  0x0f)  12) | ((str[pos + 1]  0x3f)  6) | (str[pos + 2]  0x3f);
 	if (this_char  0x800) {
-MB_FAILURE(pos);
+		MB_FAILURE(pos);
 	}
 	MB_WRITE((unsigned char)c);
 	MB_WRITE((unsigned char)str[pos + 1]);
@@ -575,17 +574,17 @@
 } else if (c  0xf8) {
 	CHECK_LEN(pos, 4);
 	if (str[pos + 1]  0x80 || str[pos + 1]  0xbf) {
-MB_FAILURE(pos);
+		MB_FAILURE(pos);
 	}
 	if (str[pos + 2]  0x80 || str[pos + 2]  0xbf) {
-MB_FAILURE(pos);
+		MB_FAILURE(pos);
 	}
 	if (str[pos + 3]  0x80 || str[pos + 3]  0xbf) {
-MB_FAILURE(pos);
+		MB_FAILURE(pos);
 	}
 	this_char = ((c  0x07)  18) | ((str[pos + 1]  0x3f)  12) | ((str[pos + 2]  0x3f)  6) | (str[pos + 3]  0x3f);
 	if (this_char  0x1) {
-MB_FAILURE(pos);
+		MB_FAILURE(pos);
 	}
 	MB_WRITE((unsigned char)c);
 	MB_WRITE((unsigned char)str[pos + 1]);
@@ -593,7 +592,7 @@
 	MB_WRITE((unsigned char)str[pos + 3]);
 	pos += 4;
 } else {
-MB_FAILURE(pos);
+	MB_FAILURE(pos);
 }
 			}
 			break;

Modified: php/php-src/branches/PHP_5_2/ext/standard/tests/strings/bug49785.phpt
===
--- php/php-src/branches/PHP_5_2/ext/standard/tests/strings/bug49785.phpt	2009-10-13 04:32:39 UTC (rev 289604)
+++ php/php-src/branches/PHP_5_2/ext/standard/tests/strings/bug49785.phpt	2009-10-13 05:18:37 UTC (rev 289605)
@@ -36,6 +36,12 @@
 var_dump(_bin2hex(htmlentities(\xf8\x88\x80\x80\x80, ENT_QUOTES, UTF-8)));

 echo --\n;
+// UTF-8: with ENT_IGNORE
+var_dump(_bin2hex(htmlentities(\xc0\xa0\xc2\x80, ENT_QUOTES | ENT_IGNORE, UTF-8)));
+var_dump(_bin2hex(htmlentities(\xe0\x80\x80\xe0\xa0\x80, ENT_QUOTES | ENT_IGNORE, UTF-8)));
+var_dump(_bin2hex(htmlentities(\xf0\x80\x80\x80\xf0\x90\x80\x80, ENT_QUOTES | ENT_IGNORE, UTF-8)));
+
+echo --\n;
 // UTF-8: alternative (invalid) UTF-8 sequence
 var_dump(_bin2hex(htmlspecialchars(\xc0\xa6, ENT_QUOTES, 'UTF-8')));
 var_dump(_bin2hex(htmlspecialchars(\xe0\x80\xa6, ENT_QUOTES, 'UTF-8')));
@@ -155,6 +161,10 @@
 string(0) 
 string(0) 
 --
+string(4) c280
+string(6) e0a080
+string(8) f0908080
+--
 string(0) 
 string(0) 
 string(0) 

Modified: php/php-src/branches/PHP_5_3/ext/standard/html.c
===
--- php/php-src/branches/PHP_5_3/ext/standard/html.c	2009-10-13 04:32:39 UTC (rev 289604)
+++ php/php-src/branches/PHP_5_3/ext/standard/html.c	2009-10-13 05:18:37 UTC (rev 289605)
@@ -538,19 +538,18 @@
 c = str[pos];
 if (c  0x80) {
 	MB_WRITE(c);
-this_char = c;
+	this_char = c;
 	pos++;
 } else if (c  0xc0) {
 	MB_FAILURE(pos);
 } else if (c  0xe0) {
 	CHECK_LEN(pos, 2);
 	if (str[pos + 1]  0x80 || str[pos + 1]  0xbf) {
-MB_FAILURE(pos);
+		MB_FAILURE(pos);
 	}
 	

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/ext/standard/html.c branches/PHP_5_2/ext/standard/tests/strings/bug49785.phpt branches/PHP_5_3/ext/standard/html.c branches/PHP_5_3/ext/standard/tests/str

2009-10-11 Thread Moriyoshi Koizumi
moriyoshiSun, 11 Oct 2009 23:52:33 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=289554

Log:
- A couple more fix for my previous fix.
  (one of the fix by Arnaud Le Blanc. Thanks!)

Changed paths:
U   php/php-src/branches/PHP_5_2/ext/standard/html.c
U   php/php-src/branches/PHP_5_2/ext/standard/tests/strings/bug49785.phpt
U   php/php-src/branches/PHP_5_3/ext/standard/html.c
U   php/php-src/branches/PHP_5_3/ext/standard/tests/strings/bug49785.phpt
U   
php/php-src/branches/PHP_5_3/ext/standard/tests/strings/htmlentities-utf-2.phpt
U   
php/php-src/branches/PHP_5_3/ext/standard/tests/strings/htmlentities-utf.phpt
U   php/php-src/trunk/ext/standard/html.c
U   php/php-src/trunk/ext/standard/tests/strings/bug49785.phpt
U   php/php-src/trunk/ext/standard/tests/strings/htmlentities-utf-2.phpt
U   php/php-src/trunk/ext/standard/tests/strings/htmlentities-utf.phpt

Modified: php/php-src/branches/PHP_5_2/ext/standard/html.c
===
--- php/php-src/branches/PHP_5_2/ext/standard/html.c	2009-10-11 23:37:52 UTC (rev 289553)
+++ php/php-src/branches/PHP_5_2/ext/standard/html.c	2009-10-11 23:52:33 UTC (rev 289554)
@@ -484,6 +484,11 @@
 			}\
 			mbseq[mbpos++] = (mbchar); }

+#define MB_FAILURE(pos) do { \
+	*status = FAILURE; \
+	return 0; \
+} while (0)
+
 #define CHECK_LEN(pos, chars_need)			\
 	if((str_len - (pos))  chars_need) {	\
 		*status = FAILURE;	\
@@ -526,10 +531,12 @@
 this_char = c;
 	pos++;
 } else if (c  0xc0) {
-	*status = FAILURE;
-	return 0;
+	MB_FAILURE(pos);
 } else if (c  0xe0) {
 	CHECK_LEN(pos, 2);
+	if (str[pos + 1]  0x80 || str[pos + 1]  0xbf) {
+MB_FAILURE(pos);
+	}
 	this_char = ((c  0x1f)  6) | (str[pos + 1]  0x3f);
 	if (this_char  0x80) {
 		*status = FAILURE;
@@ -540,10 +547,15 @@
 	pos += 2;
 } else if (c  0xf0) {
 	CHECK_LEN(pos, 3);
+	if (str[pos + 1]  0x80 || str[pos + 1]  0xbf) {
+MB_FAILURE(pos);
+	}
+	if (str[pos + 2]  0x80 || str[pos + 2]  0xbf) {
+MB_FAILURE(pos);
+	}
 	this_char = ((c  0x0f)  12) | ((str[pos + 1]  0x3f)  6) | (str[pos + 2]  0x3f);
 	if (this_char  0x800) {
-		*status = FAILURE;
-		return 0;
+MB_FAILURE(pos);
 	}
 	MB_WRITE((unsigned char)c);
 	MB_WRITE((unsigned char)str[pos + 1]);
@@ -551,10 +563,18 @@
 	pos += 3;
 } else if (c  0xf8) {
 	CHECK_LEN(pos, 4);
+	if (str[pos + 1]  0x80 || str[pos + 1]  0xbf) {
+MB_FAILURE(pos);
+	}
+	if (str[pos + 2]  0x80 || str[pos + 2]  0xbf) {
+MB_FAILURE(pos);
+	}
+	if (str[pos + 3]  0x80 || str[pos + 3]  0xbf) {
+MB_FAILURE(pos);
+	}
 	this_char = ((c  0x07)  18) | ((str[pos + 1]  0x3f)  12) | ((str[pos + 2]  0x3f)  6) | (str[pos + 3]  0x3f);
 	if (this_char  0x1) {
-		*status = FAILURE;
-		return 0;
+MB_FAILURE(pos);
 	}
 	MB_WRITE((unsigned char)c);
 	MB_WRITE((unsigned char)str[pos + 1]);
@@ -562,8 +582,7 @@
 	MB_WRITE((unsigned char)str[pos + 3]);
 	pos += 4;
 } else {
-	*status = FAILURE;
-	return 0;
+MB_FAILURE(pos);
 }
 			}
 			break;
@@ -585,8 +604,7 @@
 		MB_WRITE(next_char);
 		this_char = (this_char  8) | next_char;
 	} else {
-		*status = FAILURE;
-		return 0;
+		MB_FAILURE(pos);
 	}
 } else {
 	MB_WRITE(this_char);
@@ -611,8 +629,7 @@
 		MB_WRITE(next_char);
 		this_char = (this_char  8) | next_char;
 	} else {
-		*status = FAILURE;
-		return 0;
+		MB_FAILURE(pos);
 	}
 } else {
 	MB_WRITE(this_char);
@@ -634,8 +651,7 @@
 		MB_WRITE(next_char);
 		this_char = (this_char  8) | next_char;
 	} else {
-		*status = FAILURE;
-		return 0;
+		MB_FAILURE(pos);
 	}
 } else if (this_char == 0x8e) {
 	/* peek at the next char */
@@ -647,8 +663,7 @@
 		MB_WRITE(next_char);
 		this_char = (this_char  8) | next_char;
 	} else {
-		*status = FAILURE;
-		return 0;
+		MB_FAILURE(pos);
 	}
 } else if (this_char == 0x8f) {
 	/* peek at the next two char */
@@ -665,8 +680,7 @@
 		MB_WRITE(next2_char);
 		this_char = (this_char  16) | (next_char  8) | next_char;
 	} else {
-		*status = FAILURE;
-		return 0;
+		MB_FAILURE(pos);
 	}
 } else {
 	MB_WRITE(this_char);

Modified: php/php-src/branches/PHP_5_2/ext/standard/tests/strings/bug49785.phpt
===
--- php/php-src/branches/PHP_5_2/ext/standard/tests/strings/bug49785.phpt	2009-10-11 23:37:52 UTC (rev 289553)
+++ 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/ext/standard/tests/strings/bug49785.phpt branches/PHP_5_3/ext/standard/tests/strings/bug49785.phpt trunk/ext/standard/tests/strings/bug49785.phpt

2009-10-09 Thread Moriyoshi Koizumi
moriyoshiFri, 09 Oct 2009 17:13:05 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=289429

Log:
- More tests to go.

Changed paths:
U   php/php-src/branches/PHP_5_2/ext/standard/tests/strings/bug49785.phpt
U   php/php-src/branches/PHP_5_3/ext/standard/tests/strings/bug49785.phpt
U   php/php-src/trunk/ext/standard/tests/strings/bug49785.phpt

Modified: php/php-src/branches/PHP_5_2/ext/standard/tests/strings/bug49785.phpt
===
--- php/php-src/branches/PHP_5_2/ext/standard/tests/strings/bug49785.phpt   
2009-10-09 17:03:56 UTC (rev 289428)
+++ php/php-src/branches/PHP_5_2/ext/standard/tests/strings/bug49785.phpt   
2009-10-09 17:13:05 UTC (rev 289429)
@@ -6,6 +6,22 @@
 return is_string($val) ? bin2hex($val): $val;
 }

+// UTF-8: basic tests
+var_dump(bin2hex(htmlentities(\xc1\xbf, ENT_QUOTES, UTF-8)));
+var_dump(bin2hex(htmlentities(\xc2\x80, ENT_QUOTES, UTF-8)));
+var_dump(bin2hex(htmlentities(\xce\x91, ENT_QUOTES, UTF-8)));
+var_dump(bin2hex(htmlentities(\xce\xb1, ENT_QUOTES, UTF-8)));
+var_dump(bin2hex(htmlentities(\xdf\xbf, ENT_QUOTES, UTF-8)));
+var_dump(bin2hex(htmlentities(\xe0\xa0\x80, ENT_QUOTES, UTF-8)));
+var_dump(bin2hex(htmlentities(\xe0\x9f\xbf, ENT_QUOTES, UTF-8)));
+var_dump(bin2hex(htmlentities(\xe2\x99\xa5, ENT_QUOTES, UTF-8)));
+var_dump(bin2hex(htmlentities(\xef\xbf\xbf, ENT_QUOTES, UTF-8)));
+var_dump(bin2hex(htmlentities(\xf0\x8f\xbf\xbf, ENT_QUOTES, UTF-8)));
+var_dump(bin2hex(htmlentities(\xf0\x90\x80\x80, ENT_QUOTES, UTF-8)));
+var_dump(bin2hex(htmlentities(\xf7\xbf\xbf\xbf, ENT_QUOTES, UTF-8)));
+var_dump(bin2hex(htmlentities(\xf8\x88\x80\x80\x80, ENT_QUOTES, UTF-8)));
+
+echo --\n;
 // UTF-8: alternative (invalid) UTF-8 sequence
 var_dump(_bin2hex(htmlspecialchars(\xc0\xa6, ENT_QUOTES, 'UTF-8')));
 var_dump(_bin2hex(htmlspecialchars(\xe0\x80\xa6, ENT_QUOTES, 'UTF-8')));
@@ -98,8 +114,22 @@
 ?
 --EXPECT--
 string(0) 
+string(4) c280
+string(14) 26416c7068613b
+string(14) 26616c7068613b
+string(4) dfbf
+string(6) e0a080
 string(0) 
+string(16) 266865617274733b
+string(6) efbfbf
 string(0) 
+string(8) f0908080
+string(8) f7bfbfbf
+string(0) 
+--
+string(0) 
+string(0) 
+string(0) 
 string(2) 80
 string(2) a0
 string(2) a1

Modified: php/php-src/branches/PHP_5_3/ext/standard/tests/strings/bug49785.phpt
===
--- php/php-src/branches/PHP_5_3/ext/standard/tests/strings/bug49785.phpt   
2009-10-09 17:03:56 UTC (rev 289428)
+++ php/php-src/branches/PHP_5_3/ext/standard/tests/strings/bug49785.phpt   
2009-10-09 17:13:05 UTC (rev 289429)
@@ -6,6 +6,22 @@
 return is_string($val) ? bin2hex($val): $val;
 }

+// UTF-8: basic tests
+var_dump(bin2hex(htmlentities(\xc1\xbf, ENT_QUOTES, UTF-8)));
+var_dump(bin2hex(htmlentities(\xc2\x80, ENT_QUOTES, UTF-8)));
+var_dump(bin2hex(htmlentities(\xce\x91, ENT_QUOTES, UTF-8)));
+var_dump(bin2hex(htmlentities(\xce\xb1, ENT_QUOTES, UTF-8)));
+var_dump(bin2hex(htmlentities(\xdf\xbf, ENT_QUOTES, UTF-8)));
+var_dump(bin2hex(htmlentities(\xe0\xa0\x80, ENT_QUOTES, UTF-8)));
+var_dump(bin2hex(htmlentities(\xe0\x9f\xbf, ENT_QUOTES, UTF-8)));
+var_dump(bin2hex(htmlentities(\xe2\x99\xa5, ENT_QUOTES, UTF-8)));
+var_dump(bin2hex(htmlentities(\xef\xbf\xbf, ENT_QUOTES, UTF-8)));
+var_dump(bin2hex(htmlentities(\xf0\x8f\xbf\xbf, ENT_QUOTES, UTF-8)));
+var_dump(bin2hex(htmlentities(\xf0\x90\x80\x80, ENT_QUOTES, UTF-8)));
+var_dump(bin2hex(htmlentities(\xf7\xbf\xbf\xbf, ENT_QUOTES, UTF-8)));
+var_dump(bin2hex(htmlentities(\xf8\x88\x80\x80\x80, ENT_QUOTES, UTF-8)));
+
+echo --\n;
 // UTF-8: alternative (invalid) UTF-8 sequence
 var_dump(_bin2hex(htmlspecialchars(\xc0\xa6, ENT_QUOTES, 'UTF-8')));
 var_dump(_bin2hex(htmlspecialchars(\xe0\x80\xa6, ENT_QUOTES, 'UTF-8')));
@@ -98,8 +114,22 @@
 ?
 --EXPECT--
 string(0) 
+string(4) c280
+string(14) 26416c7068613b
+string(14) 26616c7068613b
+string(4) dfbf
+string(6) e0a080
 string(0) 
+string(16) 266865617274733b
+string(6) efbfbf
 string(0) 
+string(8) f0908080
+string(8) f7bfbfbf
+string(0) 
+--
+string(0) 
+string(0) 
+string(0) 
 string(2) 80
 string(2) a0
 string(2) a1

Modified: php/php-src/trunk/ext/standard/tests/strings/bug49785.phpt
===
--- php/php-src/trunk/ext/standard/tests/strings/bug49785.phpt  2009-10-09 
17:03:56 UTC (rev 289428)
+++ php/php-src/trunk/ext/standard/tests/strings/bug49785.phpt  2009-10-09 
17:13:05 UTC (rev 289429)
@@ -6,6 +6,22 @@
 return is_string($val) ? bin2hex($val): $val;
 }

+// UTF-8: basic tests
+var_dump(bin2hex(htmlentities(\xc1\xbf, ENT_QUOTES, UTF-8)));
+var_dump(bin2hex(htmlentities(\xc2\x80, ENT_QUOTES, UTF-8)));
+var_dump(bin2hex(htmlentities(\xce\x91, ENT_QUOTES, UTF-8)));
+var_dump(bin2hex(htmlentities(\xce\xb1, ENT_QUOTES, UTF-8)));
+var_dump(bin2hex(htmlentities(\xdf\xbf, ENT_QUOTES, UTF-8)));

[PHP-CVS] svn: /php/php-src/branches/PHP_5_2/ NEWS ext/mbstring/libmbfl/filters/mbfilter_utf16.c ext/mbstring/libmbfl/filters/mbfilter_utf8.c ext/mbstring/libmbfl/mbfl/mbfilter.c ext/mbstring/tests/bu

2009-09-23 Thread Moriyoshi Koizumi
moriyoshiWed, 23 Sep 2009 14:26:51 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=288612

Log:
* Merge two patches from 5.3 branch (intentionally uncommited because 5.2.11
  was about to come at that time).

Changed paths:
_U  php/php-src/branches/PHP_5_2/
U   php/php-src/branches/PHP_5_2/NEWS
U   
php/php-src/branches/PHP_5_2/ext/mbstring/libmbfl/filters/mbfilter_utf16.c
U   
php/php-src/branches/PHP_5_2/ext/mbstring/libmbfl/filters/mbfilter_utf8.c
U   php/php-src/branches/PHP_5_2/ext/mbstring/libmbfl/mbfl/mbfilter.c
A + php/php-src/branches/PHP_5_2/ext/mbstring/tests/bug49528.phpt
(from 
php/php-src/branches/PHP_5_3/ext/mbstring/tests/bug49528.phpt:r288260)
A + php/php-src/branches/PHP_5_2/ext/mbstring/tests/bug49536.phpt
(from 
php/php-src/branches/PHP_5_3/ext/mbstring/tests/bug49536.phpt:r288273)


Property changes on: php/php-src/branches/PHP_5_2
___
Modified: svn:mergeinfo
   - /php/php-src/branches/PHP_5_3:284120
/php/php-src/trunk:284726
   + /php/php-src/branches/PHP_5_3:284120,288260,288273
/php/php-src/trunk:284726

Modified: php/php-src/branches/PHP_5_2/NEWS
===
--- php/php-src/branches/PHP_5_2/NEWS   2009-09-23 14:18:04 UTC (rev 288611)
+++ php/php-src/branches/PHP_5_2/NEWS   2009-09-23 14:26:51 UTC (rev 288612)
@@ -3,8 +3,12 @@
 ?? ??? , PHP 5.2.12
 - Fixed bug #49630 (imap_listscan function missing). (Felipe)
 - Fixed bug #49578 (make install-pear fails). (Hannes)
+- Fixed bug #49536 (mb_detect_encoding() returns incorrect results when
+  mbstring.strict_mode is turned on). (Moriyoshi)
 - Fixed bug #49531 (CURLOPT_INFILESIZE sometimes causes warning CURLPROTO_FILE
   cannot be set). (Felipe)
+- Fixed bug #49528 (UTF-16 strings prefixed by BOMs wrondly converted).
+  (Moriyoshi)

 17 Sep 2009, PHP 5.2.11
 - Fixed certificate validation inside php_openssl_apply_verification_policy.

Modified: 
php/php-src/branches/PHP_5_2/ext/mbstring/libmbfl/filters/mbfilter_utf16.c
===
--- php/php-src/branches/PHP_5_2/ext/mbstring/libmbfl/filters/mbfilter_utf16.c  
2009-09-23 14:18:04 UTC (rev 288611)
+++ php/php-src/branches/PHP_5_2/ext/mbstring/libmbfl/filters/mbfilter_utf16.c  
2009-09-23 14:26:51 UTC (rev 288612)
@@ -127,7 +127,7 @@
int n, endian;

endian = filter-status  0xff00;
-   switch (filter-status  0xff) {
+   switch (filter-status  0x0f) {
case 0:
if (endian) {
n = c  0xff;
@@ -144,15 +144,8 @@
n = c  0xff;
}
n |= filter-cache  0x;
-   filter-status = ~0xff;
-   if (n == 0xfffe) {
-   if (endian) {
-   filter-status = 0; /* big-endian */
-   } else {
-   filter-status = 0x100; /* 
little-endian */
-   }
-   CK((*filter-output_function)(0xfeff, filter-data));
-   } else if (n = 0xd800  n  0xdc00) {
+   filter-status = ~0x0f;
+   if (n = 0xd800  n  0xdc00) {
filter-cache = ((n  0x3ff)  16) + 0x40;
} else if (n = 0xdc00  n  0xe000) {
n = 0x3ff;
@@ -166,7 +159,21 @@
CK((*filter-output_function)(n, filter-data));
}
} else {
+   int is_first = filter-status  0x10;
filter-cache = 0;
+   filter-status |= 0x10;
+   if (!is_first) {
+   if (n == 0xfffe) {
+   if (endian) {
+   filter-status = ~0x100;   
/* big-endian */
+   } else {
+   filter-status |= 0x100;
/* little-endian */
+   }
+   break;
+   } else if (n == 0xfeff) {
+   break;
+   }
+   }
CK((*filter-output_function)(n, filter-data));
}
break;

Modified: 
php/php-src/branches/PHP_5_2/ext/mbstring/libmbfl/filters/mbfilter_utf8.c
===
--- php/php-src/branches/PHP_5_2/ext/mbstring/libmbfl/filters/mbfilter_utf8.c   
2009-09-23 14:18:04 UTC (rev 288611)
+++ php/php-src/branches/PHP_5_2/ext/mbstring/libmbfl/filters/mbfilter_utf8.c   
2009-09-23 14:26:51 UTC (rev 288612)
@@ -215,7 +215,7 @@
   

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/NEWS branches/PHP_5_2/ext/mbstring/mbstring.c branches/PHP_5_2/ext/mbstring/tests/bug49354.phpt branches/PHP_5_3/ext/mbstring/mbstring.c branches/PHP_5_3/

2009-09-23 Thread Moriyoshi Koizumi
moriyoshiWed, 23 Sep 2009 15:22:47 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=288613

Log:
- Fixed bug #49354 (mb_strcut() cuts wrong length when offset is within a
  multibyte character).

(This bug was introduced by the commit by r202895. Please double-check the
 specification of the function you are going to *fix*.)

Bug: http://bugs.php.net/49354 (Assigned) mb_strcut() cutting wrong length when 
offset is within a multibyte character
  
Changed paths:
U   php/php-src/branches/PHP_5_2/NEWS
U   php/php-src/branches/PHP_5_2/ext/mbstring/mbstring.c
A   php/php-src/branches/PHP_5_2/ext/mbstring/tests/bug49354.phpt
U   php/php-src/branches/PHP_5_3/ext/mbstring/mbstring.c
A   php/php-src/branches/PHP_5_3/ext/mbstring/tests/bug49354.phpt
U   php/php-src/trunk/ext/mbstring/mbstring.c
A   php/php-src/trunk/ext/mbstring/tests/bug49354.phpt

Modified: php/php-src/branches/PHP_5_2/NEWS
===
--- php/php-src/branches/PHP_5_2/NEWS   2009-09-23 14:26:51 UTC (rev 288612)
+++ php/php-src/branches/PHP_5_2/NEWS   2009-09-23 15:22:47 UTC (rev 288613)
@@ -7,6 +7,8 @@
   mbstring.strict_mode is turned on). (Moriyoshi)
 - Fixed bug #49531 (CURLOPT_INFILESIZE sometimes causes warning CURLPROTO_FILE
   cannot be set). (Felipe)
+- Fixed bug #49354 (mb_strcut() cuts wrong length when offset is in the middle
+  of a multibyte character). (Moriyoshi)
 - Fixed bug #49528 (UTF-16 strings prefixed by BOMs wrondly converted).
   (Moriyoshi)


Modified: php/php-src/branches/PHP_5_2/ext/mbstring/mbstring.c
===
--- php/php-src/branches/PHP_5_2/ext/mbstring/mbstring.c2009-09-23 
14:26:51 UTC (rev 288612)
+++ php/php-src/branches/PHP_5_2/ext/mbstring/mbstring.c2009-09-23 
15:22:47 UTC (rev 288613)
@@ -2272,9 +2272,6 @@
if (from  Z_STRLEN_PP(arg1)) {
RETURN_FALSE;
}
-   if (((unsigned) from + (unsigned) len)  Z_STRLEN_PP(arg1)) {
-   len = Z_STRLEN_PP(arg1) - from;
-   }

ret = mbfl_strcut(string, result, from, len);
if (ret != NULL) {

Added: php/php-src/branches/PHP_5_2/ext/mbstring/tests/bug49354.phpt
===
--- php/php-src/branches/PHP_5_2/ext/mbstring/tests/bug49354.phpt   
(rev 0)
+++ php/php-src/branches/PHP_5_2/ext/mbstring/tests/bug49354.phpt   
2009-09-23 15:22:47 UTC (rev 288613)
@@ -0,0 +1,21 @@
+--TEST--
+Bug #49354 (mb_strcut() cuts wrong length when offset is in the middle of a 
multibyte character)
+--SKIPIF--
+?php extension_loaded('mbstring') or die('skip mbstring not available'); ?
+--FILE--
+?php
+$crap = 'AåBäCöDü';
+var_dump(mb_strcut($crap, 0, 100, 'UTF-8'));
+var_dump(mb_strcut($crap, 1, 100, 'UTF-8'));
+var_dump(mb_strcut($crap, 2, 100, 'UTF-8'));
+var_dump(mb_strcut($crap, 3, 100, 'UTF-8'));
+var_dump(mb_strcut($crap, 12, 100, 'UTF-8'));
+var_dump(mb_strcut($crap, 13, 100, 'UTF-8'));
+?
+--EXPECT--
+string(12) AåBäCöDü
+string(11) åBäCöDü
+string(11) åBäCöDü
+string(9) BäCöDü
+string(0) 
+bool(false)

Modified: php/php-src/branches/PHP_5_3/ext/mbstring/mbstring.c
===
--- php/php-src/branches/PHP_5_3/ext/mbstring/mbstring.c2009-09-23 
14:26:51 UTC (rev 288612)
+++ php/php-src/branches/PHP_5_3/ext/mbstring/mbstring.c2009-09-23 
15:22:47 UTC (rev 288613)
@@ -2665,10 +2665,6 @@
RETURN_FALSE;
}

-   if (((unsigned int)from + (unsigned int)len)  string.len) {
-   len = string.len - from;
-   }
-
ret = mbfl_strcut(string, result, from, len);
if (ret == NULL) {
RETURN_FALSE;

Added: php/php-src/branches/PHP_5_3/ext/mbstring/tests/bug49354.phpt
===
--- php/php-src/branches/PHP_5_3/ext/mbstring/tests/bug49354.phpt   
(rev 0)
+++ php/php-src/branches/PHP_5_3/ext/mbstring/tests/bug49354.phpt   
2009-09-23 15:22:47 UTC (rev 288613)
@@ -0,0 +1,21 @@
+--TEST--
+Bug #49354 (mb_strcut() cuts wrong length when offset is in the middle of a 
multibyte character)
+--SKIPIF--
+?php extension_loaded('mbstring') or die('skip mbstring not available'); ?
+--FILE--
+?php
+$crap = 'AåBäCöDü';
+var_dump(mb_strcut($crap, 0, 100, 'UTF-8'));
+var_dump(mb_strcut($crap, 1, 100, 'UTF-8'));
+var_dump(mb_strcut($crap, 2, 100, 'UTF-8'));
+var_dump(mb_strcut($crap, 3, 100, 'UTF-8'));
+var_dump(mb_strcut($crap, 12, 100, 'UTF-8'));
+var_dump(mb_strcut($crap, 13, 100, 'UTF-8'));
+?
+--EXPECT--
+string(12) AåBäCöDü
+string(11) åBäCöDü
+string(11) åBäCöDü
+string(9) BäCöDü
+string(0) 
+bool(false)

Modified: php/php-src/trunk/ext/mbstring/mbstring.c
===
--- 

Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_utf8.c branches/PHP_5_3/ext/mbstring/libmbfl/mbfl/mbfilter.c branches/PHP_5_3/ext/mbstring/tests/bug49536.phpt

2009-09-14 Thread Moriyoshi Koizumi
Ilia,

I guess this and the other mbstring patch should be applied to 5.2
branch as well. Is it ok to merge them?

Moriyoshi

On Sat, Sep 12, 2009 at 6:26 AM, Moriyoshi Koizumi moriyo...@php.net wrote:
 moriyoshi                                Fri, 11 Sep 2009 21:26:18 +

 Revision: http://svn.php.net/viewvc?view=revisionrevision=288273

 Log:
 - Fix bug #49536 (mb_detect_encoding() returns incorrect results when 
 strict_mode is turned on.)
  (patch by komura, thanks!)

 Bug: http://bugs.php.net/49536 (Open) mb_detect_encoding() returns incorrect 
 results when strict_mode is turned on

 Changed paths:
    U   
 php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_utf8.c
    U   php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/mbfl/mbfilter.c
    A   php/php-src/branches/PHP_5_3/ext/mbstring/tests/bug49536.phpt
    U   php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8.c
    U   php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfilter.c
    A   php/php-src/trunk/ext/mbstring/tests/bug49536.phpt

 Modified: 
 php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_utf8.c
 ===
 --- php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_utf8.c 
   2009-09-11 16:43:49 UTC (rev 288272)
 +++ php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_utf8.c 
   2009-09-11 21:26:18 UTC (rev 288273)
 @@ -220,7 +220,7 @@
        if (c  0x80) {
                if (c  0) {
                        filter-flag = 1;       /* bad */
 -               } else if (c != 0  filter-status) {
 +               } else if (filter-status) {
                        filter-flag = 1;       /* bad */
                }
                filter-status = 0;

 Modified: php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/mbfl/mbfilter.c
 ===
 --- php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/mbfl/mbfilter.c   
 2009-09-11 16:43:49 UTC (rev 288272)
 +++ php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/mbfl/mbfilter.c   
 2009-09-11 21:26:18 UTC (rev 288273)
 @@ -622,7 +622,7 @@
        if (!encoding) {
                for (i = 0; i  num; i++) {
                        filter = flist[i];
 -                       if (!filter-flag) {
 +                       if (!filter-flag  (!strict || !filter-status)) {
                                encoding = filter-encoding;
                                break;
                        }

 Added: php/php-src/branches/PHP_5_3/ext/mbstring/tests/bug49536.phpt
 ===
 --- php/php-src/branches/PHP_5_3/ext/mbstring/tests/bug49536.phpt             
                   (rev 0)
 +++ php/php-src/branches/PHP_5_3/ext/mbstring/tests/bug49536.phpt       
 2009-09-11 21:26:18 UTC (rev 288273)
 @@ -0,0 +1,20 @@
 +--TEST--
 +Bug #49536 (mb_detect_encoding() returns incorrect results when strict_mode 
 is turned on)
 +--SKIPIF--
 +?php extension_loaded('mbstring') or die('skip mbstring not available'); ?
 +--FILE--
 +?php
 +// non-strict mode
 +var_dump(mb_detect_encoding(A\x81, SJIS, false));
 +// strict mode
 +var_dump(mb_detect_encoding(A\x81, SJIS, true));
 +// non-strict mode
 +var_dump(mb_detect_encoding(\xc0\x00, UTF-8, false));
 +// strict mode
 +var_dump(mb_detect_encoding(\xc0\x00, UTF-8, true));
 +?
 +--EXPECT--
 +string(4) SJIS
 +bool(false)
 +string(5) UTF-8
 +bool(false)

 Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8.c
 ===
 --- php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8.c      
 2009-09-11 16:43:49 UTC (rev 288272)
 +++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8.c      
 2009-09-11 21:26:18 UTC (rev 288273)
 @@ -220,7 +220,7 @@
        if (c  0x80) {
                if (c  0) {
                        filter-flag = 1;       /* bad */
 -               } else if (c != 0  filter-status) {
 +               } else if (filter-status) {
                        filter-flag = 1;       /* bad */
                }
                filter-status = 0;

 Modified: php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfilter.c
 ===
 --- php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfilter.c      2009-09-11 
 16:43:49 UTC (rev 288272)
 +++ php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfilter.c      2009-09-11 
 21:26:18 UTC (rev 288273)
 @@ -622,7 +622,7 @@
        if (!encoding) {
                for (i = 0; i  num; i++) {
                        filter = flist[i];
 -                       if (!filter-flag) {
 +                       if (!filter-flag  (!strict || !filter-status)) {
                                encoding = filter-encoding;
                                break;
                        }

 Added: php/php-src/trunk/ext/mbstring/tests/bug49536.phpt

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/Zend/zend_execute_API.c branches/PHP_5_3/Zend/zend_execute_API.c trunk/Zend/zend_execute_API.c

2009-09-14 Thread Moriyoshi Koizumi
moriyoshiTue, 15 Sep 2009 00:09:13 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=288345

Log:
- WS fix (spaces to tabs)

Changed paths:
U   php/php-src/branches/PHP_5_2/Zend/zend_execute_API.c
U   php/php-src/branches/PHP_5_3/Zend/zend_execute_API.c
U   php/php-src/trunk/Zend/zend_execute_API.c

Modified: php/php-src/branches/PHP_5_2/Zend/zend_execute_API.c
===
--- php/php-src/branches/PHP_5_2/Zend/zend_execute_API.c2009-09-14 
22:47:09 UTC (rev 288344)
+++ php/php-src/branches/PHP_5_2/Zend/zend_execute_API.c2009-09-15 
00:09:13 UTC (rev 288345)
@@ -921,7 +921,7 @@
for (i=0; ifci-param_count; i++) {
zval *param;

-   if(EX(function_state).function-type == ZEND_INTERNAL_FUNCTION
+   if (EX(function_state).function-type == ZEND_INTERNAL_FUNCTION
 
!ARG_SHOULD_BE_SENT_BY_REF(EX(function_state).function, i + 1)
 PZVAL_IS_REF(*fci-params[i])) {
SEPARATE_ZVAL(fci-params[i]);

Modified: php/php-src/branches/PHP_5_3/Zend/zend_execute_API.c
===
--- php/php-src/branches/PHP_5_3/Zend/zend_execute_API.c2009-09-14 
22:47:09 UTC (rev 288344)
+++ php/php-src/branches/PHP_5_3/Zend/zend_execute_API.c2009-09-15 
00:09:13 UTC (rev 288345)
@@ -837,7 +837,7 @@
for (i=0; ifci-param_count; i++) {
zval *param;

-   if(EX(function_state).function-type == ZEND_INTERNAL_FUNCTION
+   if (EX(function_state).function-type == ZEND_INTERNAL_FUNCTION
 
!ARG_SHOULD_BE_SENT_BY_REF(EX(function_state).function, i + 1)
 PZVAL_IS_REF(*fci-params[i])) {
SEPARATE_ZVAL(fci-params[i]);

Modified: php/php-src/trunk/Zend/zend_execute_API.c
===
--- php/php-src/trunk/Zend/zend_execute_API.c   2009-09-14 22:47:09 UTC (rev 
288344)
+++ php/php-src/trunk/Zend/zend_execute_API.c   2009-09-15 00:09:13 UTC (rev 
288345)
@@ -872,7 +872,7 @@
for (i=0; ifci-param_count; i++) {
zval *param;

-   if(EX(function_state).function-type == ZEND_INTERNAL_FUNCTION
+   if (EX(function_state).function-type == ZEND_INTERNAL_FUNCTION
 
!ARG_SHOULD_BE_SENT_BY_REF(EX(function_state).function, i + 1)
 PZVAL_IS_REF(*fci-params[i])) {
SEPARATE_ZVAL(fci-params[i]);

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/NEWS branches/PHP_5_2/ext/mbstring/tests/bug48697.phpt branches/PHP_5_3/ext/mbstring/tests/bug48697.phpt trunk/ext/mbstring/tests/bug48697.phpt

2009-09-13 Thread Moriyoshi Koizumi
moriyoshiMon, 14 Sep 2009 04:11:29 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=288301

Log:
- Looks like bug #48697 has already been fixed in RC1.

Bug: http://bugs.php.net/48697 (Assigned) mb_internal_encoding() value gets 
reset by parse_str() or mb_parse_str()
  
Changed paths:
U   php/php-src/branches/PHP_5_2/NEWS
A   php/php-src/branches/PHP_5_2/ext/mbstring/tests/bug48697.phpt
A   php/php-src/branches/PHP_5_3/ext/mbstring/tests/bug48697.phpt
A   php/php-src/trunk/ext/mbstring/tests/bug48697.phpt

Modified: php/php-src/branches/PHP_5_2/NEWS
===
--- php/php-src/branches/PHP_5_2/NEWS   2009-09-14 03:13:03 UTC (rev 288300)
+++ php/php-src/branches/PHP_5_2/NEWS   2009-09-14 04:11:29 UTC (rev 288301)
@@ -80,6 +80,8 @@
 - Fixed bug #48718 (FILTER_VALIDATE_EMAIL does not allow numbers in domain
   components). (Ilia)
 - Fixed bug #48709 (metaphone and 'wh'). (brettz9 at yahoo dot com, Felipe)
+- Fixed bug #48697 (mb_internal_encoding() value gets reset by parse_str()).
+  (Moriyoshi)
 - Fixed bug #48693 (Double declaration of __lambda_func when lambda wrongly
   formatted). (peter at lvp-media dot com, Felipe)
 - Fixed bug #48661 (phpize is broken with non-bash shells). (Jani)

Added: php/php-src/branches/PHP_5_2/ext/mbstring/tests/bug48697.phpt
===
--- php/php-src/branches/PHP_5_2/ext/mbstring/tests/bug48697.phpt   
(rev 0)
+++ php/php-src/branches/PHP_5_2/ext/mbstring/tests/bug48697.phpt   
2009-09-14 04:11:29 UTC (rev 288301)
@@ -0,0 +1,24 @@
+--TEST--
+Bug #48697 (mb_internal_encoding() value gets reset by parse_str()
+--SKIPIF--
+?php extension_loaded('mbstring') or die('skip mbstring not available'); ?
+--FILE--
+?php
+ini_set('mbstring.internal_encoding', 'ISO-8859-15');
+ini_set('mbstring.encoding_translation', true);
+var_dump(mb_internal_encoding());
+mb_internal_encoding('UTF-8');
+var_dump(mb_internal_encoding());
+parse_str('a=b');
+var_dump(mb_internal_encoding());
+mb_internal_encoding('UTF-8');
+var_dump(mb_internal_encoding());
+parse_str('a=b');
+var_dump(mb_internal_encoding());
+?
+--EXPECT--
+string(11) ISO-8859-15
+string(5) UTF-8
+string(5) UTF-8
+string(5) UTF-8
+string(5) UTF-8

Added: php/php-src/branches/PHP_5_3/ext/mbstring/tests/bug48697.phpt
===
--- php/php-src/branches/PHP_5_3/ext/mbstring/tests/bug48697.phpt   
(rev 0)
+++ php/php-src/branches/PHP_5_3/ext/mbstring/tests/bug48697.phpt   
2009-09-14 04:11:29 UTC (rev 288301)
@@ -0,0 +1,24 @@
+--TEST--
+Bug #48697 (mb_internal_encoding() value gets reset by parse_str() or 
mb_parse_str()
+--SKIPIF--
+?php extension_loaded('mbstring') or die('skip mbstring not available'); ?
+--FILE--
+?php
+ini_set('mbstring.internal_encoding', 'ISO-8859-15');
+ini_set('mbstring.encoding_translation', true);
+var_dump(mb_internal_encoding());
+mb_internal_encoding('UTF-8');
+var_dump(mb_internal_encoding());
+parse_str('a=b');
+var_dump(mb_internal_encoding());
+mb_internal_encoding('UTF-8');
+var_dump(mb_internal_encoding());
+parse_str('a=b');
+var_dump(mb_internal_encoding());
+?
+--EXPECT--
+string(11) ISO-8859-15
+string(5) UTF-8
+string(5) UTF-8
+string(5) UTF-8
+string(5) UTF-8

Added: php/php-src/trunk/ext/mbstring/tests/bug48697.phpt
===
--- php/php-src/trunk/ext/mbstring/tests/bug48697.phpt  
(rev 0)
+++ php/php-src/trunk/ext/mbstring/tests/bug48697.phpt  2009-09-14 04:11:29 UTC 
(rev 288301)
@@ -0,0 +1,24 @@
+--TEST--
+Bug #48697 (mb_internal_encoding() value gets reset by parse_str() or 
mb_parse_str()
+--SKIPIF--
+?php extension_loaded('mbstring') or die('skip mbstring not available'); ?
+--FILE--
+?php
+ini_set('mbstring.internal_encoding', 'ISO-8859-15');
+ini_set('mbstring.encoding_translation', true);
+var_dump(mb_internal_encoding());
+mb_internal_encoding('UTF-8');
+var_dump(mb_internal_encoding());
+parse_str('a=b');
+var_dump(mb_internal_encoding());
+mb_internal_encoding('UTF-8');
+var_dump(mb_internal_encoding());
+parse_str('a=b');
+var_dump(mb_internal_encoding());
+?
+--EXPECT--
+string(11) ISO-8859-15
+string(5) UTF-8
+string(5) UTF-8
+string(5) UTF-8
+string(5) UTF-8

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_utf16.c branches/PHP_5_3/ext/mbstring/tests/bug49528.phpt trunk/ext/mbstring/libmbfl/filters/mbfilter_utf16.c trunk/

2009-09-11 Thread Moriyoshi Koizumi
moriyoshiFri, 11 Sep 2009 08:22:19 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=288260

Log:
- Fix bug #49528 (UTF-16 strings prefixed by BOM wrongly converted).

Bug: http://bugs.php.net/49528 (Assigned) UTF-16 strings prefixed by BOMs 
wrondly converted
  
Changed paths:
U   
php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_utf16.c
A   php/php-src/branches/PHP_5_3/ext/mbstring/tests/bug49528.phpt
U   php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf16.c
A   php/php-src/trunk/ext/mbstring/tests/bug49528.phpt

Modified: 
php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_utf16.c
===
--- php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_utf16.c  
2009-09-11 06:43:09 UTC (rev 288259)
+++ php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_utf16.c  
2009-09-11 08:22:19 UTC (rev 288260)
@@ -127,7 +127,7 @@
int n, endian;

endian = filter-status  0xff00;
-   switch (filter-status  0xff) {
+   switch (filter-status  0x0f) {
case 0:
if (endian) {
n = c  0xff;
@@ -144,15 +144,8 @@
n = c  0xff;
}
n |= filter-cache  0x;
-   filter-status = ~0xff;
-   if (n == 0xfffe) {
-   if (endian) {
-   filter-status = 0; /* big-endian */
-   } else {
-   filter-status = 0x100; /* 
little-endian */
-   }
-   CK((*filter-output_function)(0xfeff, filter-data));
-   } else if (n = 0xd800  n  0xdc00) {
+   filter-status = ~0x0f;
+   if (n = 0xd800  n  0xdc00) {
filter-cache = ((n  0x3ff)  16) + 0x40;
} else if (n = 0xdc00  n  0xe000) {
n = 0x3ff;
@@ -166,7 +159,21 @@
CK((*filter-output_function)(n, filter-data));
}
} else {
+   int is_first = filter-status  0x10;
filter-cache = 0;
+   filter-status |= 0x10;
+   if (!is_first) {
+   if (n == 0xfffe) {
+   if (endian) {
+   filter-status = ~0x100;   
/* big-endian */
+   } else {
+   filter-status |= 0x100;
/* little-endian */
+   }
+   break;
+   } else if (n == 0xfeff) {
+   break;
+   }
+   }
CK((*filter-output_function)(n, filter-data));
}
break;

Added: php/php-src/branches/PHP_5_3/ext/mbstring/tests/bug49528.phpt
===
--- php/php-src/branches/PHP_5_3/ext/mbstring/tests/bug49528.phpt   
(rev 0)
+++ php/php-src/branches/PHP_5_3/ext/mbstring/tests/bug49528.phpt   
2009-09-11 08:22:19 UTC (rev 288260)
@@ -0,0 +1,20 @@
+--TEST--
+Bug #49528 (UTF-16 strings prefixed by BOM wrongly converted)
+--SKIPIF--
+?php extension_loaded('mbstring') or die('skip mbstring not available'); ?
+--FILE--
+?php
+var_dump(bin2hex(mb_convert_encoding(\xff\xfe\x01\x02\x03\x04, UCS-2BE, 
UTF-16)));
+var_dump(bin2hex(mb_convert_encoding(\xfe\xff\x01\x02\x03\x04, UCS-2BE, 
UTF-16)));
+var_dump(bin2hex(mb_convert_encoding(\xff\xfe\xff\xfe\x01\x02\x03\x04, 
UCS-2BE, UTF-16)));
+var_dump(bin2hex(mb_convert_encoding(\xff\xfe\xfe\xff\x01\x02\x03\x04, 
UCS-2BE, UTF-16)));
+var_dump(bin2hex(mb_convert_encoding(\xfe\xff\xff\xfe\x01\x02\x03\x04, 
UCS-2BE, UTF-16)));
+var_dump(bin2hex(mb_convert_encoding(\xfe\xff\xfe\xff\x01\x02\x03\x04, 
UCS-2BE, UTF-16)));
+?
+--EXPECT--
+string(8) 02010403
+string(8) 01020304
+string(12) feff02010403
+string(12) fffe02010403
+string(12) fffe01020304
+string(12) feff01020304

Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf16.c
===
--- php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf16.c 
2009-09-11 06:43:09 UTC (rev 288259)
+++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf16.c 
2009-09-11 08:22:19 UTC (rev 288260)
@@ -127,7 +127,7 @@
int n, endian;

endian = filter-status  0xff00;
-   switch (filter-status  0xff) {
+   switch (filter-status  0x0f) {
case 0:
if (endian) {
n = c  0xff;

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_utf8.c branches/PHP_5_3/ext/mbstring/libmbfl/mbfl/mbfilter.c branches/PHP_5_3/ext/mbstring/tests/bug49536.phpt trunk

2009-09-11 Thread Moriyoshi Koizumi
moriyoshiFri, 11 Sep 2009 21:26:18 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=288273

Log:
- Fix bug #49536 (mb_detect_encoding() returns incorrect results when 
strict_mode is turned on.)
  (patch by komura, thanks!)

Bug: http://bugs.php.net/49536 (Open) mb_detect_encoding() returns incorrect 
results when strict_mode is turned on
  
Changed paths:
U   
php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_utf8.c
U   php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/mbfl/mbfilter.c
A   php/php-src/branches/PHP_5_3/ext/mbstring/tests/bug49536.phpt
U   php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8.c
U   php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfilter.c
A   php/php-src/trunk/ext/mbstring/tests/bug49536.phpt

Modified: 
php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_utf8.c
===
--- php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_utf8.c   
2009-09-11 16:43:49 UTC (rev 288272)
+++ php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_utf8.c   
2009-09-11 21:26:18 UTC (rev 288273)
@@ -220,7 +220,7 @@
if (c  0x80) {
if (c  0) {
filter-flag = 1;   /* bad */
-   } else if (c != 0  filter-status) {
+   } else if (filter-status) {
filter-flag = 1;   /* bad */
}
filter-status = 0;

Modified: php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/mbfl/mbfilter.c
===
--- php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/mbfl/mbfilter.c   
2009-09-11 16:43:49 UTC (rev 288272)
+++ php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/mbfl/mbfilter.c   
2009-09-11 21:26:18 UTC (rev 288273)
@@ -622,7 +622,7 @@
if (!encoding) {
for (i = 0; i  num; i++) {
filter = flist[i];
-   if (!filter-flag) {
+   if (!filter-flag  (!strict || !filter-status)) {
encoding = filter-encoding;
break;
}

Added: php/php-src/branches/PHP_5_3/ext/mbstring/tests/bug49536.phpt
===
--- php/php-src/branches/PHP_5_3/ext/mbstring/tests/bug49536.phpt   
(rev 0)
+++ php/php-src/branches/PHP_5_3/ext/mbstring/tests/bug49536.phpt   
2009-09-11 21:26:18 UTC (rev 288273)
@@ -0,0 +1,20 @@
+--TEST--
+Bug #49536 (mb_detect_encoding() returns incorrect results when strict_mode is 
turned on)
+--SKIPIF--
+?php extension_loaded('mbstring') or die('skip mbstring not available'); ?
+--FILE--
+?php
+// non-strict mode
+var_dump(mb_detect_encoding(A\x81, SJIS, false));
+// strict mode
+var_dump(mb_detect_encoding(A\x81, SJIS, true));
+// non-strict mode
+var_dump(mb_detect_encoding(\xc0\x00, UTF-8, false));
+// strict mode
+var_dump(mb_detect_encoding(\xc0\x00, UTF-8, true));
+?
+--EXPECT--
+string(4) SJIS
+bool(false)
+string(5) UTF-8
+bool(false)

Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8.c
===
--- php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8.c  
2009-09-11 16:43:49 UTC (rev 288272)
+++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8.c  
2009-09-11 21:26:18 UTC (rev 288273)
@@ -220,7 +220,7 @@
if (c  0x80) {
if (c  0) {
filter-flag = 1;   /* bad */
-   } else if (c != 0  filter-status) {
+   } else if (filter-status) {
filter-flag = 1;   /* bad */
}
filter-status = 0;

Modified: php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfilter.c
===
--- php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfilter.c  2009-09-11 
16:43:49 UTC (rev 288272)
+++ php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfilter.c  2009-09-11 
21:26:18 UTC (rev 288273)
@@ -622,7 +622,7 @@
if (!encoding) {
for (i = 0; i  num; i++) {
filter = flist[i];
-   if (!filter-flag) {
+   if (!filter-flag  (!strict || !filter-status)) {
encoding = filter-encoding;
break;
}

Added: php/php-src/trunk/ext/mbstring/tests/bug49536.phpt
===
--- php/php-src/trunk/ext/mbstring/tests/bug49536.phpt  
(rev 0)
+++ php/php-src/trunk/ext/mbstring/tests/bug49536.phpt  2009-09-11 21:26:18 UTC 
(rev 288273)
@@ -0,0 +1,20 @@
+--TEST--
+Bug #49536 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/Zend/zend.h branches/PHP_5_3/Zend/zend.h trunk/Zend/zend.h

2009-09-06 Thread Moriyoshi Koizumi
moriyoshiSun, 06 Sep 2009 14:43:09 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=288109

Log:
- Fix leaks.

Changed paths:
U   php/php-src/branches/PHP_5_2/Zend/zend.h
U   php/php-src/branches/PHP_5_3/Zend/zend.h
U   php/php-src/trunk/Zend/zend.h

Modified: php/php-src/branches/PHP_5_2/Zend/zend.h
===
--- php/php-src/branches/PHP_5_2/Zend/zend.h2009-09-06 14:34:21 UTC (rev 
288108)
+++ php/php-src/branches/PHP_5_2/Zend/zend.h2009-09-06 14:43:09 UTC (rev 
288109)
@@ -200,8 +200,8 @@
 # define do_alloca(p)  emalloc(p)
 # define free_alloca(p)efree(p)
 # define ALLOCA_FLAG(name)
-# define do_alloca_with_limit(p, use_heap) emalloc(p)
-# define free_alloca_with_limit(p, use_heap)   efree(p)
+# define do_alloca_with_limit(p, use_heap) emalloc(p), use_heap = 1
+# define free_alloca_with_limit(p, use_heap)   efree(p), use_heap = 1
 #endif

 #if ZEND_DEBUG

Modified: php/php-src/branches/PHP_5_3/Zend/zend.h
===
--- php/php-src/branches/PHP_5_3/Zend/zend.h2009-09-06 14:34:21 UTC (rev 
288108)
+++ php/php-src/branches/PHP_5_3/Zend/zend.h2009-09-06 14:43:09 UTC (rev 
288109)
@@ -195,8 +195,8 @@
 #else
 # define ALLOCA_FLAG(name)
 # define SET_ALLOCA_FLAG(name)
-# define do_alloca(p, use_heap)emalloc(p)
-# define free_alloca(p, use_heap)  efree(p)
+# define do_alloca(p, use_heap)emalloc(p), use_heap = 1
+# define free_alloca(p, use_heap)  efree(p), use_heap = 1
 #endif

 #if ZEND_DEBUG

Modified: php/php-src/trunk/Zend/zend.h
===
--- php/php-src/trunk/Zend/zend.h   2009-09-06 14:34:21 UTC (rev 288108)
+++ php/php-src/trunk/Zend/zend.h   2009-09-06 14:43:09 UTC (rev 288109)
@@ -196,8 +196,8 @@
 #else
 # define ALLOCA_FLAG(name)
 # define SET_ALLOCA_FLAG(name)
-# define do_alloca(p, use_heap)emalloc(p)
-# define free_alloca(p, use_heap)  efree(p)
+# define do_alloca(p, use_heap)emalloc(p), use_heap = 1
+# define free_alloca(p, use_heap)  efree(p), use_heap = 1
 #endif

 #if ZEND_DEBUG

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

Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/Zend/zend.h branches/PHP_5_3/Zend/zend.h trunk/Zend/zend.h

2009-09-06 Thread Moriyoshi Koizumi
Ok, I just figured out now. I'm gonna revert'em shortly

Moriyoshi

On Mon, Sep 7, 2009 at 1:02 AM, Moriyoshi Koizumim...@mozo.jp wrote:
 Hi,

 Obviously use_heap has to be set to true whenever the heap is used.
 Doesn't it? The problem only occurs on Mac OS X and I noticed this
 during developing an extension that is just a private one.

 Moriyoshi

 On Sun, Sep 6, 2009 at 11:55 PM, Pierre Joyepierre@gmail.com wrote:
 Hi,

 This change breaks the build, sounds wrong and I did not see any leak
 in there. Do you have a test case to reproduce the leak you are trying
 to fix?

 In the mean time, please revert this change.

 On Sun, Sep 6, 2009 at 4:43 PM, Moriyoshi Koizumimoriyo...@php.net wrote:
 moriyoshi                                Sun, 06 Sep 2009 14:43:09 +

 Revision: http://svn.php.net/viewvc?view=revisionrevision=288109

 Log:
 - Fix leaks.

 Changed paths:
    U   php/php-src/branches/PHP_5_2/Zend/zend.h
    U   php/php-src/branches/PHP_5_3/Zend/zend.h
    U   php/php-src/trunk/Zend/zend.h

 Modified: php/php-src/branches/PHP_5_2/Zend/zend.h
 ===
 --- php/php-src/branches/PHP_5_2/Zend/zend.h    2009-09-06 14:34:21 UTC 
 (rev 288108)
 +++ php/php-src/branches/PHP_5_2/Zend/zend.h    2009-09-06 14:43:09 UTC 
 (rev 288109)
 @@ -200,8 +200,8 @@
  # define do_alloca(p)          emalloc(p)
  # define free_alloca(p)        efree(p)
  # define ALLOCA_FLAG(name)
 -# define do_alloca_with_limit(p, use_heap)             emalloc(p)
 -# define free_alloca_with_limit(p, use_heap)   efree(p)
 +# define do_alloca_with_limit(p, use_heap)             emalloc(p), 
 use_heap = 1
 +# define free_alloca_with_limit(p, use_heap)   efree(p), use_heap = 1
  #endif

  #if ZEND_DEBUG

 Modified: php/php-src/branches/PHP_5_3/Zend/zend.h
 ===
 --- php/php-src/branches/PHP_5_3/Zend/zend.h    2009-09-06 14:34:21 UTC 
 (rev 288108)
 +++ php/php-src/branches/PHP_5_3/Zend/zend.h    2009-09-06 14:43:09 UTC 
 (rev 288109)
 @@ -195,8 +195,8 @@
  #else
  # define ALLOCA_FLAG(name)
  # define SET_ALLOCA_FLAG(name)
 -# define do_alloca(p, use_heap)                emalloc(p)
 -# define free_alloca(p, use_heap)      efree(p)
 +# define do_alloca(p, use_heap)                emalloc(p), use_heap = 1
 +# define free_alloca(p, use_heap)      efree(p), use_heap = 1
  #endif

  #if ZEND_DEBUG

 Modified: php/php-src/trunk/Zend/zend.h
 ===
 --- php/php-src/trunk/Zend/zend.h       2009-09-06 14:34:21 UTC (rev 288108)
 +++ php/php-src/trunk/Zend/zend.h       2009-09-06 14:43:09 UTC (rev 288109)
 @@ -196,8 +196,8 @@
  #else
  # define ALLOCA_FLAG(name)
  # define SET_ALLOCA_FLAG(name)
 -# define do_alloca(p, use_heap)                emalloc(p)
 -# define free_alloca(p, use_heap)      efree(p)
 +# define do_alloca(p, use_heap)                emalloc(p), use_heap = 1
 +# define free_alloca(p, use_heap)      efree(p), use_heap = 1
  #endif

  #if ZEND_DEBUG


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




 --
 Pierre

 http://blog.thepimp.net | http://www.libgd.org

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




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



Re: [PHP-CVS] svn: /php/php-src/branches/PHP_5_2/ext/iconv/tests/ iconv_stream_filter_delimiter.phpt

2009-07-28 Thread Moriyoshi Koizumi
Huh? I guess this was added to 5.2 as well, and I don't think it got
reverted at some point.

Moriyoshi

On Tue, Jul 28, 2009 at 8:08 AM, Rasmus Lerdorfras...@php.net wrote:
 rasmus                                   Mon, 27 Jul 2009 23:08:23 +

 Revision: http://svn.php.net/viewvc?view=revisionrevision=286431

 Log:
 We don't support . as a delimiter here in PHP 5.2.  Support was added in 5.3

 Changed paths:
    U   
 php/php-src/branches/PHP_5_2/ext/iconv/tests/iconv_stream_filter_delimiter.phpt

 Modified: 
 php/php-src/branches/PHP_5_2/ext/iconv/tests/iconv_stream_filter_delimiter.phpt
 ===
 --- 
 php/php-src/branches/PHP_5_2/ext/iconv/tests/iconv_stream_filter_delimiter.phpt
      2009-07-27 22:12:35 UTC (rev 286430)
 +++ 
 php/php-src/branches/PHP_5_2/ext/iconv/tests/iconv_stream_filter_delimiter.phpt
      2009-07-27 23:08:23 UTC (rev 286431)
 @@ -40,10 +40,12 @@
  string(20) a4b3a4f3a4cba4c1a4cf
  string(10) 69636f6e76
  string(2) 0a
 -string(20) a4b3a4f3a4cba4c1a4cf
 -string(10) 69636f6e76
 -string(2) 0a

 +Warning: stream_filter_append(): unable to create or locate filter 
 convert.iconv.ISO-2022-JP.EUC-JP in %s/iconv_stream_filter_delimiter.php on 
 line %d
 +string(20) 1b244224332473244b24
 +string(10) 41244f1b28
 +string(2) 42
 +
  Warning: stream_filter_append(): unable to create or locate filter 
 convert.iconv.ISO-2022-JP\0EUC-JP in %s/iconv_stream_filter_delimiter.php 
 on line %d
  string(20) 1b244224332473244b24
  string(10) 41244f1b28


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


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



Re: [PHP-CVS] svn: /php/php-src/branches/PHP_5_2/ext/iconv/tests/ iconv_stream_filter_delimiter.phpt

2009-07-28 Thread Moriyoshi Koizumi
Hmm.. it should have been there. I'm gonna fix it then. Sorry for bothering you.

Moriyoshi

On Tue, Jul 28, 2009 at 5:40 PM, Rasmus Lerdorfras...@lerdorf.com wrote:
 I don't see the code in 5.2.

 Look at the php_iconv_stream_filter_factory_create() function in iconv.c
 On line 2787 in 5.2 it says:

    if ((to_charset = strchr(from_charset, '/')) == NULL) {

 In the same function in 5.3 it says:

    if ((to_charset = strpbrk(from_charset, /.)) == NULL) {

 Unless I am completely reading the code wrong, '.' is not supporrted in
 5.2, and since the test case is failing on the . separator the test
 seems to agree.

 -Rasmus


 Moriyoshi Koizumi wrote:
 Huh? I guess this was added to 5.2 as well, and I don't think it got
 reverted at some point.

 Moriyoshi

 On Tue, Jul 28, 2009 at 8:08 AM, Rasmus Lerdorfras...@php.net wrote:
 rasmus                                   Mon, 27 Jul 2009 23:08:23 +

 Revision: http://svn.php.net/viewvc?view=revisionrevision=286431

 Log:
 We don't support . as a delimiter here in PHP 5.2.  Support was added in 5.3

 Changed paths:
    U   
 php/php-src/branches/PHP_5_2/ext/iconv/tests/iconv_stream_filter_delimiter.phpt

 Modified: 
 php/php-src/branches/PHP_5_2/ext/iconv/tests/iconv_stream_filter_delimiter.phpt
 ===
 --- 
 php/php-src/branches/PHP_5_2/ext/iconv/tests/iconv_stream_filter_delimiter.phpt
      2009-07-27 22:12:35 UTC (rev 286430)
 +++ 
 php/php-src/branches/PHP_5_2/ext/iconv/tests/iconv_stream_filter_delimiter.phpt
      2009-07-27 23:08:23 UTC (rev 286431)
 @@ -40,10 +40,12 @@
  string(20) a4b3a4f3a4cba4c1a4cf
  string(10) 69636f6e76
  string(2) 0a
 -string(20) a4b3a4f3a4cba4c1a4cf
 -string(10) 69636f6e76
 -string(2) 0a

 +Warning: stream_filter_append(): unable to create or locate filter 
 convert.iconv.ISO-2022-JP.EUC-JP in %s/iconv_stream_filter_delimiter.php 
 on line %d
 +string(20) 1b244224332473244b24
 +string(10) 41244f1b28
 +string(2) 42
 +
  Warning: stream_filter_append(): unable to create or locate filter 
 convert.iconv.ISO-2022-JP\0EUC-JP in %s/iconv_stream_filter_delimiter.php 
 on line %d
  string(20) 1b244224332473244b24
  string(10) 41244f1b28


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




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



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



[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/NEWS branches/PHP_5_2/ext/mbstring/libmbfl/filters/mbfilter_htmlent.c branches/PHP_5_2/ext/mbstring/tests/bug48645.phpt branches/PHP_5_3/ext/mbstring/libm

2009-07-28 Thread Moriyoshi Koizumi
moriyoshiWed, 29 Jul 2009 04:44:08 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=286483

Log:
* Fix bug #48645 (mb_convert_encoding() doesn't understand hexadecimal 
html-entities)

Bug: http://bugs.php.net/48645 (Assigned) mb_convert_encoding() doesn't 
understand hexadecimal html-entities
  
Changed paths:
_U  php/php-src/branches/PHP_5_2/
U   php/php-src/branches/PHP_5_2/NEWS
U   
php/php-src/branches/PHP_5_2/ext/mbstring/libmbfl/filters/mbfilter_htmlent.c
A   php/php-src/branches/PHP_5_2/ext/mbstring/tests/bug48645.phpt
_U  php/php-src/branches/PHP_5_3/
U   
php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/mbfilter_htmlent.c
A   php/php-src/branches/PHP_5_3/ext/mbstring/tests/bug48645.phpt
U   php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_htmlent.c
A   php/php-src/trunk/ext/mbstring/tests/bug48645.phpt


Property changes on: php/php-src/branches/PHP_5_2
___
Modified: svn:mergeinfo
   - /php/php-src/branches/PHP_5_3:284120
   + /php/php-src/branches/PHP_5_3:284120
/php/php-src/trunk:284726

Modified: php/php-src/branches/PHP_5_2/NEWS
===
--- php/php-src/branches/PHP_5_2/NEWS	2009-07-29 04:29:30 UTC (rev 286482)
+++ php/php-src/branches/PHP_5_2/NEWS	2009-07-29 04:44:08 UTC (rev 286483)
@@ -1,6 +1,7 @@
 PHPNEWS
 |||
 ?? ??? 2009, PHP 5.2.11
+- Fixed bug #48645 (mb_convert_encoding() doesn't understand hexadecimal html-entities). (Moriyoshi)
 - Fixed regression in cURL extension that prevented flush of data to output
   defined as a file handle. (Ilia)


Modified: php/php-src/branches/PHP_5_2/ext/mbstring/libmbfl/filters/mbfilter_htmlent.c
===
--- php/php-src/branches/PHP_5_2/ext/mbstring/libmbfl/filters/mbfilter_htmlent.c	2009-07-29 04:29:30 UTC (rev 286482)
+++ php/php-src/branches/PHP_5_2/ext/mbstring/libmbfl/filters/mbfilter_htmlent.c	2009-07-29 04:44:08 UTC (rev 286483)
@@ -186,18 +186,58 @@
 		}
 	} else {
 		if (c == ';') {
-			buffer[filter-status] = 0;
 			if (buffer[1]=='#') {
-/* numeric entity */
-for (pos=2; posfilter-status; pos++) {
-	ent = ent*10 + (buffer[pos] - '0');
+if (filter-status  2  (buffer[2] == 'x' || buffer[2] == 'X')) {
+	if (filter-status  3) {
+		/* numeric entity */
+		for (pos=3; posfilter-status; pos++) {
+			int v =  buffer[pos];
+			if (v = '0'  v = '9') {
+v = v - '0';
+			} else if (v = 'A'  v = 'F') {
+v = v - 'A' + 10;
+			} else if (v = 'a'  v = 'f') {
+v = v - 'a' + 10;
+			} else {
+ent = -1;
+break;
+			}
+			ent = ent * 16 + v;
+		}
+	} else {
+		ent = -1;
+	}
+} else {
+	/* numeric entity */
+	if (filter-status  2) {
+		for (pos=2; posfilter-status; pos++) {
+			int v = buffer[pos];
+			if (v = '0'  v = '9') {
+v = v - '0';
+			} else {
+ent = -1;
+break;
+			}
+			ent = ent*10 + v;
+		}
+	} else {
+		ent = -1;
+	}
 }
-CK((*filter-output_function)(ent, filter-data));
+if (ent = 0  ent  0x11) {
+	CK((*filter-output_function)(ent, filter-data));
+} else {
+	for (pos = 0; pos  filter-status; pos++) {
+		CK((*filter-output_function)(buffer[pos], filter-data));
+	}
+	CK((*filter-output_function)(c, filter-data));
+}
 filter-status = 0;
 /*php_error_docref(ref.mbstring TSRMLS_CC, E_NOTICE, mbstring decoded '%s'=%d, buffer, ent);*/
 			} else {
 /* named entity */
-			entity = (mbfl_html_entity_entry *)mbfl_html_entity_list;
+buffer[filter-status] = 0;
+entity = (mbfl_html_entity_entry *)mbfl_html_entity_list;
 while (entity-name) {
 	if (!strcmp(buffer+1, entity-name))	{
 		ent = entity-code;

Added: php/php-src/branches/PHP_5_2/ext/mbstring/tests/bug48645.phpt
===
--- php/php-src/branches/PHP_5_2/ext/mbstring/tests/bug48645.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_2/ext/mbstring/tests/bug48645.phpt	2009-07-29 04:44:08 UTC (rev 286483)
@@ -0,0 +1,162 @@
+--TEST--
+Bug #48645 (mb_convert_encoding() doesn't understand hexadecimal html-entities)
+--SKIPIF--
+?php extension_loaded('mbstring') or die('skip mbstring not available'); ?
+--FILE--
+?php
+var_dump(bin2hex(mb_convert_encoding(#x0;, UTF-8, HTML-ENTITIES)));
+var_dump(bin2hex(mb_convert_encoding(#x1;, UTF-8, HTML-ENTITIES)));
+var_dump(bin2hex(mb_convert_encoding(#x2;, UTF-8, HTML-ENTITIES)));
+var_dump(bin2hex(mb_convert_encoding(#x3;, UTF-8, HTML-ENTITIES)));
+var_dump(bin2hex(mb_convert_encoding(#x4;, UTF-8, 

[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/ mb_gpc.c

2009-07-24 Thread Moriyoshi Koizumi
moriyoshiFri, 24 Jul 2009 23:44:43 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=284726

Log:
- Probably harmless, but it should have been done this way.

Changed paths:
U   php/php-src/trunk/ext/mbstring/mb_gpc.c

Modified: php/php-src/trunk/ext/mbstring/mb_gpc.c
===
--- php/php-src/trunk/ext/mbstring/mb_gpc.c 2009-07-24 23:01:22 UTC (rev 
284725)
+++ php/php-src/trunk/ext/mbstring/mb_gpc.c 2009-07-24 23:44:43 UTC (rev 
284726)
@@ -59,7 +59,7 @@
enum mbfl_no_encoding detected;
php_mb_encoding_handler_info_t info;

-   {
+   if (arg != PARSE_STRING) {
char *value = zend_ini_string(mbstring.internal_encoding, 
sizeof(mbstring.internal_encoding), 0);
_php_mb_ini_mbstring_internal_encoding_set(value, value ? 
strlen(value): 0 TSRMLS_CC);
}

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

[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ext/mbstring/ mb_gpc.c

2009-07-24 Thread Moriyoshi Koizumi
moriyoshiFri, 24 Jul 2009 23:48:58 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=284727

Log:
- MFH (using svn merge; it seems I won't need to repeat the commit message 
anymore)

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/mbstring/mb_gpc.c

Modified: php/php-src/branches/PHP_5_3/ext/mbstring/mb_gpc.c
===
--- php/php-src/branches/PHP_5_3/ext/mbstring/mb_gpc.c  2009-07-24 23:44:43 UTC 
(rev 284726)
+++ php/php-src/branches/PHP_5_3/ext/mbstring/mb_gpc.c  2009-07-24 23:48:58 UTC 
(rev 284727)
@@ -59,7 +59,7 @@
enum mbfl_no_encoding detected;
php_mb_encoding_handler_info_t info;

-   {
+   if (arg != PARSE_STRING) {
char *value = zend_ini_string(mbstring.internal_encoding, 
sizeof(mbstring.internal_encoding), 0);
_php_mb_ini_mbstring_internal_encoding_set(value, value ? 
strlen(value): 0 TSRMLS_CC);
}

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

[PHP-CVS] svn: /php/php-src/branches/PHP_5_2/ext/mbstring/ mb_gpc.c

2009-07-24 Thread Moriyoshi Koizumi
moriyoshiFri, 24 Jul 2009 23:50:12 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=284728

Log:
- MFH

Changed paths:
U   php/php-src/branches/PHP_5_2/ext/mbstring/mb_gpc.c

Modified: php/php-src/branches/PHP_5_2/ext/mbstring/mb_gpc.c
===
--- php/php-src/branches/PHP_5_2/ext/mbstring/mb_gpc.c  2009-07-24 23:48:58 UTC 
(rev 284727)
+++ php/php-src/branches/PHP_5_2/ext/mbstring/mb_gpc.c  2009-07-24 23:50:12 UTC 
(rev 284728)
@@ -59,7 +59,7 @@
enum mbfl_no_encoding detected;
php_mb_encoding_handler_info_t info;

-   {
+   if (arg != PARSE_STRING) {
char *value = zend_ini_string(mbstring.internal_encoding, 
sizeof(mbstring.internal_encoding), 0);
_php_mb_ini_mbstring_internal_encoding_set(value, value ? 
strlen(value): 0 TSRMLS_CC);
}

-- 
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

2009-05-15 Thread Moriyoshi Koizumi
moriyoshi   Fri May 15 17:02:35 2009 UTC

  Modified files:  
/php-src/ext/standard   array.c 
  Log:
  * Roll it back then.  I wonder if defaulting it to SORT_REGULAR would work 
well
and I think allowing user-supplied comparator should make more sense when it
comes to objects.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.477r2=1.478diff_format=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.477 php-src/ext/standard/array.c:1.478
--- php-src/ext/standard/array.c:1.477  Fri May 15 16:44:51 2009
+++ php-src/ext/standard/array.cFri May 15 17:02:34 2009
@@ -21,7 +21,7 @@
+--+
 */
 
-/* $Id: array.c,v 1.477 2009/05/15 16:44:51 sixd Exp $ */
+/* $Id: array.c,v 1.478 2009/05/15 17:02:34 moriyoshi Exp $ */
 
 #include php.h
 #include php_ini.h
@@ -2889,7 +2889,7 @@
};
struct bucketindex *arTmp, *cmpdata, *lastkept;
unsigned int i;
-   long sort_type = PHP_SORT_REGULAR;
+   long sort_type = PHP_SORT_STRING;
 
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, a|l, array, 
sort_type) == 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/standard array.c

2009-05-15 Thread Moriyoshi Koizumi
moriyoshi   Fri May 15 17:03:03 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   array.c 
  Log:
  * MFH: Roll it back.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.308.2.21.2.37.2.55r2=1.308.2.21.2.37.2.56diff_format=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.308.2.21.2.37.2.55 
php-src/ext/standard/array.c:1.308.2.21.2.37.2.56
--- php-src/ext/standard/array.c:1.308.2.21.2.37.2.55   Fri May 15 16:46:22 2009
+++ php-src/ext/standard/array.cFri May 15 17:03:03 2009
@@ -21,7 +21,7 @@
+--+
 */
 
-/* $Id: array.c,v 1.308.2.21.2.37.2.55 2009/05/15 16:46:22 sixd Exp $ */
+/* $Id: array.c,v 1.308.2.21.2.37.2.56 2009/05/15 17:03:03 moriyoshi Exp $ */
 
 #include php.h
 #include php_ini.h
@@ -2697,7 +2697,7 @@
};
struct bucketindex *arTmp, *cmpdata, *lastkept;
unsigned int i;
-   long sort_type = PHP_SORT_REGULAR;
+   long sort_type = PHP_SORT_STRING;
 
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, a|l, array, 
sort_type) == 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_2) /ext/standard array.c

2009-05-15 Thread Moriyoshi Koizumi
moriyoshi   Fri May 15 17:03:43 2009 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard   array.c 
  Log:
  - MFH: Roll it back.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.308.2.21.2.66r2=1.308.2.21.2.67diff_format=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.308.2.21.2.66 
php-src/ext/standard/array.c:1.308.2.21.2.67
--- php-src/ext/standard/array.c:1.308.2.21.2.66Sun May 10 16:45:01 2009
+++ php-src/ext/standard/array.cFri May 15 17:03:43 2009
@@ -21,7 +21,7 @@
+--+
 */
 
-/* $Id: array.c,v 1.308.2.21.2.66 2009/05/10 16:45:01 colder Exp $ */
+/* $Id: array.c,v 1.308.2.21.2.67 2009/05/15 17:03:43 moriyoshi Exp $ */
 
 #include php.h
 #include php_ini.h
@@ -2839,7 +2839,7 @@
};
struct bucketindex *arTmp, *cmpdata, *lastkept;
unsigned int i;
-   long sort_type = SORT_REGULAR;
+   long sort_type = SORT_STRING;
 
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, Z|l, array, 
sort_type) == 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_2) / NEWS

2009-05-15 Thread Moriyoshi Koizumi
moriyoshi   Fri May 15 17:06:36 2009 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
  Log:
  - Not a news actually.
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1509r2=1.2027.2.547.2.1510diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1509 php-src/NEWS:1.2027.2.547.2.1510
--- php-src/NEWS:1.2027.2.547.2.1509Thu May 14 19:04:14 2009
+++ php-src/NEWSFri May 15 17:06:35 2009
@@ -3,6 +3,9 @@
 ?? ??? 2009, PHP 5.2.10
 - Updated timezone database to version 2009.7 (2009g) (Derick)
 
+- Reverted the default value of array_unique()'s sorting type flag parameter to
+  SORT_STRING for the sake of backwards compatibility. (Moriyoshi)
+
 - Added new CURL options CURLOPT_REDIR_PROTOCOLS, CURLOPT_PROTOCOLS,
   and CURLPROTO_* for redirect fixes in CURL 7.19.4. (Yoram Bar Haim, Stas)
 - Added support for Sun CC (FR #46595 and FR #46513). (David Soria Parra)



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

2009-05-15 Thread Moriyoshi Koizumi
Christopher Jones wrote:
 
 Are there any tests for this?

Do we really need one?

Moriyoshi

 Chris
 
 Moriyoshi Koizumi wrote:
 moriyoshiFri May 15 17:02:35 2009 UTC

   Modified files:  /php-src/ext/standardarray.c  
 Log:
   * Roll it back then.  I wonder if defaulting it to SORT_REGULAR
 would work well
 and I think allowing user-supplied comparator should make more
 sense when it
 comes to objects.

 http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.477r2=1.478diff_format=u

 Index: php-src/ext/standard/array.c
 diff -u php-src/ext/standard/array.c:1.477
 php-src/ext/standard/array.c:1.478
 --- php-src/ext/standard/array.c:1.477Fri May 15 16:44:51 2009
 +++ php-src/ext/standard/array.cFri May 15 17:02:34 2009
 @@ -21,7 +21,7 @@

 +--+
  */
  
 -/* $Id: array.c,v 1.477 2009/05/15 16:44:51 sixd Exp $ */
 +/* $Id: array.c,v 1.478 2009/05/15 17:02:34 moriyoshi Exp $ */
  
  #include php.h
  #include php_ini.h
 @@ -2889,7 +2889,7 @@
  };
  struct bucketindex *arTmp, *cmpdata, *lastkept;
  unsigned int i;
 -long sort_type = PHP_SORT_REGULAR;
 +long sort_type = PHP_SORT_STRING;
  
  if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, a|l,
 array, sort_type) == FAILURE) {
  return;



 


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

2009-05-15 Thread Moriyoshi Koizumi
Just to let you guys know no intention to offend here.  I just used it
in the sense Jani had corrected it to be.

Moriyoshi

Jani Taskinen wrote:
 jani  Fri May 15 17:18:18 2009 UTC
 
   Modified files:  (Branch: PHP_5_2)
 /php-src  NEWS 
   Log:
   - Reverted is such a strong word.. :)
   
 http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1510r2=1.2027.2.547.2.1511diff_format=u
 Index: php-src/NEWS
 diff -u php-src/NEWS:1.2027.2.547.2.1510 php-src/NEWS:1.2027.2.547.2.1511
 --- php-src/NEWS:1.2027.2.547.2.1510  Fri May 15 17:06:35 2009
 +++ php-src/NEWS  Fri May 15 17:18:18 2009
 @@ -3,8 +3,9 @@
  ?? ??? 2009, PHP 5.2.10
  - Updated timezone database to version 2009.7 (2009g) (Derick)
  
 -- Reverted the default value of array_unique()'s sorting type flag parameter 
 to
 -  SORT_STRING for the sake of backwards compatibility. (Moriyoshi)
 +- Changed default value of array_unique()'s optional sorting type parameter
 +  back to SORT_STRING to fix backwards compatibility breakage introduced in 
 +  PHP 5.2.9. (Moriyoshi)
  
  - Added new CURL options CURLOPT_REDIR_PROTOCOLS, CURLOPT_PROTOCOLS,
and CURLPROTO_* for redirect fixes in CURL 7.19.4. (Yoram Bar Haim, Stas)
 
 
 


-- 
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/tests iconv_stream_filter.phpt

2009-05-14 Thread Moriyoshi Koizumi
moriyoshi   Thu May 14 19:02:38 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/iconv/testsiconv_stream_filter.phpt 
  Log:
  - Update the test as newer libc gets the bogus input through rather than
rejecting it.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/iconv/tests/iconv_stream_filter.phpt?r1=1.2r2=1.2.8.1diff_format=u
Index: php-src/ext/iconv/tests/iconv_stream_filter.phpt
diff -u php-src/ext/iconv/tests/iconv_stream_filter.phpt:1.2 
php-src/ext/iconv/tests/iconv_stream_filter.phpt:1.2.8.1
--- php-src/ext/iconv/tests/iconv_stream_filter.phpt:1.2Fri Dec  5 
18:39:04 2003
+++ php-src/ext/iconv/tests/iconv_stream_filter.phptThu May 14 19:02:38 2009
@@ -22,9 +22,9 @@
 $fp = fopen(dirname(__FILE__).'/iconv_stream_filter.txt', 'rb');
 stream_filter_append($fp, 'string.rot13'); // this will make conversion fail.
 stream_filter_append($fp, 'convert.iconv.ISO-2022-JP/EUC-JP');
-var_dump(bin2hex(fread($fp, 10)));
-var_dump(bin2hex(fread($fp, 5)));
-var_dump(bin2hex(fread($fp, 1)));
+var_dump(bin2hex(fread($fp, 10)) != a4b3a4f3a4cba4c1a4cf);
+var_dump(bin2hex(fread($fp, 5)) != 69636f6e76);
+var_dump(bin2hex(fread($fp, 1)) != 0a);
 fclose($fp);
 ?
 --EXPECTF--
@@ -34,8 +34,6 @@
 string(20) a4b3a4f3a4cba4c1a4cf
 string(10) 69636f6e76
 string(2) 0a
-
-Warning: fread(): iconv stream filter (ISO-2022-JP=EUC-JP): invalid 
multibyte sequence in %s on line %d
-string(0) 
-string(0) 
-string(0) 
+bool(true)
+bool(true)
+bool(true)



-- 
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/tests iconv_stream_filter_delimiter.phpt

2009-05-14 Thread Moriyoshi Koizumi
moriyoshi   Thu May 14 19:06:20 2009 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/iconv/testsiconv_stream_filter_delimiter.phpt 
  Log:
  - Add a new test for the additional delimiter of the encoding conversion 
filter
  
  

http://cvs.php.net/viewvc.cgi/php-src/ext/iconv/tests/iconv_stream_filter_delimiter.phpt?view=markuprev=1.1
Index: php-src/ext/iconv/tests/iconv_stream_filter_delimiter.phpt
+++ php-src/ext/iconv/tests/iconv_stream_filter_delimiter.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) /ext/iconv/tests iconv_stream_filter.phpt

2009-05-14 Thread Moriyoshi Koizumi
moriyoshi   Thu May 14 19:07:18 2009 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/iconv/testsiconv_stream_filter.phpt 
  Log:
  - MFH: Update the test as newer libc gets the bogus input through rather than
  rejecting it.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/iconv/tests/iconv_stream_filter.phpt?r1=1.2r2=1.2.6.1diff_format=u
Index: php-src/ext/iconv/tests/iconv_stream_filter.phpt
diff -u php-src/ext/iconv/tests/iconv_stream_filter.phpt:1.2 
php-src/ext/iconv/tests/iconv_stream_filter.phpt:1.2.6.1
--- php-src/ext/iconv/tests/iconv_stream_filter.phpt:1.2Fri Dec  5 
18:39:04 2003
+++ php-src/ext/iconv/tests/iconv_stream_filter.phptThu May 14 19:07:18 2009
@@ -22,9 +22,9 @@
 $fp = fopen(dirname(__FILE__).'/iconv_stream_filter.txt', 'rb');
 stream_filter_append($fp, 'string.rot13'); // this will make conversion fail.
 stream_filter_append($fp, 'convert.iconv.ISO-2022-JP/EUC-JP');
-var_dump(bin2hex(fread($fp, 10)));
-var_dump(bin2hex(fread($fp, 5)));
-var_dump(bin2hex(fread($fp, 1)));
+var_dump(bin2hex(fread($fp, 10)) != a4b3a4f3a4cba4c1a4cf);
+var_dump(bin2hex(fread($fp, 5)) != 69636f6e76);
+var_dump(bin2hex(fread($fp, 1)) != 0a);
 fclose($fp);
 ?
 --EXPECTF--
@@ -34,8 +34,6 @@
 string(20) a4b3a4f3a4cba4c1a4cf
 string(10) 69636f6e76
 string(2) 0a
-
-Warning: fread(): iconv stream filter (ISO-2022-JP=EUC-JP): invalid 
multibyte sequence in %s on line %d
-string(0) 
-string(0) 
-string(0) 
+bool(true)
+bool(true)
+bool(true)



-- 
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) /ext/iconv/tests iconv_stream_filter_delimiter.phpt

2009-05-14 Thread Moriyoshi Koizumi
moriyoshi   Thu May 14 19:07:41 2009 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/iconv/testsiconv_stream_filter_delimiter.phpt 
  Log:
  - MFH:Add a new test for the additional delimiter of the encoding conversion
filter
  
  

http://cvs.php.net/viewvc.cgi/php-src/ext/iconv/tests/iconv_stream_filter_delimiter.phpt?view=markuprev=1.1
Index: php-src/ext/iconv/tests/iconv_stream_filter_delimiter.phpt
+++ php-src/ext/iconv/tests/iconv_stream_filter_delimiter.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) /ext/mbstring/tests mb_convert_encoding_stateful.phpt

2009-04-15 Thread Moriyoshi Koizumi
moriyoshi   Thu Apr 16 02:07:53 2009 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/mbstring/tests mb_convert_encoding_stateful.phpt 
  Log:
  - MFH: Just a paranoiac test.  This works perfectly.
  
  

http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/tests/mb_convert_encoding_stateful.phpt?view=markuprev=1.1
Index: php-src/ext/mbstring/tests/mb_convert_encoding_stateful.phpt
+++ php-src/ext/mbstring/tests/mb_convert_encoding_stateful.phpt
--TEST--
mb_convert_encoding() with stateful encodings
--SKIPIF--
?php extension_loaded('mbstring') or die('skip mbstring not available'); ?
--INI--
output_handler=
mbstring.language=Japanese
--FILE--
?php
echo ISO-2022-JP empty segment\n;
echo bin2hex(mb_convert_encoding(pack(H*, 1b24401b24402121), UTF-8, 
ISO-2022-JP)), \n;
echo bin2hex(mb_convert_encoding(pack(H*, 1b24421b24422121), UTF-8, 
ISO-2022-JP)), \n;
echo bin2hex(mb_convert_encoding(pack(H*, 1b28421b284261626364), UTF-8, 
ISO-2022-JP)), \n;
echo bin2hex(mb_convert_encoding(pack(H*, 1b284a1b284a61626364), UTF-8, 
ISO-2022-JP)), \n;
echo bin2hex(mb_convert_encoding(pack(H*, 1b24401b284261626364), UTF-8, 
ISO-2022-JP)), \n;
echo bin2hex(mb_convert_encoding(pack(H*, 1b24401b284a61626364), UTF-8, 
ISO-2022-JP)), \n;
echo bin2hex(mb_convert_encoding(pack(H*, 1b24421b284261626364), UTF-8, 
ISO-2022-JP)), \n;
echo bin2hex(mb_convert_encoding(pack(H*, 1b24421b284a61626364), UTF-8, 
ISO-2022-JP)), \n;
echo ISO-2022-KR empty segment\n;
echo bin2hex(mb_convert_encoding(pack(H*, 1b2429430e0f61626364), UTF-8, 
ISO-2022-KR)), \n;
echo HZ empty segment\n;
echo bin2hex(mb_convert_encoding(pack(H*, 7e7b7e7d61626364), UTF-8, 
HZ)), \n;
?
--EXPECT--
ISO-2022-JP empty segment
e38080
e38080
61626364
61626364
61626364
61626364
61626364
61626364
ISO-2022-KR empty segment
61626364
HZ empty segment
61626364



-- 
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_2) / NEWS /ext/mbstring/oniguruma regint.h /ext/sysvshm sysvshm.c

2009-03-24 Thread Moriyoshi Koizumi
Hey, we need to be more specific on what was the problem and what this
patch actually fixes; oniguruma is a third-party library and I really
don't think we'll be good at keeping up to upstream-updates with such
a site specific change.

Moriyoshi

2009/3/20 Ilia Alshanetsky il...@php.net:
 iliaa           Thu Mar 19 23:10:45 2009 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/mbstring/oniguruma     regint.h
    /php-src/ext/sysvshm        sysvshm.c
    /php-src    NEWS
  Log:

  Fixed bug #47721 (Aligment issues in mbstring and sysvshm extension)

 http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/oniguruma/regint.h?r1=1.5.4.7r2=1.5.4.8diff_format=u
 Index: php-src/ext/mbstring/oniguruma/regint.h
 diff -u php-src/ext/mbstring/oniguruma/regint.h:1.5.4.7 
 php-src/ext/mbstring/oniguruma/regint.h:1.5.4.8
 --- php-src/ext/mbstring/oniguruma/regint.h:1.5.4.7     Wed Dec 31 11:17:39 
 2008
 +++ php-src/ext/mbstring/oniguruma/regint.h     Thu Mar 19 23:10:44 2009
 @@ -256,7 +256,7 @@
  #define NULL_UCHARP                   ((UChar* )0)

  #ifndef PLATFORM_UNALIGNED_WORD_ACCESS
 -#define WORD_ALIGNMENT_SIZE       SIZEOF_INT
 +#define WORD_ALIGNMENT_SIZE       SIZEOF_LONG

  #define GET_ALIGNMENT_PAD_SIZE(addr,pad_size) do {\
   (pad_size) = WORD_ALIGNMENT_SIZE \
 http://cvs.php.net/viewvc.cgi/php-src/ext/sysvshm/sysvshm.c?r1=1.70.2.2.2.7r2=1.70.2.2.2.8diff_format=u
 Index: php-src/ext/sysvshm/sysvshm.c
 diff -u php-src/ext/sysvshm/sysvshm.c:1.70.2.2.2.7 
 php-src/ext/sysvshm/sysvshm.c:1.70.2.2.2.8
 --- php-src/ext/sysvshm/sysvshm.c:1.70.2.2.2.7  Wed Dec 31 11:17:46 2008
 +++ php-src/ext/sysvshm/sysvshm.c       Thu Mar 19 23:10:44 2009
 @@ -16,7 +16,7 @@
    +--+
  */

 -/* $Id: sysvshm.c,v 1.70.2.2.2.7 2008/12/31 11:17:46 sebastian Exp $ */
 +/* $Id: sysvshm.c,v 1.70.2.2.2.8 2009/03/19 23:10:44 iliaa Exp $ */

  /* This has been built and tested on Linux 2.2.14
  *
 @@ -375,7 +375,7 @@
        long total_size;
        long shm_varpos;

 -       total_size = ((long) (len + sizeof(sysvshm_chunk) - 1) / 4) * 4 + 4; 
 /* 4-byte alligment */
 +       total_size = ((long) (len + sizeof(sysvshm_chunk) - 1) / 
 sizeof(long)) * sizeof(long) + sizeof(long); /* long alligment */

        if ((shm_varpos = php_check_shm_data(ptr, key))  0) {
                php_remove_shm_data(ptr, shm_varpos);
 http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1445r2=1.2027.2.547.2.1446diff_format=u
 Index: php-src/NEWS
 diff -u php-src/NEWS:1.2027.2.547.2.1445 php-src/NEWS:1.2027.2.547.2.1446
 --- php-src/NEWS:1.2027.2.547.2.1445    Thu Mar 19 17:56:01 2009
 +++ php-src/NEWS        Thu Mar 19 23:10:44 2009
 @@ -6,6 +6,8 @@

  - Fixed memory corruptions while reading properties of zip files. (Ilia)

 +- Fixed bug #47721 (Aligment issues in mbstring and sysvshm extension)
 +  (crrodriguez at opensuse dot org, Ilia)
  - Fixed bug #47704 (PHP crashes on some bad operations with string 
 offsets).
   (Dmitry)
  - Fixed bug #47667 (ZipArchive::OVERWRITE seems to have no effect). (Mikko, 
 Pierre)



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



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



[PHP-CVS] cvs: php-src /ext/mbstring mbstring.dsp

2009-03-18 Thread Moriyoshi Koizumi
moriyoshi   Wed Mar 18 17:34:03 2009 UTC

  Modified files:  
/php-src/ext/mbstring   mbstring.dsp 
  Log:
  - Synching .dsp file (I am not sure whether I really should do this)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/mbstring.dsp?r1=1.21r2=1.22diff_format=u
Index: php-src/ext/mbstring/mbstring.dsp
diff -u php-src/ext/mbstring/mbstring.dsp:1.21 
php-src/ext/mbstring/mbstring.dsp:1.22
--- php-src/ext/mbstring/mbstring.dsp:1.21  Tue Mar 22 22:22:08 2005
+++ php-src/ext/mbstring/mbstring.dsp   Wed Mar 18 17:34:02 2009
@@ -366,6 +366,10 @@
 # End Source File
 # Begin Source File
 
+SOURCE=.\libmbfl\filters\mbfilter_koi8u.c
+# End Source File
+# Begin Source File
+
 SOURCE=.\libmbfl\filters\mbfilter_armscii8.c
 # End Source File
 # Begin Source File
@@ -675,6 +679,10 @@
 # End Source File
 # Begin Source File
 
+SOURCE=.\libmbfl\filters\mbfilter_koi8u.h
+# End Source File
+# Begin Source File
+
 SOURCE=.\libmbfl\filters\mbfilter_armscii8.h
 # End Source File
 # Begin Source File
@@ -895,6 +903,10 @@
 # End Source File
 # Begin Source File
 
+SOURCE=.\libmbfl\filters\unicode_table_koi8u.h
+# End Source File
+# Begin Source File
+
 SOURCE=.\libmbfl\filters\unicode_table_armscii8.h
 # End Source File
 # Begin Source File



-- 
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/mbstring mbstring.dsp

2009-03-18 Thread Moriyoshi Koizumi
moriyoshi   Wed Mar 18 17:34:27 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/mbstring   mbstring.dsp 
  Log:
  - MFH: Synching .dsp file (I am not sure whether I really should do this)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/mbstring.dsp?r1=1.21r2=1.21.6.1diff_format=u
Index: php-src/ext/mbstring/mbstring.dsp
diff -u php-src/ext/mbstring/mbstring.dsp:1.21 
php-src/ext/mbstring/mbstring.dsp:1.21.6.1
--- php-src/ext/mbstring/mbstring.dsp:1.21  Tue Mar 22 22:22:08 2005
+++ php-src/ext/mbstring/mbstring.dsp   Wed Mar 18 17:34:27 2009
@@ -366,6 +366,10 @@
 # End Source File
 # Begin Source File
 
+SOURCE=.\libmbfl\filters\mbfilter_koi8u.c
+# End Source File
+# Begin Source File
+
 SOURCE=.\libmbfl\filters\mbfilter_armscii8.c
 # End Source File
 # Begin Source File
@@ -675,6 +679,10 @@
 # End Source File
 # Begin Source File
 
+SOURCE=.\libmbfl\filters\mbfilter_koi8u.h
+# End Source File
+# Begin Source File
+
 SOURCE=.\libmbfl\filters\mbfilter_armscii8.h
 # End Source File
 # Begin Source File
@@ -895,6 +903,10 @@
 # End Source File
 # Begin Source File
 
+SOURCE=.\libmbfl\filters\unicode_table_koi8u.h
+# End Source File
+# Begin Source File
+
 SOURCE=.\libmbfl\filters\unicode_table_armscii8.h
 # End Source File
 # Begin Source File



-- 
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) /ext/mbstring mbstring.dsp

2009-03-18 Thread Moriyoshi Koizumi
moriyoshi   Wed Mar 18 17:34:43 2009 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/mbstring   mbstring.dsp 
  Log:
  - MFH: Synching .dsp file (I am not sure whether I really should do this)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/mbstring.dsp?r1=1.21r2=1.21.4.1diff_format=u
Index: php-src/ext/mbstring/mbstring.dsp
diff -u php-src/ext/mbstring/mbstring.dsp:1.21 
php-src/ext/mbstring/mbstring.dsp:1.21.4.1
--- php-src/ext/mbstring/mbstring.dsp:1.21  Tue Mar 22 22:22:08 2005
+++ php-src/ext/mbstring/mbstring.dsp   Wed Mar 18 17:34:43 2009
@@ -366,6 +366,10 @@
 # End Source File
 # Begin Source File
 
+SOURCE=.\libmbfl\filters\mbfilter_koi8u.c
+# End Source File
+# Begin Source File
+
 SOURCE=.\libmbfl\filters\mbfilter_armscii8.c
 # End Source File
 # Begin Source File
@@ -675,6 +679,10 @@
 # End Source File
 # Begin Source File
 
+SOURCE=.\libmbfl\filters\mbfilter_koi8u.h
+# End Source File
+# Begin Source File
+
 SOURCE=.\libmbfl\filters\mbfilter_armscii8.h
 # End Source File
 # Begin Source File
@@ -895,6 +903,10 @@
 # End Source File
 # Begin Source File
 
+SOURCE=.\libmbfl\filters\unicode_table_koi8u.h
+# End Source File
+# Begin Source File
+
 SOURCE=.\libmbfl\filters\unicode_table_armscii8.h
 # End Source File
 # Begin Source File



-- 
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 /ext/mbstring config.m4 mbstring.dsp /ext/mbstring/libmbfl/filters Makefile.am Makefile.bcc32 mbfilter_cp850.c mbfilter_cp850.h unicode_table_cp850.h /ext/mbs

2009-03-18 Thread Moriyoshi Koizumi
moriyoshi   Wed Mar 18 17:43:55 2009 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/mbstring/libmbfl/filters   mbfilter_cp850.c 
mbfilter_cp850.h 
unicode_table_cp850.h 

  Modified files:  
/php-srcNEWS 
/php-src/ext/mbstring   config.m4 mbstring.dsp 
/php-src/ext/mbstring/libmbfl/filters   Makefile.am Makefile.bcc32 
/php-src/ext/mbstring/libmbfl/mbfl  mbfl_consts.h mbfl_convert.c 
mbfl_encoding.c mbfl_encoding.h 
mbfl_ident.c 
  Log:
  - Add support for CP850 encoding (patch by Denis Giffeler)
  
  http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.522r2=1.2027.2.547.2.965.2.523diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.522 
php-src/NEWS:1.2027.2.547.2.965.2.523
--- php-src/NEWS:1.2027.2.547.2.965.2.522   Wed Mar 18 08:16:13 2009
+++ php-src/NEWSWed Mar 18 17:43:54 2009
@@ -9,6 +9,9 @@
 - Added LIBXML_LOADED_VERSION constant (libxml2 version currently used). (Rob)
 - Added JSON_FORCE_OBJECT flag to json_encode(). (Scott, Richard Quadling)
 
+- Added support for CP850 encoding in mbstring extension.
+  (Denis Giffeler, Moriyoshi)
+
 - Fixed bug #47678 (Allow loadExtension to be disabled in SQLite3). (Scott)
 - Fixed bug #47664 (get_class returns NULL instead of FALSE). (Dmitry)
 - Fixed bug #47593 (interface_exists() returns false when using absolute 
http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/config.m4?r1=1.58.2.4.2.11.2.6r2=1.58.2.4.2.11.2.7diff_format=u
Index: php-src/ext/mbstring/config.m4
diff -u php-src/ext/mbstring/config.m4:1.58.2.4.2.11.2.6 
php-src/ext/mbstring/config.m4:1.58.2.4.2.11.2.7
--- php-src/ext/mbstring/config.m4:1.58.2.4.2.11.2.6Thu Jul 24 13:01:49 2008
+++ php-src/ext/mbstring/config.m4  Wed Mar 18 17:43:55 2009
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.58.2.4.2.11.2.6 2008/07/24 13:01:49 moriyoshi Exp $
+dnl $Id: config.m4,v 1.58.2.4.2.11.2.7 2009/03/18 17:43:55 moriyoshi Exp $
 dnl
 
 AC_DEFUN([PHP_MBSTRING_ADD_SOURCES], [
@@ -271,6 +271,7 @@
  libmbfl/filters/mbfilter_utf8.c
  libmbfl/filters/mbfilter_uuencode.c
  libmbfl/filters/mbfilter_koi8u.c
+ libmbfl/filters/mbfilter_cp850.c
  libmbfl/mbfl/mbfilter.c
  libmbfl/mbfl/mbfilter_8bit.c
  libmbfl/mbfl/mbfilter_pass.c
http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/mbstring.dsp?r1=1.21.6.1r2=1.21.6.2diff_format=u
Index: php-src/ext/mbstring/mbstring.dsp
diff -u php-src/ext/mbstring/mbstring.dsp:1.21.6.1 
php-src/ext/mbstring/mbstring.dsp:1.21.6.2
--- php-src/ext/mbstring/mbstring.dsp:1.21.6.1  Wed Mar 18 17:34:27 2009
+++ php-src/ext/mbstring/mbstring.dsp   Wed Mar 18 17:43:55 2009
@@ -374,6 +374,10 @@
 # End Source File
 # Begin Source File
 
+SOURCE=.\libmbfl\filters\mbfilter_cp850.c
+# End Source File
+# Begin Source File
+
 SOURCE=.\libmbfl\mbfl\mbfilter_pass.c
 # End Source File
 # Begin Source File
@@ -687,6 +691,10 @@
 # End Source File
 # Begin Source File
 
+SOURCE=.\libmbfl\filters\mbfilter_cp850.h
+# End Source File
+# Begin Source File
+
 SOURCE=.\libmbfl\mbfl\mbfilter_pass.h
 # End Source File
 # Begin Source File
@@ -911,6 +919,10 @@
 # End Source File
 # Begin Source File
 
+SOURCE=.\libmbfl\filters\unicode_table_cp850.h
+# End Source File
+# Begin Source File
+
 SOURCE=.\libmbfl\filters\unicode_table_uhc.h
 # End Source File
 # End Group
http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/libmbfl/filters/Makefile.am?r1=1.4.4.2.2.1r2=1.4.4.2.2.2diff_format=u
Index: php-src/ext/mbstring/libmbfl/filters/Makefile.am
diff -u php-src/ext/mbstring/libmbfl/filters/Makefile.am:1.4.4.2.2.1 
php-src/ext/mbstring/libmbfl/filters/Makefile.am:1.4.4.2.2.2
--- php-src/ext/mbstring/libmbfl/filters/Makefile.am:1.4.4.2.2.1Sat Jul 
 5 06:52:04 2008
+++ php-src/ext/mbstring/libmbfl/filters/Makefile.amWed Mar 18 17:43:55 2009
@@ -52,6 +52,7 @@
mbfilter_koi8r.c \
mbfilter_koi8u.c \
mbfilter_armscii8.c \
+   mbfilter_cp850.c \
html_entities.c \
cp932_table.h \
html_entities.h \
@@ -105,6 +106,7 @@
mbfilter_utf8.h \
mbfilter_uuencode.h \
mbfilter_cp51932.h \
+   mbfilter_cp850.h \
unicode_prop.h \
unicode_table_big5.h \
unicode_table_cns11643.h \
@@ -131,6 +133,7 @@
unicode_table_koi8r.h \
unicode_table_koi8u.h \
unicode_table_armscii8.h \
+   unicode_table_cp850.h \
unicode_table_uhc.h
 
 mbfilter_iso8859_2.c: unicode_table_iso8859_2.h
http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/libmbfl/filters/Makefile.bcc32?r1=1.3.6.1r2=1.3.6.2diff_format=u
Index: php-src/ext/mbstring/libmbfl/filters/Makefile.bcc32
diff -u php-src/ext/mbstring/libmbfl/filters/Makefile.bcc32:1.3.6.1 

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

2009-03-18 Thread Moriyoshi Koizumi
moriyoshi   Wed Mar 18 17:48:19 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-srcNEWS 
  Log:
  - Use UTF-8 characters as 5.2's NEWS does.
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.523r2=1.2027.2.547.2.965.2.524diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.523 
php-src/NEWS:1.2027.2.547.2.965.2.524
--- php-src/NEWS:1.2027.2.547.2.965.2.523   Wed Mar 18 17:43:54 2009
+++ php-src/NEWSWed Mar 18 17:48:18 2009
@@ -598,7 +598,7 @@
   modifier was used. (Derick)
 - Fixed exec() on Windows to not eat the first and last double quotes. (Scott)
 
-- Fixed PECL bug #12794 (PDOStatement-nextRowset() doesn¿t work). (Johannes)
+- Fixed PECL bug #12794 (PDOStatement-nextRowset() doesn't work). (Johannes)
 - Fixed PECL bug #12401 (Add support for ATTR_FETCH_TABLE_NAMES). (Johannes)
 
 - Fixed bug #45622 (isset($arrayObject-p) misbehaves with ArrayObject::
@@ -825,7 +825,7 @@
 - Fixed bug #42242 (sybase_connect() crashes). (Ilia)
 - Fixed bug #42237 (stream_copy_to_stream returns invalid values for mmaped
   streams). (andrew dot minerd at sellingsource dot com, Ilia)
-- Fixed bug #42233 (Problems with æøå in extract()). (Jani)
+- Fixed bug #42233 (Problems with æøå in extract()). (Jani)
 - Fixed bug #4 (possible buffer overflow in php_openssl_make_REQ). (Pierre)
 - Fixed bug #42211 (property_exists() fails to find protected properties
   from a parent class). (Dmitry)



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



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

2009-03-16 Thread Moriyoshi Koizumi
moriyoshi   Tue Mar 17 05:27:00 2009 UTC

  Modified files:  
/php-src/ext/iconv  iconv.c 
  Log:
  - 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.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/iconv/iconv.c?r1=1.172r2=1.173diff_format=u
Index: php-src/ext/iconv/iconv.c
diff -u php-src/ext/iconv/iconv.c:1.172 php-src/ext/iconv/iconv.c:1.173
--- php-src/ext/iconv/iconv.c:1.172 Tue Mar 10 23:39:22 2009
+++ php-src/ext/iconv/iconv.c   Tue Mar 17 05:27:00 2009
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: iconv.c,v 1.172 2009/03/10 23:39:22 helly Exp $ */
+/* $Id: iconv.c,v 1.173 2009/03/17 05:27:00 moriyoshi Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -2850,7 +2850,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

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.13r2=1.124.2.8.2.20.2.14diff_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 /ext/mbstring mb_gpc.c mbstring.c mbstring.h

2009-03-15 Thread Moriyoshi Koizumi
moriyoshi   Sun Mar 15 20:42:30 2009 UTC

  Modified files:  
/php-src/ext/mbstring   mb_gpc.c mbstring.c mbstring.h 
  Log:
  - Fix a bug that mbstring.internal_encoding doesn't take effect within
the request encoding converter.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/mb_gpc.c?r1=1.26r2=1.27diff_format=u
Index: php-src/ext/mbstring/mb_gpc.c
diff -u php-src/ext/mbstring/mb_gpc.c:1.26 php-src/ext/mbstring/mb_gpc.c:1.27
--- php-src/ext/mbstring/mb_gpc.c:1.26  Tue Mar 10 23:39:27 2009
+++ php-src/ext/mbstring/mb_gpc.c   Sun Mar 15 20:42:30 2009
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: mb_gpc.c,v 1.26 2009/03/10 23:39:27 helly Exp $ */
+/* $Id: mb_gpc.c,v 1.27 2009/03/15 20:42:30 moriyoshi Exp $ */
 
 /* {{{ includes */
 #ifdef HAVE_CONFIG_H
@@ -59,6 +59,11 @@
enum mbfl_no_encoding detected;
php_mb_encoding_handler_info_t info;
 
+   {
+   char *value = zend_ini_string(mbstring.internal_encoding, 
sizeof(mbstring.internal_encoding), 0);
+   _php_mb_ini_mbstring_internal_encoding_set(value, value ? 
strlen(value): 0 TSRMLS_CC);
+   }
+
if (!MBSTRG(encoding_translation)) {
php_default_treat_data(arg, str, destArray TSRMLS_CC);
return;
http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/mbstring.c?r1=1.319r2=1.320diff_format=u
Index: php-src/ext/mbstring/mbstring.c
diff -u php-src/ext/mbstring/mbstring.c:1.319 
php-src/ext/mbstring/mbstring.c:1.320
--- php-src/ext/mbstring/mbstring.c:1.319   Tue Mar 10 23:39:27 2009
+++ php-src/ext/mbstring/mbstring.c Sun Mar 15 20:42:30 2009
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: mbstring.c,v 1.319 2009/03/10 23:39:27 helly Exp $ */
+/* $Id: mbstring.c,v 1.320 2009/03/15 20:42:30 moriyoshi Exp $ */
 
 /*
  * PHP 4 Multibyte String module mbstring
@@ -1032,7 +1032,7 @@
 /* }}} */
 
 /* {{{ static _php_mb_ini_mbstring_internal_encoding_set */
-static int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, 
uint new_value_length TSRMLS_DC)
+int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, uint 
new_value_length TSRMLS_DC)
 {
enum mbfl_no_encoding no_encoding;
const char *enc_name = NULL;
@@ -1202,7 +1202,6 @@
if (MBSTRG(encoding_translation)) {
sapi_unregister_post_entry(php_post_entries TSRMLS_CC);
sapi_register_post_entries(mbstr_post_entries TSRMLS_CC);
-   sapi_register_treat_data(mbstr_treat_data);
} else {
sapi_unregister_post_entry(mbstr_post_entries TSRMLS_CC);
sapi_register_post_entries(php_post_entries TSRMLS_CC);
@@ -1352,9 +1351,12 @@
 
REGISTER_INI_ENTRIES();
 
+   /* This is a global handler. Should not be set in a per-request 
handler. */
+   sapi_register_treat_data(mbstr_treat_data);
+
+   /* Post handlers are stored in the thread-local context. */
if (MBSTRG(encoding_translation)) {
sapi_register_post_entries(mbstr_post_entries TSRMLS_CC);
-   sapi_register_treat_data(mbstr_treat_data);
}
 
REGISTER_LONG_CONSTANT(MB_OVERLOAD_MAIL, MB_OVERLOAD_MAIL, CONST_CS | 
CONST_PERSISTENT);
@@ -1393,11 +1395,6 @@
zend_function *func, *orig;
const struct mb_overload_def *p;
 
-   {
-   char *value = zend_ini_string(mbstring.internal_encoding, 
sizeof(mbstring.internal_encoding), 0);
-   _php_mb_ini_mbstring_internal_encoding_set(value, value ? 
strlen(value): 0 TSRMLS_CC);
-   }
-
MBSTRG(current_internal_encoding) = MBSTRG(internal_encoding);
MBSTRG(current_http_output_encoding) = MBSTRG(http_output_encoding);
MBSTRG(current_filter_illegal_mode) = MBSTRG(filter_illegal_mode);
http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/mbstring.h?r1=1.87r2=1.88diff_format=u
Index: php-src/ext/mbstring/mbstring.h
diff -u php-src/ext/mbstring/mbstring.h:1.87 
php-src/ext/mbstring/mbstring.h:1.88
--- php-src/ext/mbstring/mbstring.h:1.87Tue Mar 10 23:39:27 2009
+++ php-src/ext/mbstring/mbstring.h Sun Mar 15 20:42:30 2009
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: mbstring.h,v 1.87 2009/03/10 23:39:27 helly Exp $ */
+/* $Id: mbstring.h,v 1.88 2009/03/15 20:42:30 moriyoshi Exp $ */
 
 /*
  * PHP 4 Multibyte String module mbstring (currently only for Japanese)
@@ -159,6 +159,9 @@
 
 MBSTRING_API int php_mb_stripos(int mode, const char *old_haystack, unsigned 
int old_haystack_len, const char *old_needle, unsigned int old_needle_len, long 
offset, const char *from_encoding TSRMLS_DC);
 
+/* internal use only */
+int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, uint 
new_value_length TSRMLS_DC);
+
 

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

2009-03-15 Thread Moriyoshi Koizumi
moriyoshi   Sun Mar 15 20:42:57 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/mbstring   mb_gpc.c mbstring.c mbstring.h 
  Log:
  - MFH: Fix a bug that mbstring.internal_encoding doesn't take effect within
the request encoding converter.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/mb_gpc.c?r1=1.17.2.2.2.3.2.2r2=1.17.2.2.2.3.2.3diff_format=u
Index: php-src/ext/mbstring/mb_gpc.c
diff -u php-src/ext/mbstring/mb_gpc.c:1.17.2.2.2.3.2.2 
php-src/ext/mbstring/mb_gpc.c:1.17.2.2.2.3.2.3
--- php-src/ext/mbstring/mb_gpc.c:1.17.2.2.2.3.2.2  Wed Dec 31 11:15:38 2008
+++ php-src/ext/mbstring/mb_gpc.c   Sun Mar 15 20:42:56 2009
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: mb_gpc.c,v 1.17.2.2.2.3.2.2 2008/12/31 11:15:38 sebastian Exp $ */
+/* $Id: mb_gpc.c,v 1.17.2.2.2.3.2.3 2009/03/15 20:42:56 moriyoshi Exp $ */
 
 /* {{{ includes */
 #ifdef HAVE_CONFIG_H
@@ -59,6 +59,11 @@
enum mbfl_no_encoding detected;
php_mb_encoding_handler_info_t info;
 
+   {
+   char *value = zend_ini_string(mbstring.internal_encoding, 
sizeof(mbstring.internal_encoding), 0);
+   _php_mb_ini_mbstring_internal_encoding_set(value, value ? 
strlen(value): 0 TSRMLS_CC);
+   }
+
if (!MBSTRG(encoding_translation)) {
php_default_treat_data(arg, str, destArray TSRMLS_CC);
return;
http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/mbstring.c?r1=1.224.2.22.2.25.2.51r2=1.224.2.22.2.25.2.52diff_format=u
Index: php-src/ext/mbstring/mbstring.c
diff -u php-src/ext/mbstring/mbstring.c:1.224.2.22.2.25.2.51 
php-src/ext/mbstring/mbstring.c:1.224.2.22.2.25.2.52
--- php-src/ext/mbstring/mbstring.c:1.224.2.22.2.25.2.51Fri Mar  6 
15:48:30 2009
+++ php-src/ext/mbstring/mbstring.c Sun Mar 15 20:42:56 2009
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: mbstring.c,v 1.224.2.22.2.25.2.51 2009/03/06 15:48:30 iliaa Exp $ */
+/* $Id: mbstring.c,v 1.224.2.22.2.25.2.52 2009/03/15 20:42:56 moriyoshi Exp $ 
*/
 
 /*
  * PHP 4 Multibyte String module mbstring
@@ -1203,7 +1203,7 @@
 /* }}} */
 
 /* {{{ static _php_mb_ini_mbstring_internal_encoding_set */
-static int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, 
uint new_value_length TSRMLS_DC)
+int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, uint 
new_value_length TSRMLS_DC)
 {
enum mbfl_no_encoding no_encoding;
const char *enc_name = NULL;
@@ -1370,7 +1370,6 @@
if (MBSTRG(encoding_translation)) {
sapi_unregister_post_entry(php_post_entries TSRMLS_CC);
sapi_register_post_entries(mbstr_post_entries TSRMLS_CC);
-   sapi_register_treat_data(mbstr_treat_data);
} else {
sapi_unregister_post_entry(mbstr_post_entries TSRMLS_CC);
sapi_register_post_entries(php_post_entries TSRMLS_CC);
@@ -1512,9 +1511,12 @@
 
REGISTER_INI_ENTRIES();
 
+   /* This is a global handler. Should not be set in a per-request 
handler. */
+   sapi_register_treat_data(mbstr_treat_data);
+
+   /* Post handlers are stored in the thread-local context. */
if (MBSTRG(encoding_translation)) {
sapi_register_post_entries(mbstr_post_entries TSRMLS_CC);
-   sapi_register_treat_data(mbstr_treat_data);
}
 
REGISTER_LONG_CONSTANT(MB_OVERLOAD_MAIL, MB_OVERLOAD_MAIL, CONST_CS | 
CONST_PERSISTENT);
@@ -1553,11 +1555,6 @@
zend_function *func, *orig;
const struct mb_overload_def *p;
 
-   {
-   char *value = zend_ini_string(mbstring.internal_encoding, 
sizeof(mbstring.internal_encoding), 0);
-   _php_mb_ini_mbstring_internal_encoding_set(value, value ? 
strlen(value): 0 TSRMLS_CC);
-   }
-
MBSTRG(current_internal_encoding) = MBSTRG(internal_encoding);
MBSTRG(current_http_output_encoding) = MBSTRG(http_output_encoding);
MBSTRG(current_filter_illegal_mode) = MBSTRG(filter_illegal_mode);
http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/mbstring.h?r1=1.66.2.4.2.5.2.10r2=1.66.2.4.2.5.2.11diff_format=u
Index: php-src/ext/mbstring/mbstring.h
diff -u php-src/ext/mbstring/mbstring.h:1.66.2.4.2.5.2.10 
php-src/ext/mbstring/mbstring.h:1.66.2.4.2.5.2.11
--- php-src/ext/mbstring/mbstring.h:1.66.2.4.2.5.2.10   Sat Feb 14 07:34:15 2009
+++ php-src/ext/mbstring/mbstring.h Sun Mar 15 20:42:56 2009
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: mbstring.h,v 1.66.2.4.2.5.2.10 2009/02/14 07:34:15 moriyoshi Exp $ */
+/* $Id: mbstring.h,v 1.66.2.4.2.5.2.11 2009/03/15 20:42:56 moriyoshi Exp $ */
 
 /*
  * PHP 4 Multibyte String module mbstring (currently only for Japanese)
@@ -159,6 +159,9 @@
 
 MBSTRING_API int php_mb_stripos(int mode, const char 

[PHP-CVS] cvs: php-src(PHP_5_2) /ext/mbstring mb_gpc.c mbstring.c mbstring.h

2009-03-15 Thread Moriyoshi Koizumi
moriyoshi   Sun Mar 15 20:44:17 2009 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/mbstring   mb_gpc.c mbstring.c mbstring.h 
  Log:
  - MFH: Fix a bug that mbstring.internal_encoding doesn't take effect within
the request encoding converter.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/mb_gpc.c?r1=1.17.2.2.2.5r2=1.17.2.2.2.6diff_format=u
Index: php-src/ext/mbstring/mb_gpc.c
diff -u php-src/ext/mbstring/mb_gpc.c:1.17.2.2.2.5 
php-src/ext/mbstring/mb_gpc.c:1.17.2.2.2.6
--- php-src/ext/mbstring/mb_gpc.c:1.17.2.2.2.5  Wed Dec 31 11:17:39 2008
+++ php-src/ext/mbstring/mb_gpc.c   Sun Mar 15 20:44:17 2009
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: mb_gpc.c,v 1.17.2.2.2.5 2008/12/31 11:17:39 sebastian Exp $ */
+/* $Id: mb_gpc.c,v 1.17.2.2.2.6 2009/03/15 20:44:17 moriyoshi Exp $ */
 
 /* {{{ includes */
 #ifdef HAVE_CONFIG_H
@@ -59,6 +59,11 @@
enum mbfl_no_encoding detected;
php_mb_encoding_handler_info_t info;
 
+   {
+   char *value = zend_ini_string(mbstring.internal_encoding, 
sizeof(mbstring.internal_encoding), 0);
+   _php_mb_ini_mbstring_internal_encoding_set(value, value ? 
strlen(value): 0 TSRMLS_CC);
+   }
+
if (!MBSTRG(encoding_translation)) {
php_default_treat_data(arg, str, destArray TSRMLS_CC);
return;
http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/mbstring.c?r1=1.224.2.22.2.46r2=1.224.2.22.2.47diff_format=u
Index: php-src/ext/mbstring/mbstring.c
diff -u php-src/ext/mbstring/mbstring.c:1.224.2.22.2.46 
php-src/ext/mbstring/mbstring.c:1.224.2.22.2.47
--- php-src/ext/mbstring/mbstring.c:1.224.2.22.2.46 Sun Feb 15 07:11:23 2009
+++ php-src/ext/mbstring/mbstring.c Sun Mar 15 20:44:17 2009
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: mbstring.c,v 1.224.2.22.2.46 2009/02/15 07:11:23 moriyoshi Exp $ */
+/* $Id: mbstring.c,v 1.224.2.22.2.47 2009/03/15 20:44:17 moriyoshi Exp $ */
 
 /*
  * PHP 4 Multibyte String module mbstring
@@ -656,7 +656,7 @@
 /* }}} */
 
 /* {{{ static _php_mb_ini_mbstring_internal_encoding_set */
-static int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, 
uint new_value_length TSRMLS_DC)
+int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, uint 
new_value_length TSRMLS_DC)
 {
enum mbfl_no_encoding no_encoding;
const char *enc_name = NULL;
@@ -826,7 +826,6 @@
if (MBSTRG(encoding_translation)) {
sapi_unregister_post_entry(php_post_entries TSRMLS_CC);
sapi_register_post_entries(mbstr_post_entries TSRMLS_CC);
-   sapi_register_treat_data(mbstr_treat_data);
} else {
sapi_unregister_post_entry(mbstr_post_entries TSRMLS_CC);
sapi_register_post_entries(php_post_entries TSRMLS_CC);
@@ -927,9 +926,12 @@
 
REGISTER_INI_ENTRIES();
 
+   /* This is a global handler. Should not be set in a per-request 
handler. */
+   sapi_register_treat_data(mbstr_treat_data);
+
+   /* Post handlers are stored in the thread-local context. */
if (MBSTRG(encoding_translation)) {
sapi_register_post_entries(mbstr_post_entries TSRMLS_CC);
-   sapi_register_treat_data(mbstr_treat_data);
}
 
REGISTER_LONG_CONSTANT(MB_OVERLOAD_MAIL, MB_OVERLOAD_MAIL, CONST_CS | 
CONST_PERSISTENT);
@@ -968,11 +970,6 @@
zend_function *func, *orig;
const struct mb_overload_def *p;
 
-   {
-   char *value = zend_ini_string(mbstring.internal_encoding, 
sizeof(mbstring.internal_encoding), 0);
-   _php_mb_ini_mbstring_internal_encoding_set(value, value ? 
strlen(value): 0 TSRMLS_CC);
-   }
-
MBSTRG(current_internal_encoding) = MBSTRG(internal_encoding);
MBSTRG(current_http_output_encoding) = MBSTRG(http_output_encoding);
MBSTRG(current_filter_illegal_mode) = MBSTRG(filter_illegal_mode);
http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/mbstring.h?r1=1.66.2.4.2.9r2=1.66.2.4.2.10diff_format=u
Index: php-src/ext/mbstring/mbstring.h
diff -u php-src/ext/mbstring/mbstring.h:1.66.2.4.2.9 
php-src/ext/mbstring/mbstring.h:1.66.2.4.2.10
--- php-src/ext/mbstring/mbstring.h:1.66.2.4.2.9Wed Dec 31 11:17:39 2008
+++ php-src/ext/mbstring/mbstring.h Sun Mar 15 20:44:17 2009
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: mbstring.h,v 1.66.2.4.2.9 2008/12/31 11:17:39 sebastian Exp $ */
+/* $Id: mbstring.h,v 1.66.2.4.2.10 2009/03/15 20:44:17 moriyoshi Exp $ */
 
 /*
  * PHP 4 Multibyte String module mbstring (currently only for Japanese)
@@ -159,6 +159,9 @@
 
 MBSTRING_API int php_mb_stripos(int mode, char *old_haystack, int 
old_haystack_len, char *old_needle, int old_needle_len, long offset, char 
*from_encoding 

[PHP-CVS] cvs: php-src / php.ini-recommended

2009-03-01 Thread Moriyoshi Koizumi
moriyoshi   Mon Mar  2 04:43:51 2009 UTC

  Modified files:  
/php-srcphp.ini-recommended 
  Log:
  - Fix typo.
  
  
http://cvs.php.net/viewvc.cgi/php-src/php.ini-recommended?r1=1.240r2=1.241diff_format=u
Index: php-src/php.ini-recommended
diff -u php-src/php.ini-recommended:1.240 php-src/php.ini-recommended:1.241
--- php-src/php.ini-recommended:1.240   Fri Feb 13 16:54:16 2009
+++ php-src/php.ini-recommended Mon Mar  2 04:43:51 2009
@@ -1169,7 +1169,7 @@
 ;mbstring.func_overload = 0
 
 ; enable strict encoding detection.
-;mbstring.strict_encoding = Off
+;mbstring.strict_detection = Off
 
 [gd]
 ; Tell the jpeg decode to libjpeg warnings and try to create



-- 
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) / php.ini-recommended

2009-03-01 Thread Moriyoshi Koizumi
moriyoshi   Mon Mar  2 04:44:15 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-srcphp.ini-recommended 
  Log:
   MFH: Fix typo
  
  
http://cvs.php.net/viewvc.cgi/php-src/php.ini-recommended?r1=1.179.2.11.2.23.2.21r2=1.179.2.11.2.23.2.22diff_format=u
Index: php-src/php.ini-recommended
diff -u php-src/php.ini-recommended:1.179.2.11.2.23.2.21 
php-src/php.ini-recommended:1.179.2.11.2.23.2.22
--- php-src/php.ini-recommended:1.179.2.11.2.23.2.21Fri Feb 13 16:54:56 2009
+++ php-src/php.ini-recommended Mon Mar  2 04:44:15 2009
@@ -1271,7 +1271,7 @@
 ;mbstring.func_overload = 0
 
 ; enable strict encoding detection.
-;mbstring.strict_encoding = Off
+;mbstring.strict_detection = Off
 
 [gd]
 ; Tell the jpeg decode to libjpeg warnings and try to create



-- 
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) / php.ini-recommended

2009-03-01 Thread Moriyoshi Koizumi
moriyoshi   Mon Mar  2 04:44:35 2009 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcphp.ini-recommended 
  Log:
  - MFH: Fix typo.
  
  
http://cvs.php.net/viewvc.cgi/php-src/php.ini-recommended?r1=1.179.2.11.2.30r2=1.179.2.11.2.31diff_format=u
Index: php-src/php.ini-recommended
diff -u php-src/php.ini-recommended:1.179.2.11.2.30 
php-src/php.ini-recommended:1.179.2.11.2.31
--- php-src/php.ini-recommended:1.179.2.11.2.30 Fri Feb 13 16:55:18 2009
+++ php-src/php.ini-recommended Mon Mar  2 04:44:35 2009
@@ -1278,7 +1278,7 @@
 ;mbstring.func_overload = 0
 
 ; enable strict encoding detection.
-;mbstring.strict_encoding = Off
+;mbstring.strict_detection = Off
 
 [FrontBase]
 ;fbsql.allow_persistent = On



-- 
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_2) / NEWS configure.in /main php_version.h

2009-02-25 Thread Moriyoshi Koizumi
Ilia,

We didn't resolve the array_unique() issue yet. Please take this into account.

Moriyoshi

2009/2/25 Ilia Alshanetsky il...@php.net:
 iliaa           Wed Feb 25 14:56:51 2009 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src    configure.in NEWS
    /php-src/main       php_version.h
  Log:

  5.2.9

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


--
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_2) / NEWS configure.in /main php_version.h

2009-02-25 Thread Moriyoshi Koizumi
The issue is not whether it is valid or not. Andrei's patch broke the
backwards compatibility that affects real-world applications and thus
cannot be regarded as an improvement.

Moriyoshi

On Thu, Feb 26, 2009 at 11:51 AM, Ilia Alshanetsky i...@prohost.org wrote:
 Moriyoshi,

 My opinion is that the current implementation is valid, which is why
 Andrei's patch was accepted in the first place.


 On 25-Feb-09, at 9:34 PM, Moriyoshi Koizumi wrote:

 Ilia,

 We didn't resolve the array_unique() issue yet. Please take this into
 account.

 Moriyoshi

 2009/2/25 Ilia Alshanetsky il...@php.net:

 iliaa           Wed Feb 25 14:56:51 2009 UTC

  Modified files:              (Branch: PHP_5_2)
   /php-src    configure.in NEWS
   /php-src/main       php_version.h
  Log:

  5.2.9

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


 Ilia Alshanetsky






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



  1   2   3   4   5   6   7   8   9   10   >