RE: [PHP-CVS] cvs: php-src /ext/standard md5.c /ext/standard/tests/strings explode.phpt strcspn.phpt strspn.phptstrstr.phpt

2005-08-16 Thread Derick Rethans
On Wed, 17 Aug 2005, Dmitry Stogov wrote:

> May be nice to have, however ASCII to unicode conversion is not usual case.
> Usualy we have non ASCII but some encoding (UG(runrime_encoding)).

But we can have a macro for that too, isn't it? :)

Derick
-- 
Derick Rethans
http://derickrethans.nl | http://ez.no | http://xdebug.org

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

2005-08-16 Thread Dmitry Stogov
May be it should return IS_BINARY only in unicode mode, and IS_STRING in
non-unicode (as before)?

Dmitry.

> -Original Message-
> From: Andrei Zmievski [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, August 16, 2005 11:45 PM
> To: php-cvs@lists.php.net
> Subject: [PHP-CVS] cvs: php-src /ext/standard md5.c 
> 
> 
> andreiTue Aug 16 15:45:01 2005 EDT
> 
>   Modified files:  
> /php-src/ext/standard md5.c 
>   Log:
>   md5() and md5_file() should return binary strings when raw_output is
>   set.
>   
>   
> http://cvs.php.net/diff.php/php-src/ext/standard/md5.c?r1=1.40
&r2=1.41&ty=u
Index: php-src/ext/standard/md5.c
diff -u php-src/ext/standard/md5.c:1.40 php-src/ext/standard/md5.c:1.41
--- php-src/ext/standard/md5.c:1.40 Tue Aug 16 06:18:41 2005
+++ php-src/ext/standard/md5.c  Tue Aug 16 15:45:00 2005
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: md5.c,v 1.40 2005/08/16 10:18:41 dmitry Exp $ */
+/* $Id: md5.c,v 1.41 2005/08/16 19:45:00 andrei Exp $ */
 
 /* 
  * md5.c - Copyright 1997 Lachlan Roche 
@@ -58,7 +58,7 @@
PHP_MD5Update(&context, arg, arg_len);
PHP_MD5Final(digest, &context);
if (raw_output) {
-   RETURN_STRINGL(digest, 16, 1);
+   RETURN_BINARYL(digest, 16, 1);
} else {
make_digest(md5str, digest);
if (UG(unicode)) {
@@ -110,7 +110,7 @@
}
 
if (raw_output) {
-   RETURN_STRINGL(digest, 16, 1);
+   RETURN_BINARYL(digest, 16, 1);
} else {
make_digest(md5str, digest);
if (UG(unicode)) {

-- 
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 /ext/standard md5.c /ext/standard/tests/strings explode.phpt strcspn.phpt strspn.phptstrstr.phpt

2005-08-16 Thread Andi Gutmans
Oh, I didn't realize this was literally meant to be ASCII. In such case, 
there probably aren't  going to be many places


At 09:36 AM 8/17/2005 +0400, Dmitry Stogov wrote:

May be nice to have, however ASCII to unicode conversion is not usual case.
Usualy we have non ASCII but some encoding (UG(runrime_encoding)).

Dmitry.

> -Original Message-
> From: Andi Gutmans [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 17, 2005 4:54 AM
> To: Dmitry Stogov; php-cvs@lists.php.net
> Subject: Re: [PHP-CVS] cvs: php-src /ext/standard md5.c
> /ext/standard/tests/strings explode.phpt strcspn.phpt
> strspn.phptstrstr.phpt
>
>
> Shouldn't we have a macro that does this?
> I see lots of places that require the same code.
> -   RETVAL_STRING(md5str, 1);
> +   if (UG(unicode)) {
> +   UChar *u_temp =
> zend_ascii_to_unicode(md5str, 33
> ZEND_FILE_LINE_CC);
> +   RETVAL_UNICODE(u_temp, 0);
> +   } else {
> +   RETVAL_STRING(md5str, 1);
> +   }
>  }
>
> Andi
>
> At 10:18 AM 8/16/2005 +, Dmitry Stogov wrote:
> >dmitry  Tue Aug 16 06:18:43 2005 EDT
> >
> >   Modified files:
> > /php-src/ext/standard   md5.c
> > /php-src/ext/standard/tests/strings explode.phpt strcspn.phpt
> > strspn.phpt strstr.phpt
> >   Log:
> >   Unicode support
> >
> >
> >http://cvs.php.net/diff.php/php-src/ext/standard/md5.c?r1=1.3
> 9&r2=1.40&
> >ty=u
> >Index: php-src/ext/standard/md5.c
> >diff -u php-src/ext/standard/md5.c:1.39
> php-src/ext/standard/md5.c:1.40
> >--- php-src/ext/standard/md5.c:1.39 Wed Aug  3 10:08:09 2005
> >+++ php-src/ext/standard/md5.c  Tue Aug 16 06:18:41 2005
> >@@ -16,7 +16,7 @@
> >
> >+
> --+
> >  */
> >
> >-/* $Id: md5.c,v 1.39 2005/08/03 14:08:09 sniper Exp $ */
> >+/* $Id: md5.c,v 1.40 2005/08/16 10:18:41 dmitry Exp $ */
> >
> >  /*
> >   * md5.c - Copyright 1997 Lachlan Roche
> >@@ -61,7 +61,12 @@
> > RETURN_STRINGL(digest, 16, 1);
> > } else {
> > make_digest(md5str, digest);
> >-   RETVAL_STRING(md5str, 1);
> >+   if (UG(unicode)) {
> >+   UChar *u_temp =
> zend_ascii_to_unicode(md5str,
> >+ 33
> >ZEND_FILE_LINE_CC);
> >+   RETVAL_UNICODE(u_temp, 0);
> >+   } else {
> >+   RETVAL_STRING(md5str, 1);
> >+   }
> > }
> >
> >  }
> >@@ -108,7 +113,12 @@
> > RETURN_STRINGL(digest, 16, 1);
> > } else {
> > make_digest(md5str, digest);
> >-   RETVAL_STRING(md5str, 1);
> >+   if (UG(unicode)) {
> >+   UChar *u_temp =
> zend_ascii_to_unicode(md5str,
> >+ 33
> >ZEND_FILE_LINE_CC);
> >+   RETVAL_UNICODE(u_temp, 0);
> >+   } else {
> >+   RETVAL_STRING(md5str, 1);
> >+   }
> > }
> >  }
> >  /* }}} */
> >http://cvs.php.net/diff.php/php-src/ext/standard/tests/string
s/explode.
> >phpt?r1=1.4&r2=1.5&ty=u
> >Index: php-src/ext/standard/tests/strings/explode.phpt
> >diff -u php-src/ext/standard/tests/strings/explode.phpt:1.4
> >php-src/ext/standard/tests/strings/explode.phpt:1.5
> >--- php-src/ext/standard/tests/strings/explode.phpt:1.4 Sun Jul 18
> >07:34:28 2004
> >+++ php-src/ext/standard/tests/strings/explode.phpt Tue Aug 16
> >06:18:43 2005
> >@@ -152,3 +152,127 @@
> >[0]=>
> >string(10) "a lazy dog"
> >  }
> >+--UEXPECTF--
> >+26d4e18734cb2582df5055e2175223df
> >+bool(false)
> >+bool(false)
> >+bool(false)
> >+array(1) {
> >+  [0]=>
> >+  unicode(0) ""
> >+}
> >+array(2) {
> >+  [0]=>
> >+  unicode(0) ""
> >+  [1]=>
> >+  unicode(0) ""
> >+}
> >+array(1) {
> >+  [0]=>
> >+  unicode(0) ""
> >+}
> >+bool(false)
> >+array(1) {
> >+  [0]=>
> >+  unicode(3) "acb"
> >+}
> >+array(1) {
> >+  [0]=>
> >+  unicode(11) "otherstring"
> >+}
> >+array(7) {
> >+  [0]=>
> >+  unicode(0) ""
> >+  [1]=>
> >+  unicode(0) ""
> >+  [2]=>
> >+  unicode(0) ""
> >+  [3]=>
> >+  unicode(0) ""
> >+  [4]=>
> >+  unicode(0) ""
> >+  [5]=>
> >+  unicode(0) ""
> >+  [6]=>
> >+  unicode(0) ""
> >+}
> >+array(1) {
> >+  [0]=>
> >+  unicode(60)
> >+"-=48=--=48=--=48=--=48=--=48=--=48=--=48=--=48=--=48=--=48=-"
> >+}
> >+array(21) {
> >+  [0]=>
> >+  unicode(1) "-"
> >+  [1]=>
> >+  unicode(2) "48"
> >+  [2]=>
> >+  unicode(2) "--"
> >+  [3]=>
> >+  unicode(2) "48"
> >+  [4]=>
> >+  unicode(2) "--"
> >+  [5]=>
> >+  unicode(2) "48"
> >+  [6]=>
> >+  unicode(2) "--"
> >+  [7]=>
> >+  unicode(2) "48"
> >+  [8]=>
> >+  unicode(2) "--"
> >+  [9]=>
> >+  unicode(2) "48"
> >+  [10]=>
> >+  unicode(2) "--"
> >+  [11]=>
> >+  unicode(2) "48"
> >+  [12]=>
> >+  unicode(2) "--"
> >+  [13]=>
> >+  unicode(2) "48"
> >+  [14]=>
> >+  unicode(2) "--"
> >+  [15]=>
> >+  unicode(2) "48"
> >+  [16]=>
> >+  u

RE: [PHP-CVS] cvs: php-src /ext/standard md5.c /ext/standard/tests/strings explode.phpt strcspn.phpt strspn.phptstrstr.phpt

2005-08-16 Thread Dmitry Stogov
May be nice to have, however ASCII to unicode conversion is not usual case.
Usualy we have non ASCII but some encoding (UG(runrime_encoding)).

Dmitry.

> -Original Message-
> From: Andi Gutmans [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, August 17, 2005 4:54 AM
> To: Dmitry Stogov; php-cvs@lists.php.net
> Subject: Re: [PHP-CVS] cvs: php-src /ext/standard md5.c 
> /ext/standard/tests/strings explode.phpt strcspn.phpt 
> strspn.phptstrstr.phpt 
> 
> 
> Shouldn't we have a macro that does this?
> I see lots of places that require the same code.
> -   RETVAL_STRING(md5str, 1);
> +   if (UG(unicode)) {
> +   UChar *u_temp = 
> zend_ascii_to_unicode(md5str, 33
> ZEND_FILE_LINE_CC);
> +   RETVAL_UNICODE(u_temp, 0);
> +   } else {
> +   RETVAL_STRING(md5str, 1);
> +   }
>  }
> 
> Andi
> 
> At 10:18 AM 8/16/2005 +, Dmitry Stogov wrote:
> >dmitry  Tue Aug 16 06:18:43 2005 EDT
> >
> >   Modified files:
> > /php-src/ext/standard   md5.c
> > /php-src/ext/standard/tests/strings explode.phpt strcspn.phpt
> > strspn.phpt strstr.phpt
> >   Log:
> >   Unicode support
> >
> >
> >http://cvs.php.net/diff.php/php-src/ext/standard/md5.c?r1=1.3
> 9&r2=1.40&
> >ty=u
> >Index: php-src/ext/standard/md5.c
> >diff -u php-src/ext/standard/md5.c:1.39 
> php-src/ext/standard/md5.c:1.40
> >--- php-src/ext/standard/md5.c:1.39 Wed Aug  3 10:08:09 2005
> >+++ php-src/ext/standard/md5.c  Tue Aug 16 06:18:41 2005
> >@@ -16,7 +16,7 @@
> > 
> >+
> --+
> >  */
> >
> >-/* $Id: md5.c,v 1.39 2005/08/03 14:08:09 sniper Exp $ */
> >+/* $Id: md5.c,v 1.40 2005/08/16 10:18:41 dmitry Exp $ */
> >
> >  /*
> >   * md5.c - Copyright 1997 Lachlan Roche
> >@@ -61,7 +61,12 @@
> > RETURN_STRINGL(digest, 16, 1);
> > } else {
> > make_digest(md5str, digest);
> >-   RETVAL_STRING(md5str, 1);
> >+   if (UG(unicode)) {
> >+   UChar *u_temp = 
> zend_ascii_to_unicode(md5str, 
> >+ 33
> >ZEND_FILE_LINE_CC);
> >+   RETVAL_UNICODE(u_temp, 0);
> >+   } else {
> >+   RETVAL_STRING(md5str, 1);
> >+   }
> > }
> >
> >  }
> >@@ -108,7 +113,12 @@
> > RETURN_STRINGL(digest, 16, 1);
> > } else {
> > make_digest(md5str, digest);
> >-   RETVAL_STRING(md5str, 1);
> >+   if (UG(unicode)) {
> >+   UChar *u_temp = 
> zend_ascii_to_unicode(md5str, 
> >+ 33
> >ZEND_FILE_LINE_CC);
> >+   RETVAL_UNICODE(u_temp, 0);
> >+   } else {
> >+   RETVAL_STRING(md5str, 1);
> >+   }
> > }
> >  }
> >  /* }}} */ 
> >http://cvs.php.net/diff.php/php-src/ext/standard/tests/string
s/explode.
> >phpt?r1=1.4&r2=1.5&ty=u
> >Index: php-src/ext/standard/tests/strings/explode.phpt
> >diff -u php-src/ext/standard/tests/strings/explode.phpt:1.4 
> >php-src/ext/standard/tests/strings/explode.phpt:1.5
> >--- php-src/ext/standard/tests/strings/explode.phpt:1.4 Sun Jul 18 
> >07:34:28 2004
> >+++ php-src/ext/standard/tests/strings/explode.phpt Tue Aug 16 
> >06:18:43 2005
> >@@ -152,3 +152,127 @@
> >[0]=>
> >string(10) "a lazy dog"
> >  }
> >+--UEXPECTF--
> >+26d4e18734cb2582df5055e2175223df
> >+bool(false)
> >+bool(false)
> >+bool(false)
> >+array(1) {
> >+  [0]=>
> >+  unicode(0) ""
> >+}
> >+array(2) {
> >+  [0]=>
> >+  unicode(0) ""
> >+  [1]=>
> >+  unicode(0) ""
> >+}
> >+array(1) {
> >+  [0]=>
> >+  unicode(0) ""
> >+}
> >+bool(false)
> >+array(1) {
> >+  [0]=>
> >+  unicode(3) "acb"
> >+}
> >+array(1) {
> >+  [0]=>
> >+  unicode(11) "otherstring"
> >+}
> >+array(7) {
> >+  [0]=>
> >+  unicode(0) ""
> >+  [1]=>
> >+  unicode(0) ""
> >+  [2]=>
> >+  unicode(0) ""
> >+  [3]=>
> >+  unicode(0) ""
> >+  [4]=>
> >+  unicode(0) ""
> >+  [5]=>
> >+  unicode(0) ""
> >+  [6]=>
> >+  unicode(0) ""
> >+}
> >+array(1) {
> >+  [0]=>
> >+  unicode(60) 
> >+"-=48=--=48=--=48=--=48=--=48=--=48=--=48=--=48=--=48=--=48=-"
> >+}
> >+array(21) {
> >+  [0]=>
> >+  unicode(1) "-"
> >+  [1]=>
> >+  unicode(2) "48"
> >+  [2]=>
> >+  unicode(2) "--"
> >+  [3]=>
> >+  unicode(2) "48"
> >+  [4]=>
> >+  unicode(2) "--"
> >+  [5]=>
> >+  unicode(2) "48"
> >+  [6]=>
> >+  unicode(2) "--"
> >+  [7]=>
> >+  unicode(2) "48"
> >+  [8]=>
> >+  unicode(2) "--"
> >+  [9]=>
> >+  unicode(2) "48"
> >+  [10]=>
> >+  unicode(2) "--"
> >+  [11]=>
> >+  unicode(2) "48"
> >+  [12]=>
> >+  unicode(2) "--"
> >+  [13]=>
> >+  unicode(2) "48"
> >+  [14]=>
> >+  unicode(2) "--"
> >+  [15]=>
> >+  unicode(2) "48"
> >+  [16]=>
> >+  unicode(2) "--"
> >+  [17]=>
> >+  unicode(2) "48"
> >+  [18]=>
> >+  unicode(2) "--"
> >+  [19]=>
> >+  unicode(2) "48"
> >+  [20]=>
> >+  unicode(1) 

Re: [PHP-CVS] cvs: php-src /ext/standard md5.c /ext/standard/tests/strings explode.phpt strcspn.phpt strspn.phpt strstr.phpt

2005-08-16 Thread Andi Gutmans

Shouldn't we have a macro that does this?
I see lots of places that require the same code.
-   RETVAL_STRING(md5str, 1);
+   if (UG(unicode)) {
+   UChar *u_temp = zend_ascii_to_unicode(md5str, 33 
ZEND_FILE_LINE_CC);

+   RETVAL_UNICODE(u_temp, 0);
+   } else {
+   RETVAL_STRING(md5str, 1);
+   }
}

Andi

At 10:18 AM 8/16/2005 +, Dmitry Stogov wrote:

dmitry  Tue Aug 16 06:18:43 2005 EDT

  Modified files:
/php-src/ext/standard   md5.c
/php-src/ext/standard/tests/strings explode.phpt strcspn.phpt
strspn.phpt strstr.phpt
  Log:
  Unicode support


http://cvs.php.net/diff.php/php-src/ext/standard/md5.c?r1=1.39&r2=1.40&ty=u
Index: php-src/ext/standard/md5.c
diff -u php-src/ext/standard/md5.c:1.39 php-src/ext/standard/md5.c:1.40
--- php-src/ext/standard/md5.c:1.39 Wed Aug  3 10:08:09 2005
+++ php-src/ext/standard/md5.c  Tue Aug 16 06:18:41 2005
@@ -16,7 +16,7 @@
+--+
 */

-/* $Id: md5.c,v 1.39 2005/08/03 14:08:09 sniper Exp $ */
+/* $Id: md5.c,v 1.40 2005/08/16 10:18:41 dmitry Exp $ */

 /*
  * md5.c - Copyright 1997 Lachlan Roche
@@ -61,7 +61,12 @@
RETURN_STRINGL(digest, 16, 1);
} else {
make_digest(md5str, digest);
-   RETVAL_STRING(md5str, 1);
+   if (UG(unicode)) {
+   UChar *u_temp = zend_ascii_to_unicode(md5str, 33 
ZEND_FILE_LINE_CC);

+   RETVAL_UNICODE(u_temp, 0);
+   } else {
+   RETVAL_STRING(md5str, 1);
+   }
}

 }
@@ -108,7 +113,12 @@
RETURN_STRINGL(digest, 16, 1);
} else {
make_digest(md5str, digest);
-   RETVAL_STRING(md5str, 1);
+   if (UG(unicode)) {
+   UChar *u_temp = zend_ascii_to_unicode(md5str, 33 
ZEND_FILE_LINE_CC);

+   RETVAL_UNICODE(u_temp, 0);
+   } else {
+   RETVAL_STRING(md5str, 1);
+   }
}
 }
 /* }}} */
http://cvs.php.net/diff.php/php-src/ext/standard/tests/strings/explode.phpt?r1=1.4&r2=1.5&ty=u
Index: php-src/ext/standard/tests/strings/explode.phpt
diff -u php-src/ext/standard/tests/strings/explode.phpt:1.4 
php-src/ext/standard/tests/strings/explode.phpt:1.5
--- php-src/ext/standard/tests/strings/explode.phpt:1.4 Sun Jul 18 
07:34:28 2004
+++ php-src/ext/standard/tests/strings/explode.phpt Tue Aug 16 
06:18:43 2005

@@ -152,3 +152,127 @@
   [0]=>
   string(10) "a lazy dog"
 }
+--UEXPECTF--
+26d4e18734cb2582df5055e2175223df
+bool(false)
+bool(false)
+bool(false)
+array(1) {
+  [0]=>
+  unicode(0) ""
+}
+array(2) {
+  [0]=>
+  unicode(0) ""
+  [1]=>
+  unicode(0) ""
+}
+array(1) {
+  [0]=>
+  unicode(0) ""
+}
+bool(false)
+array(1) {
+  [0]=>
+  unicode(3) "acb"
+}
+array(1) {
+  [0]=>
+  unicode(11) "otherstring"
+}
+array(7) {
+  [0]=>
+  unicode(0) ""
+  [1]=>
+  unicode(0) ""
+  [2]=>
+  unicode(0) ""
+  [3]=>
+  unicode(0) ""
+  [4]=>
+  unicode(0) ""
+  [5]=>
+  unicode(0) ""
+  [6]=>
+  unicode(0) ""
+}
+array(1) {
+  [0]=>
+  unicode(60) "-=48=--=48=--=48=--=48=--=48=--=48=--=48=--=48=--=48=--=48=-"
+}
+array(21) {
+  [0]=>
+  unicode(1) "-"
+  [1]=>
+  unicode(2) "48"
+  [2]=>
+  unicode(2) "--"
+  [3]=>
+  unicode(2) "48"
+  [4]=>
+  unicode(2) "--"
+  [5]=>
+  unicode(2) "48"
+  [6]=>
+  unicode(2) "--"
+  [7]=>
+  unicode(2) "48"
+  [8]=>
+  unicode(2) "--"
+  [9]=>
+  unicode(2) "48"
+  [10]=>
+  unicode(2) "--"
+  [11]=>
+  unicode(2) "48"
+  [12]=>
+  unicode(2) "--"
+  [13]=>
+  unicode(2) "48"
+  [14]=>
+  unicode(2) "--"
+  [15]=>
+  unicode(2) "48"
+  [16]=>
+  unicode(2) "--"
+  [17]=>
+  unicode(2) "48"
+  [18]=>
+  unicode(2) "--"
+  [19]=>
+  unicode(2) "48"
+  [20]=>
+  unicode(1) "-"
+}
+array(3) {
+  [0]=>
+  unicode(10) "a lazy dog"
+  [1]=>
+  unicode(5) "jumps"
+  [2]=>
+  unicode(4) "over"
+}
+array(2) {
+  [0]=>
+  unicode(10) "a lazy dog"
+  [1]=>
+  unicode(5) "jumps"
+}
+array(1) {
+  [0]=>
+  unicode(10) "a lazy dog"
+}
+array(0) {
+}
+array(0) {
+}
+array(2) {
+  [0]=>
+  unicode(10) "a lazy dog"
+  [1]=>
+  unicode(11) "jumps::over"
+}
+array(1) {
+  [0]=>
+  unicode(10) "a lazy dog"
+}
http://cvs.php.net/diff.php/php-src/ext/standard/tests/strings/strcspn.phpt?r1=1.1&r2=1.2&ty=u
Index: php-src/ext/standard/tests/strings/strcspn.phpt
diff -u php-src/ext/standard/tests/strings/strcspn.phpt:1.1 
php-src/ext/standard/tests/strings/strcspn.phpt:1.2
--- php-src/ext/standard/tests/strings/strcspn.phpt:1.1 Sat Oct 26 
12:48:03 2002
+++ php-src/ext/standard/tests/strings/strcspn.phpt Tue Aug 16 
06:18:43 2005

@@ -16,3 +16,9 @@
 int(0)
 int(7)
 int(6)
+--UEXPECT--
+unicode(25) " bbb "
+unicode(4) "1234"
+int(0)
+int(7)
+int(6)
http://cvs.php.net/diff.php/php-src/

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

2005-08-16 Thread Marcus Boerger
helly   Tue Aug 16 16:22:38 2005 EDT

  Modified files:  
/php-src/ext/standard   string.c 
  Log:
  - TSRM Fix
  
http://cvs.php.net/diff.php/php-src/ext/standard/string.c?r1=1.456&r2=1.457&ty=u
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.456 php-src/ext/standard/string.c:1.457
--- php-src/ext/standard/string.c:1.456 Tue Aug 16 12:57:59 2005
+++ php-src/ext/standard/string.c   Tue Aug 16 16:22:33 2005
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: string.c,v 1.456 2005/08/16 16:57:59 tony2001 Exp $ */
+/* $Id: string.c,v 1.457 2005/08/16 20:22:33 helly Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -1147,6 +1147,7 @@
int numelems, i;
HashPositionpos;
zval**tmp;
+   TSRMLS_FETCH();
 
if (Z_TYPE_P(delim) != IS_UNICODE && Z_TYPE_P(delim) != IS_BINARY) {
convert_to_string_ex(&delim);

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



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

2005-08-16 Thread Marcus Boerger
helly   Tue Aug 16 16:15:22 2005 EDT

  Modified files:  
/php-src/ext/soap   php_encoding.c 
  Log:
  - TSRM Fix
  
http://cvs.php.net/diff.php/php-src/ext/soap/php_encoding.c?r1=1.103&r2=1.104&ty=u
Index: php-src/ext/soap/php_encoding.c
diff -u php-src/ext/soap/php_encoding.c:1.103 
php-src/ext/soap/php_encoding.c:1.104
--- php-src/ext/soap/php_encoding.c:1.103   Mon Aug  8 05:53:53 2005
+++ php-src/ext/soap/php_encoding.c Tue Aug 16 16:15:21 2005
@@ -17,7 +17,7 @@
   |  Dmitry Stogov <[EMAIL PROTECTED]> |
   +--+
 */
-/* $Id: php_encoding.c,v 1.103 2005/08/08 09:53:53 dmitry Exp $ */
+/* $Id: php_encoding.c,v 1.104 2005/08/16 20:15:21 helly Exp $ */
 
 #include 
 
@@ -1162,9 +1162,11 @@
xmlNodePtr trav;
sdlPtr sdl;
sdlTypePtr sdlType = type->sdl_type;
-   zend_class_entry *ce = ZEND_STANDARD_CLASS_DEF_PTR;
+   zend_class_entry *ce;
zend_bool redo_any = 0;
TSRMLS_FETCH();
+   
+   ce = ZEND_STANDARD_CLASS_DEF_PTR;
 
if (SOAP_GLOBAL(class_map) && type->type_str) {
zval **classname;

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



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

2005-08-16 Thread Andrei Zmievski
andrei  Tue Aug 16 15:45:01 2005 EDT

  Modified files:  
/php-src/ext/standard   md5.c 
  Log:
  md5() and md5_file() should return binary strings when raw_output is
  set.
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/md5.c?r1=1.40&r2=1.41&ty=u
Index: php-src/ext/standard/md5.c
diff -u php-src/ext/standard/md5.c:1.40 php-src/ext/standard/md5.c:1.41
--- php-src/ext/standard/md5.c:1.40 Tue Aug 16 06:18:41 2005
+++ php-src/ext/standard/md5.c  Tue Aug 16 15:45:00 2005
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: md5.c,v 1.40 2005/08/16 10:18:41 dmitry Exp $ */
+/* $Id: md5.c,v 1.41 2005/08/16 19:45:00 andrei Exp $ */
 
 /* 
  * md5.c - Copyright 1997 Lachlan Roche 
@@ -58,7 +58,7 @@
PHP_MD5Update(&context, arg, arg_len);
PHP_MD5Final(digest, &context);
if (raw_output) {
-   RETURN_STRINGL(digest, 16, 1);
+   RETURN_BINARYL(digest, 16, 1);
} else {
make_digest(md5str, digest);
if (UG(unicode)) {
@@ -110,7 +110,7 @@
}
 
if (raw_output) {
-   RETURN_STRINGL(digest, 16, 1);
+   RETURN_BINARYL(digest, 16, 1);
} else {
make_digest(md5str, digest);
if (UG(unicode)) {

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



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

2005-08-16 Thread Andrei Zmievski
andrei  Tue Aug 16 15:43:24 2005 EDT

  Modified files:  
/php-src/ext/pdopdo_stmt.c 
  Log:
  And here
  
  
http://cvs.php.net/diff.php/php-src/ext/pdo/pdo_stmt.c?r1=1.121&r2=1.122&ty=u
Index: php-src/ext/pdo/pdo_stmt.c
diff -u php-src/ext/pdo/pdo_stmt.c:1.121 php-src/ext/pdo/pdo_stmt.c:1.122
--- php-src/ext/pdo/pdo_stmt.c:1.121Tue Aug 16 12:29:13 2005
+++ php-src/ext/pdo/pdo_stmt.c  Tue Aug 16 15:43:23 2005
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: pdo_stmt.c,v 1.121 2005/08/16 16:29:13 dmitry Exp $ */
+/* $Id: pdo_stmt.c,v 1.122 2005/08/16 19:43:23 andrei Exp $ */
 
 /* The PDO Statement Handle Class */
 
@@ -800,7 +800,7 @@
fetch_value(stmt, &val, i++ TSRMLS_CC);
if (Z_TYPE(val) != IS_NULL) {
convert_to_text(&val);
-   if 
(zend_u_lookup_class(Z_TYPE(val), Z_STRVAL(val), Z_STRLEN(val), &cep TSRMLS_CC) 
== FAILURE) {
+   if 
(zend_u_lookup_class(Z_TYPE(val), Z_UNIVAL(val), Z_UNILEN(val), &cep TSRMLS_CC) 
== FAILURE) {
stmt->fetch.cls.ce = 
ZEND_STANDARD_CLASS_DEF_PTR;
} else {
stmt->fetch.cls.ce = 
*cep;

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



Re: [PHP-CVS] cvs: php-src /ext/simplexml simplexml.c /ext/standard http_fopen_wrapper.c

2005-08-16 Thread Andi Gutmans

never mind. i thought you were changing a PHP function :)

At 06:05 AM 8/16/2005 +, Rolland Santimano wrote:

rolland Tue Aug 16 02:05:00 2005 EDT

  Modified files:
/php-src/ext/simplexml  simplexml.c
/php-src/ext/standard   http_fopen_wrapper.c
  Log:
  Updated calls to php_trim() to provide arg for returned string type


http://cvs.php.net/diff.php/php-src/ext/simplexml/simplexml.c?r1=1.154&r2=1.155&ty=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.154 
php-src/ext/simplexml/simplexml.c:1.155

--- php-src/ext/simplexml/simplexml.c:1.154 Fri Aug 12 10:08:25 2005
+++ php-src/ext/simplexml/simplexml.c   Tue Aug 16 02:04:58 2005
@@ -18,7 +18,7 @@
   +--+
 */

-/* $Id: simplexml.c,v 1.154 2005/08/12 14:08:25 sebastian Exp $ */
+/* $Id: simplexml.c,v 1.155 2005/08/16 06:04:58 rolland Exp $ */

 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -337,7 +337,7 @@
trim_zv = *member;
zval_copy_ctor(&trim_zv);
convert_to_string(&trim_zv);
-   php_trim(Z_STRVAL(trim_zv), Z_STRLEN(trim_zv), 
NULL, 0, &tmp_zv, 3 TSRMLS_CC);
+   php_trim(Z_STRVAL(trim_zv), Z_STRLEN(trim_zv), 
NULL, 0, IS_STRING, &tmp_zv, 3 TSRMLS_CC);

zval_dtor(&trim_zv);
member = &tmp_zv;
}
@@ -1736,7 +1736,7 @@
 {
php_info_print_table_start();
php_info_print_table_header(2, "Simplexml support", "enabled");
-   php_info_print_table_row(2, "Revision", "$Revision: 1.154 $");
+   php_info_print_table_row(2, "Revision", "$Revision: 1.155 $");
php_info_print_table_row(2, "Schema support",
 #ifdef LIBXML_SCHEMAS_ENABLED
"enabled");
http://cvs.php.net/diff.php/php-src/ext/standard/http_fopen_wrapper.c?r1=1.99&r2=1.100&ty=u
Index: php-src/ext/standard/http_fopen_wrapper.c
diff -u php-src/ext/standard/http_fopen_wrapper.c:1.99 
php-src/ext/standard/http_fopen_wrapper.c:1.100
--- php-src/ext/standard/http_fopen_wrapper.c:1.99  Wed Aug  3 
10:08:04 2005

+++ php-src/ext/standard/http_fopen_wrapper.c   Tue Aug 16 02:04:59 2005
@@ -19,7 +19,7 @@
|  Sara Golemon <[EMAIL PROTECTED]>  |
+--+
  */
-/* $Id: http_fopen_wrapper.c,v 1.99 2005/08/03 14:08:04 sniper Exp $ */
+/* $Id: http_fopen_wrapper.c,v 1.100 2005/08/16 06:04:59 rolland Exp $ */

 #include "php.h"
 #include "php_globals.h"
@@ -265,7 +265,7 @@
Z_STRLEN_PP(tmpzval)) {
/* Remove newlines and spaces from start and end,
   php_trim will estrndup() */
-   tmp = php_trim(Z_STRVAL_PP(tmpzval), Z_STRLEN_PP(tmpzval), 
NULL, 0, NULL, 3 TSRMLS_CC);
+   tmp = php_trim(Z_STRVAL_PP(tmpzval), Z_STRLEN_PP(tmpzval), 
NULL, 0, IS_STRING, NULL, 3 TSRMLS_CC);

if (strlen(tmp) > 0) {
if (!header_init) { /* Remove post headers for 
redirects */

int l = strlen(tmp);
@@ -291,7 +291,7 @@
}
}
efree(tmp_c);
-   tmp_c = php_trim(tmp, strlen(tmp), NULL, 
0, NULL, 3 TSRMLS_CC);
+   tmp_c = php_trim(tmp, strlen(tmp), NULL, 
0, IS_STRING, NULL, 3 TSRMLS_CC);

efree(tmp);
tmp = tmp_c;
}

--
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 /ext/standard php_string.h string.c

2005-08-16 Thread Andi Gutmans
In-Reply-To: <[EMAIL PROTECTED]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"; format=flowed

why do we need this?
shouldn't the return type be the same as the string...?

At 06:02 AM 8/16/2005 +, Rolland Santimano wrote:
>rolland Tue Aug 16 02:02:57 2005 EDT
>
>   Modified files:
> /php-src/ext/standard   php_string.h string.c
>   Log:
>   php_trim() takes extra arg to determine string type to be returned
>
>
>http://cvs.php.net/diff.php/php-src/ext/standard/php_string.h?r1=1.88&r2=1.89&ty=u
>Index: php-src/ext/standard/php_string.h
>diff -u php-src/ext/standard/php_string.h:1.88 
>php-src/ext/standard/php_string.h:1.89
>--- php-src/ext/standard/php_string.h:1.88  Thu Aug 11 19:35:59 2005
>+++ php-src/ext/standard/php_string.h   Tue Aug 16 02:02:55 2005
>@@ -17,7 +17,7 @@
> +--+
>  */
>
>-/* $Id: php_string.h,v 1.88 2005/08/11 23:35:59 andrei Exp $ */
>+/* $Id: php_string.h,v 1.89 2005/08/16 06:02:55 rolland Exp $ */
>
>  /* Synced with php 3.0 revision 1.43 1999-06-16 [ssb] */
>
>@@ -132,7 +132,7 @@
> int needle_len, char *str, int str_len, int *_new_length, 
> int case_sensitivity, int *replace_count);
>  PHPAPI char *php_str_to_str(char *haystack, int length, char *needle,
> int needle_len, char *str, int str_len, int *_new_length);
>-PHPAPI char *php_trim(char *c, int len, char *what, int what_len, zval 
>*return_value, int mode TSRMLS_DC);
>+PHPAPI char *php_trim(char *c, int len, char *what, int what_len, 
>zend_uchar str_type, zval *return_value, int mode TSRMLS_DC);
>  PHPAPI size_t php_strip_tags(char *rbuf, int len, int *state, char 
> *allow, int allow_len);
>  PHPAPI int php_char_to_str_ex(char *str, uint len, char from, char *to, 
> int to_len, pval *result, int case_sensitivity, int *replace_count);
>  PHPAPI int php_char_to_str(char *str, uint len, char from, char *to, int 
> to_len, pval *result);
>http://cvs.php.net/diff.php/php-src/ext/standard/string.c?r1=1.453&r2=1.454&ty=u
>Index: php-src/ext/standard/string.c
>diff -u php-src/ext/standard/string.c:1.453 
>php-src/ext/standard/string.c:1.454
>--- php-src/ext/standard/string.c:1.453 Mon Aug 15 15:12:59 2005
>+++ php-src/ext/standard/string.c   Tue Aug 16 02:02:56 2005
>@@ -18,7 +18,7 @@
> +--+
>   */
>
>-/* $Id: string.c,v 1.453 2005/08/15 19:12:59 johannes Exp $ */
>+/* $Id: string.c,v 1.454 2005/08/16 06:02:56 rolland Exp $ */
>
>  /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
>
>@@ -538,7 +538,7 @@
>   * mode 3 : trim left and right
>   * what indicates which chars are to be trimmed. NULL->default (' 
> \t\n\r\v\0')
>   */
>-PHPAPI char *php_trim(char *c, int len, char *what, int what_len, zval 
>*return_value, int mode TSRMLS_DC)
>+PHPAPI char *php_trim(char *c, int len, char *what, int what_len, 
>zend_uchar str_type, zval *return_value, int mode TSRMLS_DC)
>  {
> register int i;
> int trimmed = 0;
>@@ -572,7 +572,11 @@
> }
>
> if (return_value) {
>-   RETVAL_STRINGL(c, len, 1);
>+   if ( str_type == IS_BINARY ) {
>+   RETVAL_BINARYL(c, len, 1);
>+   } else {
>+   RETVAL_STRINGL(c, len, 1);
>+   }
> } else {
> return estrndup(c, len);
> }
>@@ -750,13 +754,13 @@
> if ( str_type == IS_UNICODE ) {
> php_u_trim(str, str_len, what, what_len, 
> return_value, mode TSRMLS_CC);
> } else {
>-   php_trim(str, str_len, what, what_len, 
>return_value, mode TSRMLS_CC);
>+   php_trim(str, str_len, what, what_len, str_type, 
>return_value, mode TSRMLS_CC);
> }
> } else {
> if ( str_type == IS_UNICODE ) {
> php_u_trim(str, str_len, NULL, 0, return_value, 
> mode TSRMLS_CC);
> } else {
>-   php_trim(str, str_len, NULL, 0, return_value, mode 
>TSRMLS_CC);
>+   php_trim(str, str_len, NULL, 0, str_type, 
>return_value, mode TSRMLS_CC);
> }
> }
>  }
>
>--
>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/pdo pdo_dbh.c

2005-08-16 Thread Andrei Zmievski
andrei  Tue Aug 16 14:22:22 2005 EDT

  Modified files:  
/php-src/ext/pdopdo_dbh.c 
  Log:
  And here.
  
  
http://cvs.php.net/diff.php/php-src/ext/pdo/pdo_dbh.c?r1=1.86&r2=1.87&ty=u
Index: php-src/ext/pdo/pdo_dbh.c
diff -u php-src/ext/pdo/pdo_dbh.c:1.86 php-src/ext/pdo/pdo_dbh.c:1.87
--- php-src/ext/pdo/pdo_dbh.c:1.86  Tue Aug 16 12:29:13 2005
+++ php-src/ext/pdo/pdo_dbh.c   Tue Aug 16 14:22:22 2005
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: pdo_dbh.c,v 1.86 2005/08/16 16:29:13 dmitry Exp $ */
+/* $Id: pdo_dbh.c,v 1.87 2005/08/16 18:22:22 andrei Exp $ */
 
 /* The PDO Database Handle Class */
 
@@ -516,7 +516,7 @@
if (ZEND_NUM_ARGS() > 1 && SUCCESS == 
zend_hash_index_find(Z_ARRVAL_P(options), PDO_ATTR_STATEMENT_CLASS, 
(void**)&opt)) {
if (zend_hash_index_find(Z_ARRVAL_PP(opt), 0, (void**)&item) == 
FAILURE
|| (Z_TYPE_PP(item) != IS_STRING && Z_TYPE_PP(item) != 
IS_UNICODE)
-   || zend_u_lookup_class(Z_TYPE_PP(item), 
Z_STRVAL_PP(item), Z_STRLEN_PP(item), &pce TSRMLS_CC) == FAILURE
+   || zend_u_lookup_class(Z_TYPE_PP(item), 
Z_UNIVAL_PP(item), Z_UNILEN_PP(item), &pce TSRMLS_CC) == FAILURE
) {
pdo_raise_impl_error(dbh, NULL, "HY000", 
"PDO_ATTR_STATEMENT_CLASS requires format 
array(classname, ctor_args); "

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



[PHP-CVS] cvs: php-src(PHP_5_0) /main main.c

2005-08-16 Thread Marcus Boerger
helly   Tue Aug 16 14:11:35 2005 EDT

  Modified files:  (Branch: PHP_5_0)
/php-src/main   main.c 
  Log:
  - MFH: Prevent E_STRICT from ending up as exception
  
http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.604.2.21&r2=1.604.2.22&ty=u
Index: php-src/main/main.c
diff -u php-src/main/main.c:1.604.2.21 php-src/main/main.c:1.604.2.22
--- php-src/main/main.c:1.604.2.21  Sat Jul 16 08:14:44 2005
+++ php-src/main/main.c Tue Aug 16 14:11:34 2005
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: main.c,v 1.604.2.21 2005/07/16 12:14:44 hyanantha Exp $ */
+/* $Id: main.c,v 1.604.2.22 2005/08/16 18:11:34 helly Exp $ */
 
 /* {{{ includes
  */
@@ -653,6 +653,9 @@
case E_PARSE:
/* fatal errors are real errors and cannot be 
made exceptions */
break;
+   case E_STRICT:
+   /* for the sake of BC to old damaged code */
+   break;
case E_NOTICE:
case E_USER_NOTICE:
/* notices are no errors and are not treated as 
such like E_WARNINGS */

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



[PHP-CVS] cvs: php-src(PHP_5_1) /main main.c

2005-08-16 Thread Marcus Boerger
helly   Tue Aug 16 14:10:35 2005 EDT

  Modified files:  (Branch: PHP_5_1)
/php-src/main   main.c 
  Log:
  - Prevent E_STRICT from ending up as exception
  
http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.640&r2=1.640.2.1&ty=u
Index: php-src/main/main.c
diff -u php-src/main/main.c:1.640 php-src/main/main.c:1.640.2.1
--- php-src/main/main.c:1.640   Fri Aug  5 17:44:26 2005
+++ php-src/main/main.c Tue Aug 16 14:10:34 2005
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: main.c,v 1.640 2005/08/05 21:44:26 sniper Exp $ */
+/* $Id: main.c,v 1.640.2.1 2005/08/16 18:10:34 helly Exp $ */
 
 /* {{{ includes
  */
@@ -657,6 +657,9 @@
case E_PARSE:
/* fatal errors are real errors and cannot be 
made exceptions */
break;
+   case E_STRICT:
+   /* for the sake of BC to old damaged code */
+   break;
case E_NOTICE:
case E_USER_NOTICE:
/* notices are no errors and are not treated as 
such like E_WARNINGS */

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



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

2005-08-16 Thread Marcus Boerger
helly   Tue Aug 16 14:09:28 2005 EDT

  Modified files:  
/php-src/main   main.c 
  Log:
  - Prevent E_STRICT from ending up as exception
  
http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.643&r2=1.644&ty=u
Index: php-src/main/main.c
diff -u php-src/main/main.c:1.643 php-src/main/main.c:1.644
--- php-src/main/main.c:1.643   Mon Aug 15 18:31:59 2005
+++ php-src/main/main.c Tue Aug 16 14:09:27 2005
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: main.c,v 1.643 2005/08/15 22:31:59 sniper Exp $ */
+/* $Id: main.c,v 1.644 2005/08/16 18:09:27 helly Exp $ */
 
 /* {{{ includes
  */
@@ -774,6 +774,9 @@
case E_PARSE:
/* fatal errors are real errors and cannot be 
made exceptions */
break;
+   case E_STRICT:
+   /* for the sake of BC to old damaged code */
+   break;
case E_NOTICE:
case E_USER_NOTICE:
/* notices are no errors and are not treated as 
such like E_WARNINGS */

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



[PHP-CVS] cvs: php-src /ext/standard php_smart_str.h /main spprintf.c

2005-08-16 Thread Derick Rethans
derick  Tue Aug 16 14:02:41 2005 EDT

  Modified files:  
/php-src/ext/standard   php_smart_str.h 
/php-src/main   spprintf.c 
  Log:
  - Fixed a couple of bugs in the new smart_str macros, and allow them to
allocate two extra bytes (so that we can pad them with two \0's for UTF-16)
  - Fixed usage of smart_str's in the PAD and INS_STRING macros.
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/php_smart_str.h?r1=1.31&r2=1.32&ty=u
Index: php-src/ext/standard/php_smart_str.h
diff -u php-src/ext/standard/php_smart_str.h:1.31 
php-src/ext/standard/php_smart_str.h:1.32
--- php-src/ext/standard/php_smart_str.h:1.31   Sun Aug 14 13:14:40 2005
+++ php-src/ext/standard/php_smart_str.hTue Aug 16 14:02:39 2005
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_smart_str.h,v 1.31 2005/08/14 17:14:40 helly Exp $ */
+/* $Id: php_smart_str.h,v 1.32 2005/08/16 18:02:39 derick Exp $ */
 
 #ifndef PHP_SMART_STR_H
 #define PHP_SMART_STR_H
@@ -28,9 +28,12 @@
 #include 
 #endif
 
+/* It's safe to write to "one behind the length" as we allocate two extra bytes
+ * to allow for Unicode trailers */
 #define smart_str_0(x) do {
\
if ((x)->c) {   
\
(x)->c[(x)->len] = '\0';
\
+   (x)->c[(x)->len + 1] = '\0';
\
}   
\
 } while (0)
 
@@ -49,7 +52,7 @@
 #endif
 
 #define SMART_STR_DO_REALLOC(d, what) \
-   (d)->c = SMART_STR_REALLOC((d)->c, (d)->a + 1, (what))
+   (d)->c = SMART_STR_REALLOC((d)->c, (d)->a + 2, (what))
 
 #define smart_str_alloc4(d, n, what, newlen) do {  
\
if (!(d)->c) {  
\
@@ -78,15 +81,15 @@
 #define smart_str_appends(dest, src) \
smart_str_appendl((dest), (src), strlen(src))
 
-/* normall character appending */
+/* normal character appending */
 #define smart_str_appendc(dest, c) \
smart_str_appendc_ex((dest), (c), 0)
 
 /* appending of a single UTF-16 code unit (2 byte)*/
-#define smart_str_append2c(dest, c) while (0) {\
+#define smart_str_append2c(dest, c) do {   \
smart_str_appendc_ex((dest), (c&0xFF), 0);  \
smart_str_appendc_ex((dest), (c&0xFF00 ? c>>8 : '\0'), 0);  \
-}
+} while (0)
 
 #define smart_str_free(s) \
smart_str_free_ex((s), 0)
http://cvs.php.net/diff.php/php-src/main/spprintf.c?r1=1.31&r2=1.32&ty=u
Index: php-src/main/spprintf.c
diff -u php-src/main/spprintf.c:1.31 php-src/main/spprintf.c:1.32
--- php-src/main/spprintf.c:1.31Mon Aug 15 03:19:10 2005
+++ php-src/main/spprintf.c Tue Aug 16 14:02:41 2005
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: spprintf.c,v 1.31 2005/08/15 07:19:10 dmitry Exp $ */
+/* $Id: spprintf.c,v 1.32 2005/08/16 18:02:41 derick Exp $ */
 
 /* This is the spprintf implementation.
  * It has emerged from apache snprintf. See original header:
@@ -126,22 +126,22 @@
}   
\
 } while (0)
 
-#define INS_STRING(unicode, s_uni, xbuf, s, slen)  \
+#define INS_STRING(unicode, s_unicode, xbuf, s, s_len) \
 do {   
\
if (unicode) {  
\
-   size_t newlen, p, sz = 2*(slen);\
+   size_t newlen, p, sz = 2*(s_len);   \
smart_str_alloc(xbuf, (sz), 0); \
-   if (s_uni) {
\
+   if (s_unicode) {
\
memcpy(xbuf->c + xbuf->len, s, (sz));   \
} else {
\
-   p = (slen); 
\
+   p = (s_len);
\
while(p--) {\
-   smart_str_append2c(xbuf, *s++); \
+   smart_str_append2c(xbuf, *s);   \
+   *s++;  

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

2005-08-16 Thread Andrei Zmievski


On Aug 16, 2005, at 5:04 AM, Rolland Santimano wrote:


+   if (Z_TYPE_P(delim) != IS_UNICODE && Z_TYPE_P(delim) != IS_BINARY) {
+   convert_to_string_ex(&delim);
+   }
+	Z_TYPE_P(retval) = return_type = Z_TYPE_P(delim); /* ... to start 
off */


This is not correct. If the delimiter is not Unicode or binary, we 
can't just convert it to string. It needs to be dependent on 
UG(unicode) setting. Please use convert_to_text_ex() macro for that.

+   for (i = 1 ; i <= numelems ; i++) {
+		if (zend_hash_get_current_data_ex(Z_ARRVAL_P(arr), (void **)&tmp, 
&pos) != SUCCESS) {

+   /* Shouldn't happen ? */
+   return;
}


The preferred way of iterating over Zend hashes is exactly as it was 
before your change, with a while() or for() loop without relying on 
what zend_hash_num_elements() returns.



zend_hash_move_forward_ex(Z_ARRVAL_P(arr), &pos);
+   if (Z_TYPE_PP(tmp) != return_type) {
+   /* Convert to common type, if possible */
+   if (return_type == IS_UNICODE) {
+   if (Z_TYPE_PP(tmp) == IS_BINARY) {
+   /* ERROR */
+	php_error_docref(NULL TSRMLS_CC, E_WARNING, "Mixed string 
types");


Error message needs to be more explicit, "Cannot mix binary type with 
other string types" perhaps.



+   /* Append elem */
+   if (return_type == IS_UNICODE) {
+   Z_USTRVAL_P(retval) = eurealloc(Z_USTRVAL_P(retval),
+   
Z_USTRLEN_P(retval)+Z_USTRLEN_PP(tmp));
+   memcpy(Z_USTRVAL_P(retval)+Z_USTRLEN_P(retval),
+  Z_USTRVAL_PP(tmp), 
Z_USTRLEN_PP(tmp)*sizeof(UChar));


You can use UBYTES() macro here.


 /* }}} */

@@ -1178,41 +1257,41 @@
Joins array elements placing glue string between items and return 
one string */

 PHP_FUNCTION(implode)
 {
-   zval **arg1 = NULL, **arg2 = NULL, *delim, *arr;
-   int argc = ZEND_NUM_ARGS();
+   zval**arg1 = NULL, **arg2 = NULL;
+   zval*delim, *arr;
+   int argc = ZEND_NUM_ARGS();

-   if (argc < 1 || argc > 2 ||
-   zend_get_parameters_ex(argc, &arg1, &arg2) == FAILURE) {
+   if (argc < 1 || argc > 2) {
WRONG_PARAM_COUNT;
}
+   if (zend_get_parameters_ex(argc, &arg1, &arg2) == FAILURE) {
+   return;
+   }

if (argc == 1) {
if (Z_TYPE_PP(arg1) != IS_ARRAY) {
 			php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument to implode 
must be an array.");

-   return;
+   RETURN_FALSE;
+   } else {
+   MAKE_STD_ZVAL(delim);
+   ZVAL_STRINGL(delim, "", sizeof("")-1, 0);
+   SEPARATE_ZVAL(arg1);
+   arr = *arg1;
}


Why not make a delim of the correct type here right away instead of 
passing it off to convert_to_text_ex() in php_implode()?


-Andrei

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



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

2005-08-16 Thread Antony Dovgal
tony2001Tue Aug 16 12:58:00 2005 EDT

  Modified files:  
/php-src/ext/standard   string.c 
  Log:
  nuke unused vars
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/string.c?r1=1.455&r2=1.456&ty=u
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.455 php-src/ext/standard/string.c:1.456
--- php-src/ext/standard/string.c:1.455 Tue Aug 16 08:04:13 2005
+++ php-src/ext/standard/string.c   Tue Aug 16 12:57:59 2005
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: string.c,v 1.455 2005/08/16 12:04:13 rolland Exp $ */
+/* $Id: string.c,v 1.456 2005/08/16 16:57:59 tony2001 Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -1147,8 +1147,6 @@
int numelems, i;
HashPositionpos;
zval**tmp;
-   void*elem;
-   int32_t elem_chars, elem_len;
 
if (Z_TYPE_P(delim) != IS_UNICODE && Z_TYPE_P(delim) != IS_BINARY) {
convert_to_string_ex(&delim);

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



[PHP-CVS] cvs: php-src /ext/pdo pdo_dbh.c pdo_stmt.c /ext/pdo/tests pdo_016.phpt

2005-08-16 Thread Dmitry Stogov
dmitry  Tue Aug 16 12:29:16 2005 EDT

  Modified files:  
/php-src/ext/pdopdo_dbh.c pdo_stmt.c 
/php-src/ext/pdo/tests  pdo_016.phpt 
  Log:
  Unicode support
  
  
http://cvs.php.net/diff.php/php-src/ext/pdo/pdo_dbh.c?r1=1.85&r2=1.86&ty=u
Index: php-src/ext/pdo/pdo_dbh.c
diff -u php-src/ext/pdo/pdo_dbh.c:1.85 php-src/ext/pdo/pdo_dbh.c:1.86
--- php-src/ext/pdo/pdo_dbh.c:1.85  Mon Aug 15 12:13:02 2005
+++ php-src/ext/pdo/pdo_dbh.c   Tue Aug 16 12:29:13 2005
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: pdo_dbh.c,v 1.85 2005/08/15 16:13:02 dmitry Exp $ */
+/* $Id: pdo_dbh.c,v 1.86 2005/08/16 16:29:13 dmitry Exp $ */
 
 /* The PDO Database Handle Class */
 
@@ -428,10 +428,24 @@
zval z_key;
 
MAKE_STD_ZVAL(query_string);
-   ZVAL_STRINGL(query_string, stmt->query_string, stmt->query_stringlen, 
1);
-   ZVAL_STRINGL(&z_key, "queryString", sizeof("queryString")-1, 0);
+   if (UG(unicode)) {
+   UErrorCode status = U_ZERO_ERROR;
+   UChar *u_str;
+   int32_t u_len;
+
+   
zend_convert_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &u_str, 
&u_len, stmt->query_string, stmt->query_stringlen, &status);
+   ZVAL_UNICODEL(query_string, u_str, u_len, 0);
+   u_str = zend_ascii_to_unicode("queryString", 
sizeof("queryString") ZEND_FILE_LINE_CC);
+   ZVAL_UNICODEL(&z_key, u_str, sizeof("queryString")-1, 0);
+   } else {
+   ZVAL_STRINGL(query_string, stmt->query_string, 
stmt->query_stringlen, 1);
+   ZVAL_STRINGL(&z_key, "queryString", sizeof("queryString")-1, 0);
+   }
std_object_handlers.write_property(object, &z_key, query_string 
TSRMLS_CC);
zval_ptr_dtor(&query_string);
+   if (UG(unicode)) {
+   zval_dtor(&z_key);
+   }
 
if (dbstmt_ce->constructor) {
zend_fcall_info fci;
http://cvs.php.net/diff.php/php-src/ext/pdo/pdo_stmt.c?r1=1.120&r2=1.121&ty=u
Index: php-src/ext/pdo/pdo_stmt.c
diff -u php-src/ext/pdo/pdo_stmt.c:1.120 php-src/ext/pdo/pdo_stmt.c:1.121
--- php-src/ext/pdo/pdo_stmt.c:1.120Mon Aug 15 12:13:02 2005
+++ php-src/ext/pdo/pdo_stmt.c  Tue Aug 16 12:29:13 2005
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: pdo_stmt.c,v 1.120 2005/08/15 16:13:02 dmitry Exp $ */
+/* $Id: pdo_stmt.c,v 1.121 2005/08/16 16:29:13 dmitry Exp $ */
 
 /* The PDO Statement Handle Class */
 
@@ -492,7 +492,19 @@

case PDO_PARAM_STR:
if (value && !(value_len == 0 && 
stmt->dbh->oracle_nulls == PDO_NULL_EMPTY_STRING)) {
-   ZVAL_STRINGL(dest, value, value_len, 
!caller_frees);
+   if (UG(unicode)) {
+   UErrorCode status = U_ZERO_ERROR;
+   UChar *u_str;
+   int32_t u_len;
+   
+   
zend_convert_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &u_str, 
&u_len, value, value_len, &status);
+   ZVAL_UNICODEL(dest, u_str, u_len, 0);
+   if (caller_frees) {
+   efree(value);
+   }
+   } else {
+   ZVAL_STRINGL(dest, value, value_len, 
!caller_frees);
+   }
if (caller_frees) {
caller_frees = 0;
}
@@ -787,8 +799,8 @@
INIT_PZVAL(&val);
fetch_value(stmt, &val, i++ TSRMLS_CC);
if (Z_TYPE(val) != IS_NULL) {
-   convert_to_string(&val);
-   if 
(zend_lookup_class(Z_STRVAL(val), Z_STRLEN(val), &cep TSRMLS_CC) == FAILURE) {
+   convert_to_text(&val);
+   if 
(zend_u_lookup_class(Z_TYPE(val), Z_STRVAL(val), Z_STRLEN(val), &cep TSRMLS_CC) 
== FAILURE) {
stmt->fetch.cls.ce = 
ZEND_STANDARD_CLASS_DEF_PTR;
} else {
stmt->fetch.cls.ce = 
*cep;
@@ -1837,9 +1849,9 @@
 {
pdo_stmt_t * stmt = (pdo_stmt_t *) zend_object_store_get_object(object 
TSRMLS_CC);
 
-   convert_to_string(member);
+   convert_to_text(member);
 
-   if(strcmp(Z_STRVAL_P(member), "queryString") == 0) {
+   if ((Z_UNILEN_P

[PHP-CVS] cvs: php-src /ext/dom/tests bug28817.phpt /ext/simplexml simplexml.c /ext/simplexml/tests 008.phpt 009.phpt 015.phpt 022.phpt /ext/spl spl_sxe.c /ext/spl/tests sxe_002.phpt sxe_003.phpt

2005-08-16 Thread Dmitry Stogov
dmitry  Tue Aug 16 11:09:53 2005 EDT

  Modified files:  
/php-src/ext/dom/tests  bug28817.phpt 
/php-src/ext/simplexml  simplexml.c 
/php-src/ext/simplexml/tests008.phpt 009.phpt 015.phpt 022.phpt 
/php-src/ext/splspl_sxe.c 
/php-src/ext/spl/tests  sxe_002.phpt sxe_003.phpt sxe_004.phpt 
/php-src/ext/sqlite sqlite.c 
/php-src/ext/sqlite/tests   sqlite_002.phpt sqlite_003.phpt 
sqlite_005.phpt sqlite_006.phpt 
sqlite_007.phpt sqlite_008.phpt 
sqlite_009.phpt sqlite_010.phpt 
sqlite_011.phpt sqlite_012.phpt 
sqlite_013.phpt sqlite_014.phpt 
sqlite_015.phpt sqlite_016.phpt 
sqlite_019.phpt sqlite_022.phpt 
sqlite_023.phpt sqlite_024.phpt 
sqlite_025.phpt sqlite_026.phpt 
sqlite_oo_002.phpt sqlite_oo_003.phpt 
sqlite_oo_008.phpt sqlite_oo_009.phpt 
sqlite_oo_010.phpt sqlite_oo_011.phpt 
sqlite_oo_012.phpt sqlite_oo_013.phpt 
sqlite_oo_014.phpt sqlite_oo_015.phpt 
sqlite_oo_016.phpt sqlite_oo_020.phpt 
sqlite_oo_021.phpt sqlite_oo_022.phpt 
sqlite_oo_024.phpt sqlite_oo_025.phpt 
sqlite_oo_026.phpt sqlite_oo_028.phpt 
sqlite_oo_030.phpt 
  Log:
  Unicode support
  
  http://cvs.php.net/diff.php/php-src/ext/dom/tests/bug28817.phpt?r1=1.1&r2=1.2&ty=u
Index: php-src/ext/dom/tests/bug28817.phpt
diff -u php-src/ext/dom/tests/bug28817.phpt:1.1 
php-src/ext/dom/tests/bug28817.phpt:1.2
--- php-src/ext/dom/tests/bug28817.phpt:1.1 Sat Dec  4 06:40:10 2004
+++ php-src/ext/dom/tests/bug28817.phpt Tue Aug 16 11:09:42 2005
@@ -36,3 +36,15 @@
   string(4) "tiro"
 }
 string(30) "Cessante causa cessat effectus"
+--UEXPECTF--
+array(4) {
+  [0]=>
+  unicode(5) "bonus"
+  [1]=>
+  unicode(3) "vir"
+  [2]=>
+  unicode(6) "semper"
+  [3]=>
+  unicode(4) "tiro"
+}
+unicode(30) "Cessante causa cessat effectus"
http://cvs.php.net/diff.php/php-src/ext/simplexml/simplexml.c?r1=1.155&r2=1.156&ty=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.155 
php-src/ext/simplexml/simplexml.c:1.156
--- php-src/ext/simplexml/simplexml.c:1.155 Tue Aug 16 02:04:58 2005
+++ php-src/ext/simplexml/simplexml.c   Tue Aug 16 11:09:44 2005
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.155 2005/08/16 06:04:58 rolland Exp $ */
+/* $Id: simplexml.c,v 1.156 2005/08/16 15:09:44 dmitry Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -280,6 +280,7 @@
case IS_BOOL:
case IS_DOUBLE:
case IS_NULL:
+   case IS_UNICODE:
if (value->refcount > 1) {
value_copy = *value;
zval_copy_ctor(&value_copy);
@@ -288,6 +289,7 @@
convert_to_string(value);
/* break missing intentionally */
case IS_STRING:
+   case IS_BINARY:
xmlNodeSetContentLen(node, Z_STRVAL_P(value), 
Z_STRLEN_P(value));
if (value == &value_copy) {
zval_dtor(value);
@@ -427,8 +429,10 @@
case IS_BOOL:
case IS_DOUBLE:
case IS_NULL:
+   case IS_UNICODE:
convert_to_string(value);
case IS_STRING:
+   case IS_BINARY:
newnode = 
(xmlNodePtr)xmlNewProp(node, name, Z_STRVAL_P(value));
break;
default:
@@ -511,8 +515,10 @@
node = sxe_get_element_by_offset(sxe, 
Z_LVAL_P(member), node);
}
else {
+   zval tmp_zv;
+
if (Z_TYPE_P(member) != IS_STRING) {
-   zval tmp_zv = *member;
+   tmp_zv = *member;
zval_copy_ctor(&tmp_zv);
member = &tmp_zv;
convert_to_string(member);
@@ -526,7 +532,10 @@
   

[PHP-CVS] cvs: php-src(PHP_5_1) /ext/standard url.c /ext/standard/tests/strings url_t.phpt

2005-08-16 Thread Ilia Alshanetsky
iliaa   Tue Aug 16 10:20:42 2005 EDT

  Modified files:  (Branch: PHP_5_1)
/php-src/ext/standard   url.c 
/php-src/ext/standard/tests/strings url_t.phpt 
  Log:
  MFH: Fixed bug #34148 (+,- and . not supported as parts of scheme).
  
http://cvs.php.net/diff.php/php-src/ext/standard/url.c?r1=1.86&r2=1.86.2.1&ty=u
Index: php-src/ext/standard/url.c
diff -u php-src/ext/standard/url.c:1.86 php-src/ext/standard/url.c:1.86.2.1
--- php-src/ext/standard/url.c:1.86 Wed Aug  3 10:08:14 2005
+++ php-src/ext/standard/url.c  Tue Aug 16 10:20:41 2005
@@ -15,7 +15,7 @@
| Author: Jim Winstead <[EMAIL PROTECTED]>  
|
+--+
  */
-/* $Id: url.c,v 1.86 2005/08/03 14:08:14 sniper Exp $ */
+/* $Id: url.c,v 1.86.2.1 2005/08/16 14:20:41 iliaa Exp $ */
 
 #include 
 #include 
@@ -107,7 +107,8 @@
/* validate scheme */
p = s;
while (p < e) {
-   if (!isalnum(*p)) {
+   /* scheme = 1*[ lowalpha | digit | "+" | "-" | "." ] */
+   if (!isalpha(*p) && !isdigit(*p) && *p != '+' && *p != 
'.' && *p != '-') {
if (e + 1 < ue) {
goto parse_port;
} else {
http://cvs.php.net/diff.php/php-src/ext/standard/tests/strings/url_t.phpt?r1=1.9&r2=1.9.2.1&ty=u
Index: php-src/ext/standard/tests/strings/url_t.phpt
diff -u php-src/ext/standard/tests/strings/url_t.phpt:1.9 
php-src/ext/standard/tests/strings/url_t.phpt:1.9.2.1
--- php-src/ext/standard/tests/strings/url_t.phpt:1.9   Mon Apr 25 19:47:37 2005
+++ php-src/ext/standard/tests/strings/url_t.phpt   Tue Aug 16 10:20:41 2005
@@ -68,7 +68,8 @@
 'file:/path/to/file',
 'http://1.2.3.4:/abc.asp?a=1&b=2',
 'http://foo.com#bar',
-'scheme:'
+'scheme:',
+'foo+bar://[EMAIL PROTECTED]/bla',
 );
 
 foreach ($sample_urls as $url) {
@@ -662,3 +663,13 @@
   ["scheme"]=>
   string(6) "scheme"
 }
+array(4) {
+  ["scheme"]=>
+  string(7) "foo+bar"
+  ["host"]=>
+  string(4) "bang"
+  ["user"]=>
+  string(3) "baz"
+  ["path"]=>
+  string(4) "/bla"
+}

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



[PHP-CVS] cvs: php-src(PHP_5_0) /ext/standard url.c /ext/standard/tests/strings url_t.phpt

2005-08-16 Thread Ilia Alshanetsky
iliaa   Tue Aug 16 10:15:44 2005 EDT

  Modified files:  (Branch: PHP_5_0)
/php-src/ext/standard   url.c 
/php-src/ext/standard/tests/strings url_t.phpt 
  Log:
  MFH: Fixed bug #34148 (+,- and . not supported as parts of scheme).
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/url.c?r1=1.81.2.4&r2=1.81.2.5&ty=u
Index: php-src/ext/standard/url.c
diff -u php-src/ext/standard/url.c:1.81.2.4 php-src/ext/standard/url.c:1.81.2.5
--- php-src/ext/standard/url.c:1.81.2.4 Wed May 25 23:56:34 2005
+++ php-src/ext/standard/url.c  Tue Aug 16 10:15:43 2005
@@ -15,7 +15,7 @@
| Author: Jim Winstead <[EMAIL PROTECTED]>  
|
+--+
  */
-/* $Id: url.c,v 1.81.2.4 2005/05/26 03:56:34 iliaa Exp $ */
+/* $Id: url.c,v 1.81.2.5 2005/08/16 14:15:43 iliaa Exp $ */
 
 #include 
 #include 
@@ -107,7 +107,8 @@
/* validate scheme */
p = s;
while (p < e) {
-   if (!isalnum(*p)) {
+   /* scheme = 1*[ lowalpha | digit | "+" | "-" | "." ] */
+   if (!isalpha(*p) && !isdigit(*p) && *p != '+' && *p != 
'.' && *p != '-') {
if (e + 1 < ue) {
goto parse_port;
} else {
http://cvs.php.net/diff.php/php-src/ext/standard/tests/strings/url_t.phpt?r1=1.7.2.2&r2=1.7.2.3&ty=u
Index: php-src/ext/standard/tests/strings/url_t.phpt
diff -u php-src/ext/standard/tests/strings/url_t.phpt:1.7.2.2 
php-src/ext/standard/tests/strings/url_t.phpt:1.7.2.3
--- php-src/ext/standard/tests/strings/url_t.phpt:1.7.2.2   Mon Apr 25 
19:48:30 2005
+++ php-src/ext/standard/tests/strings/url_t.phpt   Tue Aug 16 10:15:43 2005
@@ -68,7 +68,8 @@
 'file:/path/to/file',
 'http://1.2.3.4:/abc.asp?a=1&b=2',
 'http://foo.com#bar',
-'scheme:'
+'scheme:',
+'foo+bar://[EMAIL PROTECTED]/bla',
 );
 
 foreach ($sample_urls as $url) {
@@ -662,3 +663,13 @@
   ["scheme"]=>
   string(6) "scheme"
 }
+array(4) {
+  ["scheme"]=>
+  string(7) "foo+bar"
+  ["host"]=>
+  string(4) "bang"
+  ["user"]=>
+  string(3) "baz"
+  ["path"]=>
+  string(4) "/bla"
+}

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



[PHP-CVS] cvs: php-src(PHP_4_4) / NEWS /ext/standard url.c /ext/standard/tests/strings url_t.phpt

2005-08-16 Thread Ilia Alshanetsky
iliaa   Tue Aug 16 10:12:15 2005 EDT

  Modified files:  (Branch: PHP_4_4)
/php-src/ext/standard   url.c 
/php-src/ext/standard/tests/strings url_t.phpt 
/php-srcNEWS 
  Log:
  MFH: Fixed bug #34148 (+,- and . not supported as parts of scheme).
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/url.c?r1=1.58.2.21&r2=1.58.2.21.2.1&ty=u
Index: php-src/ext/standard/url.c
diff -u php-src/ext/standard/url.c:1.58.2.21 
php-src/ext/standard/url.c:1.58.2.21.2.1
--- php-src/ext/standard/url.c:1.58.2.21Wed May 25 23:56:45 2005
+++ php-src/ext/standard/url.c  Tue Aug 16 10:12:13 2005
@@ -15,7 +15,7 @@
| Author: Jim Winstead <[EMAIL PROTECTED]>  
|
+--+
  */
-/* $Id: url.c,v 1.58.2.21 2005/05/26 03:56:45 iliaa Exp $ */
+/* $Id: url.c,v 1.58.2.21.2.1 2005/08/16 14:12:13 iliaa Exp $ */
 
 #include 
 #include 
@@ -107,7 +107,8 @@
/* validate scheme */
p = s;
while (p < e) {
-   if (!isalnum(*p)) {
+   /* scheme = 1*[ lowalpha | digit | "+" | "-" | "." ] */
+   if (!isalpha(*p) && !isdigit(*p) && *p != '+' && *p != 
'.' && *p != '-') {
if (e + 1 < ue) {
goto parse_port;
} else {
http://cvs.php.net/diff.php/php-src/ext/standard/tests/strings/url_t.phpt?r1=1.3.2.7&r2=1.3.2.7.2.1&ty=u
Index: php-src/ext/standard/tests/strings/url_t.phpt
diff -u php-src/ext/standard/tests/strings/url_t.phpt:1.3.2.7 
php-src/ext/standard/tests/strings/url_t.phpt:1.3.2.7.2.1
--- php-src/ext/standard/tests/strings/url_t.phpt:1.3.2.7   Mon Apr 25 
19:49:27 2005
+++ php-src/ext/standard/tests/strings/url_t.phpt   Tue Aug 16 10:12:13 2005
@@ -70,7 +70,8 @@
 'file:/path/to/file',
 'http://1.2.3.4:/abc.asp?a=1&b=2',
 'http://foo.com#bar',
-'scheme:'
+'scheme:',
+'foo+bar://[EMAIL PROTECTED]/bla',
 );
 
 foreach ($sample_urls as $url) {
@@ -664,3 +665,13 @@
   ["scheme"]=>
   string(6) "scheme"
 }
+array(4) {
+  ["scheme"]=>
+  string(7) "foo+bar"
+  ["host"]=>
+  string(4) "bang"
+  ["user"]=>
+  string(3) "baz"
+  ["path"]=>
+  string(4) "/bla"
+}
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1247.2.920.2.25&r2=1.1247.2.920.2.26&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.920.2.25 php-src/NEWS:1.1247.2.920.2.26
--- php-src/NEWS:1.1247.2.920.2.25  Mon Aug 15 06:47:17 2005
+++ php-src/NEWSTue Aug 16 10:12:13 2005
@@ -1,6 +1,7 @@
 PHP 4  NEWS
 |||
 ?? ??? 2005, Version 4.4.1
+- Fixed bug #34148 (+,- and . not supported as parts of scheme). (Ilia)
 - Fixed bug #34068 (Numeric string as array key not cast to integer in 
   wddx_deserialize()). (Ilia)
 - Fixed bug #34064 (arr[] as param to function is allowed only if function 

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



[PHP-CVS] cvs: php-src / NEWS /ext/standard url.c /ext/standard/tests/strings url_t.phpt

2005-08-16 Thread Ilia Alshanetsky
iliaa   Tue Aug 16 10:10:15 2005 EDT

  Modified files:  
/php-src/ext/standard   url.c 
/php-src/ext/standard/tests/strings url_t.phpt 
/php-srcNEWS 
  Log:
  Fixed bug #34148 (+,- and . not supported as parts of scheme).
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/url.c?r1=1.87&r2=1.88&ty=u
Index: php-src/ext/standard/url.c
diff -u php-src/ext/standard/url.c:1.87 php-src/ext/standard/url.c:1.88
--- php-src/ext/standard/url.c:1.87 Tue Aug  9 10:17:28 2005
+++ php-src/ext/standard/url.c  Tue Aug 16 10:10:11 2005
@@ -15,7 +15,7 @@
| Author: Jim Winstead <[EMAIL PROTECTED]>  
|
+--+
  */
-/* $Id: url.c,v 1.87 2005/08/09 14:17:28 iliaa Exp $ */
+/* $Id: url.c,v 1.88 2005/08/16 14:10:11 iliaa Exp $ */
 
 #include 
 #include 
@@ -107,7 +107,8 @@
/* validate scheme */
p = s;
while (p < e) {
-   if (!isalnum(*p)) {
+   /* scheme = 1*[ lowalpha | digit | "+" | "-" | "." ] */
+   if (!isalpha(*p) && !isdigit(*p) && *p != '+' && *p != 
'.' && *p != '-') {
if (e + 1 < ue) {
goto parse_port;
} else {
http://cvs.php.net/diff.php/php-src/ext/standard/tests/strings/url_t.phpt?r1=1.9&r2=1.10&ty=u
Index: php-src/ext/standard/tests/strings/url_t.phpt
diff -u php-src/ext/standard/tests/strings/url_t.phpt:1.9 
php-src/ext/standard/tests/strings/url_t.phpt:1.10
--- php-src/ext/standard/tests/strings/url_t.phpt:1.9   Mon Apr 25 19:47:37 2005
+++ php-src/ext/standard/tests/strings/url_t.phpt   Tue Aug 16 10:10:13 2005
@@ -68,7 +68,8 @@
 'file:/path/to/file',
 'http://1.2.3.4:/abc.asp?a=1&b=2',
 'http://foo.com#bar',
-'scheme:'
+'scheme:',
+'foo+bar://[EMAIL PROTECTED]/bla',
 );
 
 foreach ($sample_urls as $url) {
@@ -662,3 +663,13 @@
   ["scheme"]=>
   string(6) "scheme"
 }
+array(4) {
+  ["scheme"]=>
+  string(7) "foo+bar"
+  ["host"]=>
+  string(4) "bang"
+  ["user"]=>
+  string(3) "baz"
+  ["path"]=>
+  string(4) "/bla"
+}
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.2039&r2=1.2040&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2039 php-src/NEWS:1.2040
--- php-src/NEWS:1.2039 Fri Aug 12 11:16:52 2005
+++ php-src/NEWSTue Aug 16 10:10:13 2005
@@ -1,6 +1,7 @@
 PHPNEWS
 |||
 ?? ??? , PHP 6.0
+- Fixed bug #34148 (+,- and . not supported as parts of scheme). (Ilia)
 - cURL improvements (Ilia)
   . Added curl_setopt_array() which allows setting of multiple cURL options.
   . Added CURLINFO_HEADER_OUT to facilitate request retrieval.

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



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

2005-08-16 Thread Rolland Santimano
rolland Tue Aug 16 08:04:14 2005 EDT

  Modified files:  
/php-src/ext/standard   string.c 
  Log:
  Unicode capable impl of implode()
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/string.c?r1=1.454&r2=1.455&ty=u
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.454 php-src/ext/standard/string.c:1.455
--- php-src/ext/standard/string.c:1.454 Tue Aug 16 02:02:56 2005
+++ php-src/ext/standard/string.c   Tue Aug 16 08:04:13 2005
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: string.c,v 1.454 2005/08/16 06:02:56 rolland Exp $ */
+/* $Id: string.c,v 1.455 2005/08/16 12:04:13 rolland Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -1141,36 +1141,115 @@
 
 /* {{{ php_implode
  */
-PHPAPI void php_implode(zval *delim, zval *arr, zval *return_value) 
+PHPAPI void php_implode(zval *delim, zval *arr, zval *retval) 
 {
-   zval **tmp;
-   HashPosition   pos;
-   smart_str  implstr = {0};
-   intnumelems, i = 0;
+   zend_uchar  return_type;
+   int numelems, i;
+   HashPositionpos;
+   zval**tmp;
+   void*elem;
+   int32_t elem_chars, elem_len;
+
+   if (Z_TYPE_P(delim) != IS_UNICODE && Z_TYPE_P(delim) != IS_BINARY) {
+   convert_to_string_ex(&delim);
+   }
+   Z_TYPE_P(retval) = return_type = Z_TYPE_P(delim); /* ... to start off */
+
+   /* Setup return value */
+   if (return_type == IS_UNICODE) {
+   ZVAL_EMPTY_UNICODE(retval);
+   } else if (return_type == IS_BINARY) {
+   ZVAL_EMPTY_BINARY(retval);
+   } else {
+   ZVAL_EMPTY_STRING(retval);
+   }
 
numelems = zend_hash_num_elements(Z_ARRVAL_P(arr));
-
if (numelems == 0) {
-   RETURN_EMPTY_STRING();
+   return;
}
 
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(arr), &pos);
-
-   while (zend_hash_get_current_data_ex(Z_ARRVAL_P(arr), (void **) &tmp, 
&pos) == SUCCESS) {
-   if ((*tmp)->type != IS_STRING) {
-   SEPARATE_ZVAL(tmp);
-   convert_to_string(*tmp);
-   } 
-   
-   smart_str_appendl(&implstr, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
-   if (++i != numelems) {
-   smart_str_appendl(&implstr, Z_STRVAL_P(delim), 
Z_STRLEN_P(delim));
+   for (i = 1 ; i <= numelems ; i++) {
+   if (zend_hash_get_current_data_ex(Z_ARRVAL_P(arr), (void 
**)&tmp, &pos) != SUCCESS) {
+   /* Shouldn't happen ? */
+   return;
}
zend_hash_move_forward_ex(Z_ARRVAL_P(arr), &pos);
+   if (Z_TYPE_PP(tmp) != return_type) {
+   /* Convert to common type, if possible */
+   if (return_type == IS_UNICODE) {
+   if (Z_TYPE_PP(tmp) == IS_BINARY) {
+   /* ERROR */
+   php_error_docref(NULL TSRMLS_CC, 
E_WARNING, "Mixed string types");
+   efree(Z_USTRVAL_P(retval));
+   ZVAL_FALSE(retval);
+   return;
+   } else {
+   SEPARATE_ZVAL(tmp);
+   convert_to_unicode_ex(tmp);
+   }
+   } else if (return_type == IS_BINARY) {
+   if (Z_TYPE_PP(tmp) == IS_UNICODE || 
Z_TYPE_PP(tmp) == IS_STRING) {
+   /* ERROR */
+   php_error_docref(NULL TSRMLS_CC, 
E_WARNING, "Mixed string types");
+   efree(Z_BINVAL_P(retval));
+   ZVAL_FALSE(retval);
+   return;
+   } else {
+   SEPARATE_ZVAL(tmp);
+   convert_to_binary_ex(tmp);
+   }
+   } else {
+   if (Z_TYPE_PP(tmp) == IS_UNICODE) {
+   /* Convert IS_STRING up to IS_UNICODE */
+   convert_to_unicode_ex(&retval);
+   convert_to_unicode_ex(&delim);
+   Z_TYPE_P(retval) = return_type = 
IS_UNICODE;
+   } else if (Z_TYPE_PP(tmp) == IS_BINARY) {
+   /* ERROR */
+   php_error_docref(NULL TSRMLS_CC, 
E

[PHP-CVS] cvs: php-src(PHP_5_1) / NEWS configure.in /main php_version.h

2005-08-16 Thread Zeev Suraski
zeevTue Aug 16 08:01:42 2005 EDT

  Modified files:  (Branch: PHP_5_1)
/php-srcNEWS configure.in 
/php-src/main   php_version.h 
  Log:
  Go back to dev
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.2027.2.16&r2=1.2027.2.17&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.16 php-src/NEWS:1.2027.2.17
--- php-src/NEWS:1.2027.2.16Tue Aug 16 06:59:42 2005
+++ php-src/NEWSTue Aug 16 08:01:40 2005
@@ -1,6 +1,6 @@
 PHPNEWS
 |||
-16 Aug 2005, PHP 5.1 Release Candidate 1
+?? Aug 2005, PHP 5.1 Release Candidate 2
 - Removed XML_RPC pear package from distribution and made ext/xmlrpc mandatory
   for pear. (Rasmus)
 - Updated bundled libraries in Windows distribution. (Edin)
http://cvs.php.net/diff.php/php-src/configure.in?r1=1.579.2.4&r2=1.579.2.5&ty=u
Index: php-src/configure.in
diff -u php-src/configure.in:1.579.2.4 php-src/configure.in:1.579.2.5
--- php-src/configure.in:1.579.2.4  Tue Aug 16 06:59:51 2005
+++ php-src/configure.inTue Aug 16 08:01:40 2005
@@ -1,4 +1,4 @@
- ## $Id: configure.in,v 1.579.2.4 2005/08/16 10:59:51 zeev Exp $ -*- autoconf 
-*-
+ ## $Id: configure.in,v 1.579.2.5 2005/08/16 12:01:40 zeev Exp $ -*- autoconf 
-*-
 dnl ## Process this file with autoconf to produce a configure script.
 
 divert(1)
@@ -42,7 +42,7 @@
 MAJOR_VERSION=5
 MINOR_VERSION=1
 RELEASE_VERSION=0
-EXTRA_VERSION="RC1"
+EXTRA_VERSION="-dev"
 VERSION="$MAJOR_VERSION.$MINOR_VERSION.$RELEASE_VERSION$EXTRA_VERSION"
 
 dnl Define where extension directories are located in the configure context
http://cvs.php.net/diff.php/php-src/main/php_version.h?r1=1.112.2.3&r2=1.112.2.4&ty=u
Index: php-src/main/php_version.h
diff -u php-src/main/php_version.h:1.112.2.3 
php-src/main/php_version.h:1.112.2.4
--- php-src/main/php_version.h:1.112.2.3Tue Aug 16 06:59:56 2005
+++ php-src/main/php_version.h  Tue Aug 16 08:01:42 2005
@@ -3,5 +3,5 @@
 #define PHP_MAJOR_VERSION 5
 #define PHP_MINOR_VERSION 1
 #define PHP_RELEASE_VERSION 0
-#define PHP_EXTRA_VERSION "RC1"
-#define PHP_VERSION "5.1.0RC1"
+#define PHP_EXTRA_VERSION "-dev"
+#define PHP_VERSION "5.1.0-dev"

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



[PHP-CVS] cvs: php-src(PHP_5_1) /pear go-pear-list.php

2005-08-16 Thread Edin Kadribasic
edink   Tue Aug 16 07:35:48 2005 EDT

  Modified files:  (Branch: PHP_5_1)
/php-src/pear   go-pear-list.php 
  Log:
  Rebundle XML_RPC in the correct version for the Windows distro.
  
http://cvs.php.net/diff.php/php-src/pear/go-pear-list.php?r1=1.15.2.1&r2=1.15.2.2&ty=u
Index: php-src/pear/go-pear-list.php
diff -u php-src/pear/go-pear-list.php:1.15.2.1 
php-src/pear/go-pear-list.php:1.15.2.2
--- php-src/pear/go-pear-list.php:1.15.2.1  Thu Aug 11 12:43:25 2005
+++ php-src/pear/go-pear-list.php   Tue Aug 16 07:35:45 2005
@@ -3,11 +3,12 @@
  * that will be used to create the PEAR folder
  * in the windows snapshot.
  * See win32/build/mkdist.php for more details
- * $Id: go-pear-list.php,v 1.15.2.1 2005/08/11 16:43:25 rasmus Exp $
+ * $Id: go-pear-list.php,v 1.15.2.2 2005/08/16 11:35:45 edink Exp $
  */
 $packages  = array(
 // required packages for the installer
 "PEAR"  =>"1.3.5",
+"XML_RPC"   =>"1.4.0",
 "Console_Getopt"=>"1.2",
 "Archive_Tar"   =>"1.3.1",
 



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



[PHP-CVS] cvs: php-src(PHP_5_1) / NEWS configure.in /main php_version.h

2005-08-16 Thread Zeev Suraski
zeevTue Aug 16 06:59:57 2005 EDT

  Modified files:  (Branch: PHP_5_1)
/php-srcNEWS configure.in 
/php-src/main   php_version.h 
  Log:
  Roll RC1
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.2027.2.15&r2=1.2027.2.16&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.15 php-src/NEWS:1.2027.2.16
--- php-src/NEWS:1.2027.2.15Mon Aug 15 13:14:35 2005
+++ php-src/NEWSTue Aug 16 06:59:42 2005
@@ -1,6 +1,6 @@
 PHPNEWS
 |||
-?? Aug 2005, PHP 5.1 Release Candidate 1
+16 Aug 2005, PHP 5.1 Release Candidate 1
 - Removed XML_RPC pear package from distribution and made ext/xmlrpc mandatory
   for pear. (Rasmus)
 - Updated bundled libraries in Windows distribution. (Edin)
http://cvs.php.net/diff.php/php-src/configure.in?r1=1.579.2.3&r2=1.579.2.4&ty=u
Index: php-src/configure.in
diff -u php-src/configure.in:1.579.2.3 php-src/configure.in:1.579.2.4
--- php-src/configure.in:1.579.2.3  Thu Aug 11 12:43:24 2005
+++ php-src/configure.inTue Aug 16 06:59:51 2005
@@ -1,4 +1,4 @@
- ## $Id: configure.in,v 1.579.2.3 2005/08/11 16:43:24 rasmus Exp $ -*- 
autoconf -*-
+ ## $Id: configure.in,v 1.579.2.4 2005/08/16 10:59:51 zeev Exp $ -*- autoconf 
-*-
 dnl ## Process this file with autoconf to produce a configure script.
 
 divert(1)
@@ -42,7 +42,7 @@
 MAJOR_VERSION=5
 MINOR_VERSION=1
 RELEASE_VERSION=0
-EXTRA_VERSION="-dev"
+EXTRA_VERSION="RC1"
 VERSION="$MAJOR_VERSION.$MINOR_VERSION.$RELEASE_VERSION$EXTRA_VERSION"
 
 dnl Define where extension directories are located in the configure context
http://cvs.php.net/diff.php/php-src/main/php_version.h?r1=1.112.2.2&r2=1.112.2.3&ty=u
Index: php-src/main/php_version.h
diff -u php-src/main/php_version.h:1.112.2.2 
php-src/main/php_version.h:1.112.2.3
--- php-src/main/php_version.h:1.112.2.2Tue Aug  9 01:40:56 2005
+++ php-src/main/php_version.h  Tue Aug 16 06:59:56 2005
@@ -3,5 +3,5 @@
 #define PHP_MAJOR_VERSION 5
 #define PHP_MINOR_VERSION 1
 #define PHP_RELEASE_VERSION 0
-#define PHP_EXTRA_VERSION "-dev"
-#define PHP_VERSION "5.1.0-dev"
+#define PHP_EXTRA_VERSION "RC1"
+#define PHP_VERSION "5.1.0RC1"

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



[PHP-CVS] cvs: php-src /ext/standard md5.c /ext/standard/tests/strings explode.phpt strcspn.phpt strspn.phpt strstr.phpt

2005-08-16 Thread Dmitry Stogov
dmitry  Tue Aug 16 06:18:43 2005 EDT

  Modified files:  
/php-src/ext/standard   md5.c 
/php-src/ext/standard/tests/strings explode.phpt strcspn.phpt 
strspn.phpt strstr.phpt 
  Log:
  Unicode support
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/md5.c?r1=1.39&r2=1.40&ty=u
Index: php-src/ext/standard/md5.c
diff -u php-src/ext/standard/md5.c:1.39 php-src/ext/standard/md5.c:1.40
--- php-src/ext/standard/md5.c:1.39 Wed Aug  3 10:08:09 2005
+++ php-src/ext/standard/md5.c  Tue Aug 16 06:18:41 2005
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: md5.c,v 1.39 2005/08/03 14:08:09 sniper Exp $ */
+/* $Id: md5.c,v 1.40 2005/08/16 10:18:41 dmitry Exp $ */
 
 /* 
  * md5.c - Copyright 1997 Lachlan Roche 
@@ -61,7 +61,12 @@
RETURN_STRINGL(digest, 16, 1);
} else {
make_digest(md5str, digest);
-   RETVAL_STRING(md5str, 1);
+   if (UG(unicode)) {
+   UChar *u_temp = zend_ascii_to_unicode(md5str, 33 
ZEND_FILE_LINE_CC);
+   RETVAL_UNICODE(u_temp, 0);
+   } else {
+   RETVAL_STRING(md5str, 1);
+   }
}
 
 }
@@ -108,7 +113,12 @@
RETURN_STRINGL(digest, 16, 1);
} else {
make_digest(md5str, digest);
-   RETVAL_STRING(md5str, 1);
+   if (UG(unicode)) {
+   UChar *u_temp = zend_ascii_to_unicode(md5str, 33 
ZEND_FILE_LINE_CC);
+   RETVAL_UNICODE(u_temp, 0);
+   } else {
+   RETVAL_STRING(md5str, 1);
+   }
}
 }
 /* }}} */
http://cvs.php.net/diff.php/php-src/ext/standard/tests/strings/explode.phpt?r1=1.4&r2=1.5&ty=u
Index: php-src/ext/standard/tests/strings/explode.phpt
diff -u php-src/ext/standard/tests/strings/explode.phpt:1.4 
php-src/ext/standard/tests/strings/explode.phpt:1.5
--- php-src/ext/standard/tests/strings/explode.phpt:1.4 Sun Jul 18 07:34:28 2004
+++ php-src/ext/standard/tests/strings/explode.phpt Tue Aug 16 06:18:43 2005
@@ -152,3 +152,127 @@
   [0]=>
   string(10) "a lazy dog"
 }
+--UEXPECTF--
+26d4e18734cb2582df5055e2175223df
+bool(false)
+bool(false)
+bool(false)
+array(1) {
+  [0]=>
+  unicode(0) ""
+}
+array(2) {
+  [0]=>
+  unicode(0) ""
+  [1]=>
+  unicode(0) ""
+}
+array(1) {
+  [0]=>
+  unicode(0) ""
+}
+bool(false)
+array(1) {
+  [0]=>
+  unicode(3) "acb"
+}
+array(1) {
+  [0]=>
+  unicode(11) "otherstring"
+}
+array(7) {
+  [0]=>
+  unicode(0) ""
+  [1]=>
+  unicode(0) ""
+  [2]=>
+  unicode(0) ""
+  [3]=>
+  unicode(0) ""
+  [4]=>
+  unicode(0) ""
+  [5]=>
+  unicode(0) ""
+  [6]=>
+  unicode(0) ""
+}
+array(1) {
+  [0]=>
+  unicode(60) "-=48=--=48=--=48=--=48=--=48=--=48=--=48=--=48=--=48=--=48=-"
+}
+array(21) {
+  [0]=>
+  unicode(1) "-"
+  [1]=>
+  unicode(2) "48"
+  [2]=>
+  unicode(2) "--"
+  [3]=>
+  unicode(2) "48"
+  [4]=>
+  unicode(2) "--"
+  [5]=>
+  unicode(2) "48"
+  [6]=>
+  unicode(2) "--"
+  [7]=>
+  unicode(2) "48"
+  [8]=>
+  unicode(2) "--"
+  [9]=>
+  unicode(2) "48"
+  [10]=>
+  unicode(2) "--"
+  [11]=>
+  unicode(2) "48"
+  [12]=>
+  unicode(2) "--"
+  [13]=>
+  unicode(2) "48"
+  [14]=>
+  unicode(2) "--"
+  [15]=>
+  unicode(2) "48"
+  [16]=>
+  unicode(2) "--"
+  [17]=>
+  unicode(2) "48"
+  [18]=>
+  unicode(2) "--"
+  [19]=>
+  unicode(2) "48"
+  [20]=>
+  unicode(1) "-"
+}
+array(3) {
+  [0]=>
+  unicode(10) "a lazy dog"
+  [1]=>
+  unicode(5) "jumps"
+  [2]=>
+  unicode(4) "over"
+}
+array(2) {
+  [0]=>
+  unicode(10) "a lazy dog"
+  [1]=>
+  unicode(5) "jumps"
+}
+array(1) {
+  [0]=>
+  unicode(10) "a lazy dog"
+}
+array(0) {
+}
+array(0) {
+}
+array(2) {
+  [0]=>
+  unicode(10) "a lazy dog"
+  [1]=>
+  unicode(11) "jumps::over"
+}
+array(1) {
+  [0]=>
+  unicode(10) "a lazy dog"
+}
http://cvs.php.net/diff.php/php-src/ext/standard/tests/strings/strcspn.phpt?r1=1.1&r2=1.2&ty=u
Index: php-src/ext/standard/tests/strings/strcspn.phpt
diff -u php-src/ext/standard/tests/strings/strcspn.phpt:1.1 
php-src/ext/standard/tests/strings/strcspn.phpt:1.2
--- php-src/ext/standard/tests/strings/strcspn.phpt:1.1 Sat Oct 26 12:48:03 2002
+++ php-src/ext/standard/tests/strings/strcspn.phpt Tue Aug 16 06:18:43 2005
@@ -16,3 +16,9 @@
 int(0)
 int(7)
 int(6)
+--UEXPECT--
+unicode(25) " bbb "
+unicode(4) "1234"
+int(0)
+int(7)
+int(6)
http://cvs.php.net/diff.php/php-src/ext/standard/tests/strings/strspn.phpt?r1=1.1&r2=1.2&ty=u
Index: php-src/ext/standard/tests/strings/strspn.phpt
diff -u php-src/ext/standard/tests/strings/strspn.phpt:1.1 
php-src/ext/standard/tests/strings/strspn.phpt:1.2
--- php-src/ext/standard/tests/strings/strspn.phpt:1.1  Sat Oct 26 12:48:03 2002
+++ php-src/ext/standard/tests/strings/strspn.phpt  Tue Aug 16 06:18:43 2005
@@ -16,3 +16,9 @@
 int(8)
 int(6)
 int(3)
+--UEXPECT--
+unicode(25) "

[PHP-CVS] cvs: php-src(PHP_5_1) /ext/pgsql pgsql.c

2005-08-16 Thread Edin Kadribasic
edink   Tue Aug 16 05:55:48 2005 EDT

  Modified files:  (Branch: PHP_5_1)
/php-src/ext/pgsql  pgsql.c 
  Log:
  Use free() instead of PQfreemem() to maintain compabitibility with older
  PostgreSQL client libraries (bug #33813).
  
  
http://cvs.php.net/diff.php/php-src/ext/pgsql/pgsql.c?r1=1.331&r2=1.331.2.1&ty=u
Index: php-src/ext/pgsql/pgsql.c
diff -u php-src/ext/pgsql/pgsql.c:1.331 php-src/ext/pgsql/pgsql.c:1.331.2.1
--- php-src/ext/pgsql/pgsql.c:1.331 Wed Aug  3 10:07:40 2005
+++ php-src/ext/pgsql/pgsql.c   Tue Aug 16 05:55:44 2005
@@ -20,7 +20,7 @@
+--+
  */
  
-/* $Id: pgsql.c,v 1.331 2005/08/03 14:07:40 sniper Exp $ */
+/* $Id: pgsql.c,v 1.331.2.1 2005/08/16 09:55:44 edink Exp $ */
 
 #include 
 
@@ -3251,7 +3251,7 @@
break;
default:

add_next_index_string(return_value, csv, 1);
-   PQfreemem(csv);
+   free(csv);
break;
}
}
@@ -3598,7 +3598,7 @@
 #if HAVE_PQUNESCAPEBYTEA
tmp = (char *)PQunescapeBytea((unsigned char*)from, &to_len);
to = estrndup(tmp, to_len);
-   PQfreemem(tmp);
+   free(tmp);
 #else
to = (char *)php_pgsql_unescape_bytea((unsigned char*)from, &to_len);
 #endif

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



[PHP-CVS] cvs: php-src /ext/standard var.c /ext/standard/tests/array bug25708.phpt bug26458.phpt

2005-08-16 Thread Dmitry Stogov
dmitry  Tue Aug 16 05:25:05 2005 EDT

  Modified files:  
/php-src/ext/standard   var.c 
/php-src/ext/standard/tests/array   bug25708.phpt bug26458.phpt 
  Log:
  Unicode support
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/var.c?r1=1.208&r2=1.209&ty=u
Index: php-src/ext/standard/var.c
diff -u php-src/ext/standard/var.c:1.208 php-src/ext/standard/var.c:1.209
--- php-src/ext/standard/var.c:1.208Sun Aug 14 17:26:01 2005
+++ php-src/ext/standard/var.c  Tue Aug 16 05:25:03 2005
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: var.c,v 1.208 2005/08/14 21:26:01 helly Exp $ */
+/* $Id: var.c,v 1.209 2005/08/16 09:25:03 dmitry Exp $ */
 
 
 
@@ -380,7 +380,7 @@
/* temporary, for debugging */
php_printf("%sunicode(%d) ", COMMON, 
u_countChar32((*struc)->value.ustr.val, (*struc)->value.ustr.len));
php_var_dump_unicode((*struc)->value.ustr.val, 
(*struc)->value.ustr.len, verbose TSRMLS_CC);
-   php_printf("\" refcount(%u)\n", Z_REFCOUNT_PP(struc));
+   php_printf(" refcount(%u)\n", Z_REFCOUNT_PP(struc));
break;
case IS_ARRAY:
myht = Z_ARRVAL_PP(struc);
http://cvs.php.net/diff.php/php-src/ext/standard/tests/array/bug25708.phpt?r1=1.2&r2=1.3&ty=u
Index: php-src/ext/standard/tests/array/bug25708.phpt
diff -u php-src/ext/standard/tests/array/bug25708.phpt:1.2 
php-src/ext/standard/tests/array/bug25708.phpt:1.3
--- php-src/ext/standard/tests/array/bug25708.phpt:1.2  Mon Aug 15 10:37:55 2005
+++ php-src/ext/standard/tests/array/bug25708.phpt  Tue Aug 16 05:25:04 2005
@@ -252,9 +252,9 @@
 long(3) refcount(2)
 --
 long(4) refcount(1)
-unicode(1) "x" refcount(1)
+unicode(1) "x" { 0078 } refcount(1)
 long(4) refcount(1)
-unicode(1) "x" refcount(1)
+unicode(1) "x" { 0078 } refcount(1)
 long(3) refcount(2)
 --
 long(1) refcount(2)
@@ -290,9 +290,9 @@
 long(3) refcount(2)
 --
 long(4) refcount(1)
-unicode(1) "x" refcount(1)
+unicode(1) "x" { 0078 } refcount(1)
 long(4) refcount(1)
-unicode(1) "x" refcount(1)
+unicode(1) "x" { 0078 } refcount(1)
 long(3) refcount(2)
 --
 long(1) refcount(2)
@@ -328,9 +328,9 @@
 long(3) refcount(2)
 --
 long(4) refcount(1)
-unicode(1) "x" refcount(1)
+unicode(1) "x" { 0078 } refcount(1)
 long(4) refcount(1)
-unicode(1) "x" refcount(1)
+unicode(1) "x" { 0078 } refcount(1)
 long(3) refcount(2)
 --
 long(1) refcount(2)
@@ -366,13 +366,13 @@
 long(3) refcount(2)
 --
 long(4) refcount(1)
-unicode(1) "x" refcount(1)
+unicode(1) "x" { 0078 } refcount(1)
 long(4) refcount(1)
-unicode(1) "x" refcount(1)
+unicode(1) "x" { 0078 } refcount(1)
 long(3) refcount(2)
 --
 long(1) refcount(2)
 long(2) refcount(2)
 r
-unicode(2) "ok" refcount(2)
-unicode(2) "ok" refcount(2)
+unicode(2) "ok" { 006f 006b } refcount(2)
+unicode(2) "ok" { 006f 006b } refcount(2)
http://cvs.php.net/diff.php/php-src/ext/standard/tests/array/bug26458.phpt?r1=1.1&r2=1.2&ty=u
Index: php-src/ext/standard/tests/array/bug26458.phpt

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



[PHP-CVS] cvs: php-src /ext/standard image.c /ext/standard/tests/image bug13213.phpt getimagesize.phpt getimagesize_246x247.phpt getimagesize_384x385.phpt getimagesize_swc.phpt image_type_to_mime_typ

2005-08-16 Thread Dmitry Stogov
dmitry  Tue Aug 16 05:11:00 2005 EDT

  Modified files:  
/php-src/ext/standard   image.c 
/php-src/ext/standard/tests/image   bug13213.phpt getimagesize.phpt 
getimagesize_246x247.phpt 
getimagesize_384x385.phpt 
getimagesize_swc.phpt 
image_type_to_mime_type.phpt 
  Log:
  Unicode support
  
  http://cvs.php.net/diff.php/php-src/ext/standard/image.c?r1=1.114&r2=1.115&ty=u
Index: php-src/ext/standard/image.c
diff -u php-src/ext/standard/image.c:1.114 php-src/ext/standard/image.c:1.115
--- php-src/ext/standard/image.c:1.114  Wed Aug  3 10:08:05 2005
+++ php-src/ext/standard/image.cTue Aug 16 05:11:00 2005
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: image.c,v 1.114 2005/08/03 14:08:05 sniper Exp $ */
+/* $Id: image.c,v 1.115 2005/08/16 09:11:00 dmitry Exp $ */
 
 #include "php.h"
 #include 
@@ -1120,13 +1120,20 @@
 {
zval **p_image_type;
int arg_c = ZEND_NUM_ARGS();
+   char *temp;
 
if ((arg_c!=1) || zend_get_parameters_ex(arg_c, &p_image_type) == 
FAILURE) {
RETVAL_FALSE;
WRONG_PARAM_COUNT;
}
convert_to_long_ex(p_image_type);
-   ZVAL_STRING(return_value, 
(char*)php_image_type_to_mime_type(Z_LVAL_PP(p_image_type)), 1);
+   temp = (char*)php_image_type_to_mime_type(Z_LVAL_PP(p_image_type));
+   if (UG(unicode)) {
+   UChar *u_temp = zend_ascii_to_unicode(temp, strlen(temp)+1 
ZEND_FILE_LINE_CC);
+   ZVAL_UNICODE(return_value, u_temp, 0);
+   } else {
+   ZVAL_STRING(return_value, temp, 1);
+   }
 }
 /* }}} */
 
@@ -1136,6 +1143,7 @@
 {
long image_type;
zend_bool inc_dot=1;
+   char *temp = NULL;
 
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|b", 
&image_type, &inc_dot) == FAILURE) {
RETURN_FALSE;
@@ -1143,30 +1151,38 @@
 
switch (image_type) {
case IMAGE_FILETYPE_GIF:
-   RETURN_STRING(".gif" + !inc_dot, 1);
+   temp = ".gif";
case IMAGE_FILETYPE_JPEG:
-   RETURN_STRING(".jpeg" + !inc_dot, 1);
+   temp = ".jpeg";
case IMAGE_FILETYPE_PNG:
-   RETURN_STRING(".png" + !inc_dot, 1);
+   temp = ".png";
case IMAGE_FILETYPE_SWF:
case IMAGE_FILETYPE_SWC:
-   RETURN_STRING(".swf" + !inc_dot, 1);
+   temp = ".swf";
case IMAGE_FILETYPE_PSD:
-   RETURN_STRING(".psd" + !inc_dot, 1);
+   temp = ".psd";
case IMAGE_FILETYPE_BMP:
case IMAGE_FILETYPE_WBMP:
-   RETURN_STRING(".bmp" + !inc_dot, 1);
+   temp = ".bmp";
case IMAGE_FILETYPE_TIFF_II:
case IMAGE_FILETYPE_TIFF_MM:
-   RETURN_STRING(".tiff" + !inc_dot, 1);
+   temp = ".tiff";
case IMAGE_FILETYPE_IFF:
-   RETURN_STRING(".iff" + !inc_dot, 1);
+   temp = ".iff";
case IMAGE_FILETYPE_JPC:
-   RETURN_STRING(".jpc" + !inc_dot, 1);
+   temp = ".jpc";
case IMAGE_FILETYPE_JP2:
-   RETURN_STRING(".jp2" + !inc_dot, 1);
+   temp = ".jp2";
case IMAGE_FILETYPE_XBM:
-   RETURN_STRING(".xbm" + !inc_dot, 1);
+   temp = ".xbm";
+   }
+   if (temp) {
+   if (UG(unicode)) {
+   UChar *u_temp = zend_ascii_to_unicode(temp + !inc_dot, 
strlen(temp)+inc_dot ZEND_FILE_LINE_CC);
+   RETURN_UNICODE(u_temp, 0);
+   } else {
+   RETURN_STRING(temp + !inc_dot, 1);
+   }
}
 
RETURN_FALSE;
@@ -1357,7 +1373,13 @@
add_index_long(return_value, 1, result->height);
add_index_long(return_value, 2, itype);
spprintf(&temp, 0, "width=\"%d\" height=\"%d\"", result->width, 
result->height);
-   add_index_string(return_value, 3, temp, 0);
+   if (UG(unicode)) {
+   UChar *u_temp = zend_ascii_to_unicode(temp, 
strlen(temp)+1 ZEND_FILE_LINE_CC);
+   add_index_unicode(return_value, 3, u_temp, 0);
+   efree(temp);
+   } else {
+   add_index_string(return_value, 3, temp, 0);
+   }
 
if (result->bits != 0) {
add_assoc_long(return_value, "bits", result->bits);
@@ -1365,7 +1387,13 @@
 

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

2005-08-16 Thread Jani Taskinen


a) Why not call it 'return_type' ??
b) Why don't you put it as last parameter like we have used to do?
c) Read CODING_STANDARDS before you commit anything else..
   (we don't use extra spaces everywhere)

--Jani


On Tue, 16 Aug 2005, Rolland Santimano wrote:


rolland Tue Aug 16 02:02:57 2005 EDT

 Modified files:
   /php-src/ext/standardphp_string.h string.c
 Log:
 php_trim() takes extra arg to determine string type to be returned


http://cvs.php.net/diff.php/php-src/ext/standard/php_string.h?r1=1.88&r2=1.89&ty=u
Index: php-src/ext/standard/php_string.h
diff -u php-src/ext/standard/php_string.h:1.88 
php-src/ext/standard/php_string.h:1.89
--- php-src/ext/standard/php_string.h:1.88  Thu Aug 11 19:35:59 2005
+++ php-src/ext/standard/php_string.h   Tue Aug 16 02:02:55 2005
@@ -17,7 +17,7 @@
   +--+
*/

-/* $Id: php_string.h,v 1.88 2005/08/11 23:35:59 andrei Exp $ */
+/* $Id: php_string.h,v 1.89 2005/08/16 06:02:55 rolland Exp $ */

/* Synced with php 3.0 revision 1.43 1999-06-16 [ssb] */

@@ -132,7 +132,7 @@
int needle_len, char *str, int str_len, int *_new_length, int 
case_sensitivity, int *replace_count);
PHPAPI char *php_str_to_str(char *haystack, int length, char *needle,
int needle_len, char *str, int str_len, int *_new_length);
-PHPAPI char *php_trim(char *c, int len, char *what, int what_len, zval 
*return_value, int mode TSRMLS_DC);
+PHPAPI char *php_trim(char *c, int len, char *what, int what_len, zend_uchar 
str_type, zval *return_value, int mode TSRMLS_DC);
PHPAPI size_t php_strip_tags(char *rbuf, int len, int *state, char *allow, int 
allow_len);
PHPAPI int php_char_to_str_ex(char *str, uint len, char from, char *to, int 
to_len, pval *result, int case_sensitivity, int *replace_count);
PHPAPI int php_char_to_str(char *str, uint len, char from, char *to, int 
to_len, pval *result);
http://cvs.php.net/diff.php/php-src/ext/standard/string.c?r1=1.453&r2=1.454&ty=u
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.453 php-src/ext/standard/string.c:1.454
--- php-src/ext/standard/string.c:1.453 Mon Aug 15 15:12:59 2005
+++ php-src/ext/standard/string.c   Tue Aug 16 02:02:56 2005
@@ -18,7 +18,7 @@
   +--+
 */

-/* $Id: string.c,v 1.453 2005/08/15 19:12:59 johannes Exp $ */
+/* $Id: string.c,v 1.454 2005/08/16 06:02:56 rolland Exp $ */

/* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */

@@ -538,7 +538,7 @@
 * mode 3 : trim left and right
 * what indicates which chars are to be trimmed. NULL->default (' \t\n\r\v\0')
 */
-PHPAPI char *php_trim(char *c, int len, char *what, int what_len, zval 
*return_value, int mode TSRMLS_DC)
+PHPAPI char *php_trim(char *c, int len, char *what, int what_len, zend_uchar 
str_type, zval *return_value, int mode TSRMLS_DC)
{
register int i;
int trimmed = 0;
@@ -572,7 +572,11 @@
}

if (return_value) {
-   RETVAL_STRINGL(c, len, 1);
+   if ( str_type == IS_BINARY ) {
+   RETVAL_BINARYL(c, len, 1);
+   } else {
+   RETVAL_STRINGL(c, len, 1);
+   }
} else {
return estrndup(c, len);
}
@@ -750,13 +754,13 @@
if ( str_type == IS_UNICODE ) {
php_u_trim(str, str_len, what, what_len, return_value, 
mode TSRMLS_CC);
} else {
-   php_trim(str, str_len, what, what_len, return_value, 
mode TSRMLS_CC);
+   php_trim(str, str_len, what, what_len, str_type, 
return_value, mode TSRMLS_CC);
}
} else {
if ( str_type == IS_UNICODE ) {
php_u_trim(str, str_len, NULL, 0, return_value, mode 
TSRMLS_CC);
} else {
-   php_trim(str, str_len, NULL, 0, return_value, mode 
TSRMLS_CC);
+   php_trim(str, str_len, NULL, 0, str_type, return_value, 
mode TSRMLS_CC);
}
}
}




--
Donate @ http://pecl.php.net/wishlist.php/sniper

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



[PHP-CVS] Re: Test suite for unicode mode (was RE: [PHP-CVS] cvs: php-src / run-tests.php /ext/pdo/tests pdo_001.phpt ...)

2005-08-16 Thread Derick Rethans
On Tue, 16 Aug 2005, Dmitry Stogov wrote:

> We discussed this with Andrei long time ago.
> I cannot remember did we it internally or in unicode list.

It was not on the unicode list. It's nice to talk to the authors of a 
specific set of code first before pushing large changes into it. (that's 
what Andrei wants when people do things with PCRE too).

> I willn't rollback the patch right now, because this will slowdown PHP 
> 6 fixing. It is hard to see those failures are bugs and those not.
> 
> I willn't against other good solution and will rollback patch if it'll
> occur.
> 
> Right now any test script can be extended with additional section
> --UEXPECT--, --UEXPECTF- or --UEXPECTREGEX--, that is uses instead of
> --EXPECT-- in unicode mode. If this sections are omitted then regular
> --EXPECT-- is used.
> 
> In most cases --UEXPECT...-- section can be get from --EXPECT...-- automatic
> by replacing 'string(' to 'unicode(' and '["' to '[u"'. This automation is
> not always right and it doesn't implemented now.
> 
> Any other solutions?

The main problem that I've with the current situation that you have to 
supply a --U section for Unicode tests to work, which is quite annoying.

We need to come up with something that allows us to use one --EXPECT--, 
not sure how yet, but I think we can manage that.

Derick

-- 
Derick Rethans
http://derickrethans.nl | http://ez.no | http://xdebug.org

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