[PHP-CVS] svn: /php/php-src/trunk/Zend/tests/ bug60978.phpt

2012-03-11 Thread Xinchen Hui
laruence Sun, 11 Mar 2012 14:44:07 +

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

Log:
fix test

Changed paths:
U   php/php-src/trunk/Zend/tests/bug60978.phpt

Modified: php/php-src/trunk/Zend/tests/bug60978.phpt
===
--- php/php-src/trunk/Zend/tests/bug60978.phpt  2012-03-11 13:45:23 UTC (rev 
324105)
+++ php/php-src/trunk/Zend/tests/bug60978.phpt  2012-03-11 14:44:07 UTC (rev 
324106)
@@ -3,7 +3,7 @@
 --FILE--
 ?php
 $php = getenv('TEST_PHP_EXECUTABLE');
-exec($php . '-n -r exit(2);', $output, $exit_code);
+exec($php . ' -n -r exit(2);', $output, $exit_code);
 echo $exit_code;
 ?
 --EXPECT--

-- 
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/zlib/ php_zlib.h tests/bug61287.phpt zlib.c

2012-03-05 Thread Michael Wallner
mike Mon, 05 Mar 2012 15:35:22 +

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

Log:
fix bug #61287 (A particular string fails to decompress)

Bug: https://bugs.php.net/61287 (Assigned) A particular string fails to 
decompress
  
Changed paths:
U   php/php-src/trunk/ext/zlib/php_zlib.h
A   php/php-src/trunk/ext/zlib/tests/bug61287.phpt
U   php/php-src/trunk/ext/zlib/zlib.c

Modified: php/php-src/trunk/ext/zlib/php_zlib.h
===
--- php/php-src/trunk/ext/zlib/php_zlib.h   2012-03-05 15:33:38 UTC (rev 
323915)
+++ php/php-src/trunk/ext/zlib/php_zlib.h   2012-03-05 15:35:22 UTC (rev 
323916)
@@ -65,6 +65,7 @@
 #define phpext_zlib_ptr zlib_module_ptr

 #ifdef ZTS
+# include TSRM.h
 # define ZLIBG(v) TSRMG(zlib_globals_id, zend_zlib_globals *, v)
 #else
 # define ZLIBG(v) (zlib_globals.v)

Added: php/php-src/trunk/ext/zlib/tests/bug61287.phpt
===
--- php/php-src/trunk/ext/zlib/tests/bug61287.phpt  
(rev 0)
+++ php/php-src/trunk/ext/zlib/tests/bug61287.phpt  2012-03-05 15:35:22 UTC 
(rev 323916)
@@ -0,0 +1,24 @@
+--TEST--
+bug #61287 - inflate needs the terminating null byte
+--SKIPIF--
+?php extension_loaded(zlib) or die(SKIP need zlib);
+--FILE--
+?php
+$array = array(
+'region_id' = 1,
+'discipline' = 23,
+'degrees' = array(),
+'country_id' = 27
+);
+
+$serialized = serialize($array);
+
+$deflated = gzdeflate($serialized, 9);
+$inflated = gzinflate($deflated);
+
+echo strlen($inflated),\n;
+?
+Done
+--EXPECT--
+92
+Done

Modified: php/php-src/trunk/ext/zlib/zlib.c
===
--- php/php-src/trunk/ext/zlib/zlib.c   2012-03-05 15:33:38 UTC (rev 323915)
+++ php/php-src/trunk/ext/zlib/zlib.c   2012-03-05 15:35:22 UTC (rev 323916)
@@ -400,7 +400,7 @@
status = inflateInit2(Z, encoding);
if (Z_OK == status) {
Z.next_in = (Bytef *) in_buf;
-   Z.avail_in = in_len;
+   Z.avail_in = in_len + 1; /* NOTE: data must be zero 
terminated */

switch (status = php_zlib_inflate_rounds(Z, max_len, 
out_buf, out_len)) {
case Z_STREAM_END:

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

[PHP-CVS] svn: /php/php-src/trunk/ UPGRADING

2012-03-05 Thread Christopher Jones
sixd Mon, 05 Mar 2012 20:14:04 +

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

Log:
Align section headings with the latest (5.4) migration on-line doc.
This will aid future reuse of UPGRADING text.

Changed paths:
U   php/php-src/trunk/UPGRADING

Modified: php/php-src/trunk/UPGRADING
===
--- php/php-src/trunk/UPGRADING 2012-03-05 20:08:30 UTC (rev 323923)
+++ php/php-src/trunk/UPGRADING 2012-03-05 20:14:04 UTC (rev 323924)
@@ -1,192 +1,82 @@
 $Id$

-UPGRADE NOTES - PHP X.Y
+PHP X.Y UPGRADE NOTES

-1. Changes made to default configuration
-2. Reserved words and classes
-3. Changes made to engine behaviour
-4. Changes made to existing functions
-5. Changes made to existing methods
-6. Changes made to existing classes
-7. Deprecated
-8. Removed
-9. Extensions:
- a. moved out to PECL and actively maintained there
- b. no longer maintained
- c. with changed behaviour
- d. no longer possible to disable
-10. Changes in SAPI support
-11. Changes in INI directives
-12. Syntax additions
-13. Windows support
-14. New in PHP X.Y:
- a. New libraries
- b. New extensions
- c. New stream wrappers
- d. New stream filters
- e. New functions
- f. New global constants
- g. New classes
- h. New methods
- i. New class constants
- j. New hash algorithms
- k. New Syntax
+1. Backward Incompatible Changes
+2. New Features
+2. Changes in SAPI modules
+3. Deprecated Functionality
+4. Changed Functions
+5. New Functions
+6. New Classes and Interfaces
+7. Removed Extensions
+8. Other Changes to Extensions
+9. New Global Constants
+10. Changes to INI File Handling
+11. Other Changes

+
 
-1. Changes made to default configuration
+1. Backward Incompatible Changes
 

--
-
-=
-2. Reserved words and classes
-=
-
--
-
-=
-3. Changes made to engine behaviour
-=
-
--
-
-=
-4. Changes made to existing functions
-=
-
--
-
-===
-5. Changes made to existing methods
-===
-
--
-
-===
-6. Changes made to existing classes
-===
-
--
-
-=
-7. Deprecated
-=
-
-- The preg_replace /e modifier is now deprecated.
-  You should use preg_replace_callback instead.
-
-==
-8. Removed
-==
-
-a. removed features
-
-   -
-
-b. removed ini directives
-
-   -
-
-c. removed functions
-
-  -
-
-d. removed syntax
-
-   -
-
-=
-9. Extensions
-=
-
- a. moved out to PECL and actively maintained there
-
--
-
- b. no longer maintained
-
--
-
- c. with changed behaviour
-
--
-
- d. no longer possible to disable
-
--
-
-==
-10. Changes in SAPI support
-==
-
--
-
-=
-11. Changes in INI directives
-=
-
--
-
-
-12. Syntax additions
-
-
--
-
-===
-13. Windows support
-===
-
 - Drop Windows XP and 2003 support. (Pierre)

-===
-14. New in PHP X.Y:
-===
+
+2. New Features
+

- a. New libraries

-   -
+
+2. Changes in SAPI modules
+

- b. New extensions

-   -
+
+3. Deprecated Functionality
+

- c. New stream wrappers
+- The preg_replace /e modifier is now deprecated.  Use
+  preg_replace_callback instead.
+  (https://wiki.php.net/rfc/remove_preg_replace_eval_modifier)

-   -
+
+4. Changed Functions
+

- d. New stream filters

-   -
+
+5. New Functions
+

- e. New functions

-   - Extension:
- - function()
+
+6. New Classes and Interfaces
+

- f. New global constants
+- SPL:
+  - SplFixedArray::__wakeup()

-   -
+
+7. Removed Extensions
+

- g. New classes

-   - Extension:
- - ClassName
-
- h. New methods
+
+8. Other Changes to Extensions
+

-- Spl:
- 

[PHP-CVS] svn: /php/php-src/trunk/ ext/pcre/php_pcre.c ext/pcre/tests/002.phpt ext/pcre/tests/004.phpt tests/lang/bug24403.phpt

2012-03-04 Thread Nikita Popov
nikicSun, 04 Mar 2012 13:39:12 +

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

Log:
Deprecate /e modifier

See https://wiki.php.net/rfc/remove_preg_replace_eval_modifier.

Changed paths:
U   php/php-src/trunk/ext/pcre/php_pcre.c
U   php/php-src/trunk/ext/pcre/tests/002.phpt
U   php/php-src/trunk/ext/pcre/tests/004.phpt
U   php/php-src/trunk/tests/lang/bug24403.phpt

Modified: php/php-src/trunk/ext/pcre/php_pcre.c
===
--- php/php-src/trunk/ext/pcre/php_pcre.c   2012-03-04 13:31:04 UTC (rev 
323861)
+++ php/php-src/trunk/ext/pcre/php_pcre.c   2012-03-04 13:39:12 UTC (rev 
323862)
@@ -1019,6 +1019,10 @@
replace_end = replace + replace_len;
}

+   if (eval) {
+   php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, The /e modifier 
is deprecated, use preg_replace_callback instead);
+   }
+
/* Calculate the size of the offsets array, and allocate memory for it. 
*/
rc = pcre_fullinfo(pce-re, extra, PCRE_INFO_CAPTURECOUNT, 
num_subpats);
if (rc  0) {

Modified: php/php-src/trunk/ext/pcre/tests/002.phpt
===
--- php/php-src/trunk/ext/pcre/tests/002.phpt   2012-03-04 13:31:04 UTC (rev 
323861)
+++ php/php-src/trunk/ext/pcre/tests/002.phpt   2012-03-04 13:39:12 UTC (rev 
323862)
@@ -34,6 +34,8 @@
 Warning: preg_replace(): Compilation failed: missing terminating ] for 
character class at offset 8 in %s002.php on line 11
 NULL

+Deprecated: preg_replace(): The /e modifier is deprecated, use 
preg_replace_callback instead in %s on line 12
+
 Parse error: %s in %s002.php(12) : regexp code on line 1

 Fatal error: preg_replace(): Failed evaluating code:

Modified: php/php-src/trunk/ext/pcre/tests/004.phpt
===
--- php/php-src/trunk/ext/pcre/tests/004.phpt   2012-03-04 13:31:04 UTC (rev 
323861)
+++ php/php-src/trunk/ext/pcre/tests/004.phpt   2012-03-04 13:39:12 UTC (rev 
323862)
@@ -16,7 +16,7 @@

 
var_dump(preg_split('/PHP_(?:NAMED_)?(?:FUNCTION|METHOD)\s*\((\w+(?:,\s*\w+)?)\)/S',
 PHP_FUNCTION(s, preg_match)\n{\nlalala, -1, PREG_SPLIT_DELIM_CAPTURE | 
PREG_SPLIT_OFFSET_CAPTURE));
 ?
---EXPECT--
+--EXPECTF--
 int(2)
 array(2) {
   [0]=
@@ -117,6 +117,8 @@
 }
   }
 }
+
+Deprecated: preg_replace(): The /e modifier is deprecated, use 
preg_replace_callback instead in %s on line %d
 string(9) hello



Modified: php/php-src/trunk/tests/lang/bug24403.phpt
===
--- php/php-src/trunk/tests/lang/bug24403.phpt  2012-03-04 13:31:04 UTC (rev 
323861)
+++ php/php-src/trunk/tests/lang/bug24403.phpt  2012-03-04 13:39:12 UTC (rev 
323862)
@@ -17,4 +17,5 @@
 }
 new a();
 ?
---EXPECT--
+--EXPECTF--
+Deprecated: preg_replace(): The /e modifier is deprecated, use 
preg_replace_callback instead in %s on line %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/ ext/pcre/php_pcre.c ext/pcre/tests/002.phpt ext/pcre/tests/004.phpt tests/lang/bug24403.phpt

2012-03-04 Thread Christopher Jones


On Mar 4, 2012, at 5:39 AM, Nikita Popov ni...@php.net wrote:

 nikicSun, 04 Mar 2012 13:39:12 +
 
 Revision: http://svn.php.net/viewvc?view=revisionrevision=323862
 
 Log:
 Deprecate /e modifier
 

This needs to be in UPGRADING and NEWS.

Chris


 See https://wiki.php.net/rfc/remove_preg_replace_eval_modifier.
 
 Changed paths:
U   php/php-src/trunk/ext/pcre/php_pcre.c
U   php/php-src/trunk/ext/pcre/tests/002.phpt
U   php/php-src/trunk/ext/pcre/tests/004.phpt
U   php/php-src/trunk/tests/lang/bug24403.phpt
 
 Modified: php/php-src/trunk/ext/pcre/php_pcre.c
 ===
 --- php/php-src/trunk/ext/pcre/php_pcre.c2012-03-04 13:31:04 UTC (rev 
 323861)
 +++ php/php-src/trunk/ext/pcre/php_pcre.c2012-03-04 13:39:12 UTC (rev 
 323862)
 @@ -1019,6 +1019,10 @@
replace_end = replace + replace_len;
}
 
 +if (eval) {
 +php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, The /e modifier is 
 deprecated, use preg_replace_callback instead);
 +}
 +
/* Calculate the size of the offsets array, and allocate memory for it. */
rc = pcre_fullinfo(pce-re, extra, PCRE_INFO_CAPTURECOUNT, num_subpats);
if (rc  0) {
 
 Modified: php/php-src/trunk/ext/pcre/tests/002.phpt
 ===
 --- php/php-src/trunk/ext/pcre/tests/002.phpt2012-03-04 13:31:04 UTC (rev 
 323861)
 +++ php/php-src/trunk/ext/pcre/tests/002.phpt2012-03-04 13:39:12 UTC (rev 
 323862)
 @@ -34,6 +34,8 @@
 Warning: preg_replace(): Compilation failed: missing terminating ] for 
 character class at offset 8 in %s002.php on line 11
 NULL
 
 +Deprecated: preg_replace(): The /e modifier is deprecated, use 
 preg_replace_callback instead in %s on line 12
 +
 Parse error: %s in %s002.php(12) : regexp code on line 1
 
 Fatal error: preg_replace(): Failed evaluating code:
 
 Modified: php/php-src/trunk/ext/pcre/tests/004.phpt
 ===
 --- php/php-src/trunk/ext/pcre/tests/004.phpt2012-03-04 13:31:04 UTC (rev 
 323861)
 +++ php/php-src/trunk/ext/pcre/tests/004.phpt2012-03-04 13:39:12 UTC (rev 
 323862)
 @@ -16,7 +16,7 @@
 
 var_dump(preg_split('/PHP_(?:NAMED_)?(?:FUNCTION|METHOD)\s*\((\w+(?:,\s*\w+)?)\)/S',
  PHP_FUNCTION(s, preg_match)\n{\nlalala, -1, PREG_SPLIT_DELIM_CAPTURE | 
 PREG_SPLIT_OFFSET_CAPTURE));
 ?
 ---EXPECT--
 +--EXPECTF--
 int(2)
 array(2) {
   [0]=
 @@ -117,6 +117,8 @@
 }
   }
 }
 +
 +Deprecated: preg_replace(): The /e modifier is deprecated, use 
 preg_replace_callback instead in %s on line %d
 string(9) hello
 
 
 
 Modified: php/php-src/trunk/tests/lang/bug24403.phpt
 ===
 --- php/php-src/trunk/tests/lang/bug24403.phpt2012-03-04 13:31:04 UTC 
 (rev 323861)
 +++ php/php-src/trunk/tests/lang/bug24403.phpt2012-03-04 13:39:12 UTC 
 (rev 323862)
 @@ -17,4 +17,5 @@
 }
 new a();
 ?
 ---EXPECT--
 +--EXPECTF--
 +Deprecated: preg_replace(): The /e modifier is deprecated, use 
 preg_replace_callback instead in %s on line %d
 
 -- 
 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/ main/network.c win32/build/config.w32.h.in win32/inet.c win32/inet.h win32/sendmail.c

2012-03-04 Thread Christopher Jones


On Mar 4, 2012, at 7:08 AM, Pierre Joye paj...@php.net wrote:

 pajoye   Sun, 04 Mar 2012 15:08:12 +
 
 Revision: http://svn.php.net/viewvc?view=revisionrevision=323865
 
 Log:
 - bump minimum version, no more XP/2003

Can you add this to UPGRADING and NEWS?

Chris 

 
 Changed paths:
U   php/php-src/trunk/main/network.c
U   php/php-src/trunk/win32/build/config.w32.h.in
U   php/php-src/trunk/win32/inet.c
U   php/php-src/trunk/win32/inet.h
U   php/php-src/trunk/win32/sendmail.c
 
 Modified: php/php-src/trunk/main/network.c
 ===
 --- php/php-src/trunk/main/network.c2012-03-04 14:57:07 UTC (rev 323864)
 +++ php/php-src/trunk/main/network.c2012-03-04 15:08:12 UTC (rev 323865)
 @@ -25,7 +25,10 @@
 
 #include stddef.h
 
 +
 +
 #ifdef PHP_WIN32
 +# include Ws2tcpip.h
 # include win32/inet.h
 # define O_RDONLY _O_RDONLY
 # include win32/param.h
 
 Modified: php/php-src/trunk/win32/build/config.w32.h.in
 ===
 --- php/php-src/trunk/win32/build/config.w32.h.in2012-03-04 14:57:07 UTC 
 (rev 323864)
 +++ php/php-src/trunk/win32/build/config.w32.h.in2012-03-04 15:08:12 UTC 
 (rev 323865)
 @@ -6,8 +6,8 @@
 /* Define the minimum supported version */
 #undef _WIN32_WINNT
 #undef NTDDI_VERSION
 -#define _WIN32_WINNT 0x502
 -#define NTDDI_VERSION  _WIN32_WIN2K
 +#define _WIN32_WINNT 0x0600
 +#define NTDDI_VERSION  0x06000100
 
 /* Default PHP / PEAR directories */
 #define PHP_CONFIG_FILE_PATH (getenv(SystemRoot))?getenv(SystemRoot):
 
 Modified: php/php-src/trunk/win32/inet.c
 ===
 --- php/php-src/trunk/win32/inet.c2012-03-04 14:57:07 UTC (rev 323864)
 +++ php/php-src/trunk/win32/inet.c2012-03-04 15:08:12 UTC (rev 323865)
 @@ -1,12 +1,13 @@
 #include config.w32.h
 -#if (_WIN32_WINNT  0x0600) /* Vista/2k8 have these functions */
 #include php.h
 #include winsock2.h
 #include windows.h
 #include Ws2tcpip.h
 
 #include inet.h
 +#if (_WIN32_WINNT  0x0600) /* Vista/2k8 have these functions */
 
 +
 PHPAPI int inet_pton(int af, const char* src, void* dst)
 {
int address_length;
 @@ -76,6 +77,8 @@
return NULL;
 }
 
 +#endif
 +
 int inet_aton(const char *cp, struct in_addr *inp) {
   inp-s_addr = inet_addr(cp);
 
 @@ -85,4 +88,3 @@
 
   return 1;
 }
 -#endif
 
 Modified: php/php-src/trunk/win32/inet.h
 ===
 --- php/php-src/trunk/win32/inet.h2012-03-04 14:57:07 UTC (rev 323864)
 +++ php/php-src/trunk/win32/inet.h2012-03-04 15:08:12 UTC (rev 323865)
 @@ -6,5 +6,6 @@
 #if (_WIN32_WINNT = 0x502)
 PHPAPI int inet_pton(int af, const char* src, void* dst);
 PHPAPI const char* inet_ntop(int af, const void* src, char* dst, size_t size);
 +#endif
 +
 PHPAPI int inet_aton(const char *cp, struct in_addr *inp);
 -#endif
 
 Modified: php/php-src/trunk/win32/sendmail.c
 ===
 --- php/php-src/trunk/win32/sendmail.c2012-03-04 14:57:07 UTC (rev 323864)
 +++ php/php-src/trunk/win32/sendmail.c2012-03-04 15:08:12 UTC (rev 323865)
 @@ -25,6 +25,7 @@
 #ifndef NETWARE
 #include winsock2.h
 #include time.h
 +# include Ws2tcpip.h
 #else/* NETWARE */
 #include netware/sendmail_nw.h
 #endif/* NETWARE */
 
 -- 
 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/trunk/ NEWS UPGRADING

2012-03-04 Thread Nikita Popov
nikicSun, 04 Mar 2012 16:32:01 +

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

Log:
NEWS and UPGRADING for r323862

Changed paths:
U   php/php-src/trunk/NEWS
U   php/php-src/trunk/UPGRADING

Modified: php/php-src/trunk/NEWS
===
--- php/php-src/trunk/NEWS  2012-03-04 16:20:55 UTC (rev 323880)
+++ php/php-src/trunk/NEWS  2012-03-04 16:32:01 UTC (rev 323881)
@@ -28,6 +28,10 @@
still exists for backward compatibility but is doing nothing). 
(Pierrick)
   . Fixed bug #54995 (Missing CURLINFO_RESPONSE_CODE support). (Pierrick)

+- PCRE:
+  . Deprecated the /e modifier
+(https://wiki.php.net/rfc/remove_preg_replace_eval_modifier). (Nikita 
Popov)
+
 - pgsql
   . Added pg_escape_literal() and pg_escape_identifier() (Yasuo)


Modified: php/php-src/trunk/UPGRADING
===
--- php/php-src/trunk/UPGRADING 2012-03-04 16:20:55 UTC (rev 323880)
+++ php/php-src/trunk/UPGRADING 2012-03-04 16:32:01 UTC (rev 323881)
@@ -72,7 +72,8 @@
 7. Deprecated
 =

--
+- The preg_replace /e modifier is now deprecated.
+  You should use preg_replace_callback instead.

 ==
 8. Removed

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

[PHP-CVS] svn: /php/php-src/trunk/ NEWS UPGRADING

2012-03-04 Thread Pierre Joye
pajoye   Sun, 04 Mar 2012 17:02:55 +

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

Log:
- notes about xp2003 drop

Changed paths:
U   php/php-src/trunk/NEWS
U   php/php-src/trunk/UPGRADING

Modified: php/php-src/trunk/NEWS
===
--- php/php-src/trunk/NEWS  2012-03-04 17:00:40 UTC (rev 323885)
+++ php/php-src/trunk/NEWS  2012-03-04 17:02:55 UTC (rev 323886)
@@ -3,6 +3,7 @@
 ?? ??? 201?, PHP 5.5.0

 - General improvements:
+  . Drop Windows XP and 2003 support. (Pierre)
   . World domination

 - cURL:

Modified: php/php-src/trunk/UPGRADING
===
--- php/php-src/trunk/UPGRADING 2012-03-04 17:00:40 UTC (rev 323885)
+++ php/php-src/trunk/UPGRADING 2012-03-04 17:02:55 UTC (rev 323886)
@@ -137,7 +137,7 @@
 13. Windows support
 ===

--
+- Drop Windows XP and 2003 support. (Pierre)

 ===
 14. New in PHP X.Y:

-- 
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/sockets/ multicast.h

2012-03-04 Thread Gustavo André dos Santos Lopes
cataphract   Sun, 04 Mar 2012 19:17:49 +

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

Log:
- Allow Windows builds targeting Vista and above have access to the RFC 3678
  API for multicasting.

Changed paths:
U   php/php-src/trunk/ext/sockets/multicast.h

Modified: php/php-src/trunk/ext/sockets/multicast.h
===
--- php/php-src/trunk/ext/sockets/multicast.h   2012-03-04 19:08:18 UTC (rev 
323895)
+++ php/php-src/trunk/ext/sockets/multicast.h   2012-03-04 19:17:49 UTC (rev 
323896)
@@ -18,8 +18,7 @@

 /* $Id$ */

-#if defined(MCAST_JOIN_GROUP)  \
-   (!defined(PHP_WIN32) || (_WIN32_WINNT = 0x600  
SOCKETS_ENABLE_VISTA_API))
+#if defined(MCAST_JOIN_GROUP)
 #define RFC3678_API 1
 /* has block/unblock and source membership, in this case for both IPv4 and 
IPv6 */
 #define HAS_MCAST_EXT 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/ NEWS Zend/tests/bug61011.phpt Zend/zend_vm_def.h Zend/zend_vm_execute.h

2012-02-25 Thread Xinchen Hui
laruence Sat, 25 Feb 2012 13:56:59 +

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

Log:
Fixed bug #61011 (Crash when an exception is thrown by __autoload accessing a 
static property)

Bug: https://bugs.php.net/61011 (Assigned) Crash when an exception is thrown by 
__autoload accessing a static property
  
Changed paths:
U   php/php-src/trunk/NEWS
U   php/php-src/trunk/Zend/tests/bug61011.phpt
U   php/php-src/trunk/Zend/zend_vm_def.h
U   php/php-src/trunk/Zend/zend_vm_execute.h

Modified: php/php-src/trunk/NEWS
===
--- php/php-src/trunk/NEWS	2012-02-25 13:27:57 UTC (rev 323509)
+++ php/php-src/trunk/NEWS	2012-02-25 13:56:59 UTC (rev 323510)
@@ -9,6 +9,8 @@
   . Fixed bug #61165 (Segfault - strip_tags()). (Laruence)
   . Fixed bug #61072 (Memory leak when restoring an exception handler).
 (Nikic, Laruence)
+  . Fixed bug #61011 (Crash when an exception is thrown by __autoload
+accessing a static property). (Laruence)
   . Fixed bug #61000 (Exceeding max nesting level doesn't delete numerical
 vars). (Laruence)
   . Fixed bug #60978 (exit code incorrect). (Laruence)

Modified: php/php-src/trunk/Zend/tests/bug61011.phpt
===
--- php/php-src/trunk/Zend/tests/bug61011.phpt	2012-02-25 13:27:57 UTC (rev 323509)
+++ php/php-src/trunk/Zend/tests/bug61011.phpt	2012-02-25 13:56:59 UTC (rev 323510)
@@ -1,16 +1,34 @@
 --TEST--
 Bug #61011 (Crash when an exception is thrown by __autoload accessing a static property)
---XFAIL--
-#61011 have not been fixed yet
 --FILE--
 ?php
-function __autoload($class) {
-throw new Exception($class);
+function __autoload($name) {
+	throw new Exception($name);
 }
-
 try {
-NoExistsClass::$property;
+	echo AAA::$a; //zend_fetch_var_address_helper
 } catch (Exception $e) {
+	try {
+		echo AAA::XXX; //ZEND_FETCH_CONSTANT
+	} catch (Exception $e) {
+		try {
+			echo AAA::foo(); //ZEND_INIT_STATIC_METHOD_CALL
+		} catch (Exception $e) {
+			try  {
+unset(AAA::$a); // ZEND_UNSET_VAR
+			} catch (Exception $e){
+try {
+	isset(::$a); // ZEND_ISSET_ISEMPTY_VAR
+} catch (Exception $e) {
+	try  {
+		$a = array(AAA, foo);
+		$a(); //ZEND_INIT_FCALL_BY_NAME
+	} catch (Exception $e) {
+	}
+}
+			}
+		}
+	}
 }
 echo 'okey';
 --EXPECT--

Modified: php/php-src/trunk/Zend/zend_vm_def.h
===
--- php/php-src/trunk/Zend/zend_vm_def.h	2012-02-25 13:27:57 UTC (rev 323509)
+++ php/php-src/trunk/Zend/zend_vm_def.h	2012-02-25 13:56:59 UTC (rev 323510)
@@ -1039,6 +1039,14 @@
 ce = CACHED_PTR(opline-op2.literal-cache_slot);
 			} else {
 ce = zend_fetch_class_by_name(Z_STRVAL_P(opline-op2.zv), Z_STRLEN_P(opline-op2.zv), opline-op2.literal + 1, 0 TSRMLS_CC);
+if (UNEXPECTED(ce == NULL)) {
+	if (OP1_TYPE != IS_CONST  varname == tmp_varname) {
+		zval_dtor(tmp_varname);
+	}
+	FREE_OP1();
+	CHECK_EXCEPTION();
+	ZEND_VM_NEXT_OPCODE();
+}
 CACHE_PTR(opline-op2.literal-cache_slot, ce);
 			}
 		} else {
@@ -2234,7 +2242,8 @@
 		} else {
 			ce = zend_fetch_class_by_name(Z_STRVAL_P(opline-op1.zv), Z_STRLEN_P(opline-op1.zv), opline-op1.literal + 1, opline-extended_value TSRMLS_CC);
 			if (UNEXPECTED(ce == NULL)) {
-zend_error_noreturn(E_ERROR, Class '%s' not found, Z_STRVAL_P(opline-op1.zv));
+CHECK_EXCEPTION();
+ZEND_VM_NEXT_OPCODE();
 			}
 			CACHE_PTR(opline-op1.literal-cache_slot, ce);
 		}
@@ -2414,7 +2423,8 @@
 			if (Z_TYPE_PP(obj) == IS_STRING) {
 ce = zend_fetch_class_by_name(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj), NULL, 0 TSRMLS_CC);
 if (UNEXPECTED(ce == NULL)) {
-	zend_error_noreturn(E_ERROR, Class '%s' not found, Z_STRVAL_PP(obj));
+	CHECK_EXCEPTION();
+	ZEND_VM_NEXT_OPCODE();
 }
 EX(called_scope) = ce;
 EX(object) = NULL;
@@ -2964,6 +2974,7 @@
 		catch_ce = CACHED_PTR(opline-op1.literal-cache_slot);
 	} else {
 		catch_ce = zend_fetch_class_by_name(Z_STRVAL_P(opline-op1.zv), Z_STRLEN_P(opline-op1.zv), opline-op1.literal + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC);
+
 		CACHE_PTR(opline-op1.literal-cache_slot, catch_ce);
 	}
 	ce = Z_OBJCE_P(EG(exception));
@@ -3492,7 +3503,8 @@
 			} else {
 ce = zend_fetch_class_by_name(Z_STRVAL_P(opline-op1.zv), Z_STRLEN_P(opline-op1.zv), opline-op1.literal + 1, opline-extended_value TSRMLS_CC);
 if (UNEXPECTED(ce == NULL)) {
-	zend_error_noreturn(E_ERROR, Undefined class constant '%s', Z_STRVAL_P(opline-op2.zv));
+	CHECK_EXCEPTION();
+	ZEND_VM_NEXT_OPCODE();
 }
 CACHE_PTR(opline-op1.literal-cache_slot, ce);
 			}
@@ -3879,6 +3891,16 @@
 ce = CACHED_PTR(opline-op2.literal-cache_slot);
 			} else {
 ce = zend_fetch_class_by_name(Z_STRVAL_P(opline-op2.zv), Z_STRLEN_P(opline-op2.zv), opline-op2.literal + 1, 0 TSRMLS_CC);
+if 

[PHP-CVS] svn: /php/php-src/trunk/Zend/tests/ bug61165.phpt

2012-02-24 Thread Xinchen Hui
laruence Sat, 25 Feb 2012 03:12:54 +

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

Log:
Tests for bug #61165

Bug: https://bugs.php.net/61165 (Assigned) Segfault - strip_tags()
  
Changed paths:
A   php/php-src/trunk/Zend/tests/bug61165.phpt

Added: php/php-src/trunk/Zend/tests/bug61165.phpt
===
--- php/php-src/trunk/Zend/tests/bug61165.phpt  (rev 0)
+++ php/php-src/trunk/Zend/tests/bug61165.phpt  2012-02-25 03:12:54 UTC (rev 
323485)
@@ -0,0 +1,30 @@
+--TEST--
+Bug #61165 (Segfault - strip_tags())
+--XFAILD--
+#61165 doesn't fix yet
+--FILE--
+?php
+
+$handler = NULL;
+class T {
+public $_this;
+
+public function __toString() {
+   global $handler;
+   $handler = $this;
+$this-_this = $this; // -- uncoment this
+return 'A';
+}
+}
+
+$t = new T;
+for ($i = 0; $i  3; $i++) {
+strip_tags($t);
+   strip_tags(new T);
+echo $i\n;
+}
+--EXPECTF--
+object(T)#%d (1) {
+  [_this]=
+  *RECURSION*
+}

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

2012-02-24 Thread Xinchen Hui
laruence Sat, 25 Feb 2012 03:16:28 +

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

Log:
typo

Changed paths:
U   php/php-src/trunk/Zend/tests/bug61011.phpt
U   php/php-src/trunk/Zend/tests/bug61165.phpt

Modified: php/php-src/trunk/Zend/tests/bug61011.phpt
===
--- php/php-src/trunk/Zend/tests/bug61011.phpt  2012-02-25 03:14:16 UTC (rev 
323486)
+++ php/php-src/trunk/Zend/tests/bug61011.phpt  2012-02-25 03:16:28 UTC (rev 
323487)
@@ -1,6 +1,6 @@
 --TEST--
 Bug #61011 (Crash when an exception is thrown by __autoload accessing a static 
property)
---XFAILD--
+--XFAIL--
 #61011 have not been fixed yet
 --FILE--
 ?php

Modified: php/php-src/trunk/Zend/tests/bug61165.phpt
===
--- php/php-src/trunk/Zend/tests/bug61165.phpt  2012-02-25 03:14:16 UTC (rev 
323486)
+++ php/php-src/trunk/Zend/tests/bug61165.phpt  2012-02-25 03:16:28 UTC (rev 
323487)
@@ -1,6 +1,6 @@
 --TEST--
 Bug #61165 (Segfault - strip_tags())
---XFAILD--
+--XFAIL--
 #61165 doesn't fix yet
 --FILE--
 ?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/Zend/tests/ bug61165.phpt

2012-02-24 Thread Xinchen Hui
laruence Sat, 25 Feb 2012 03:19:27 +

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

Log:
Fix test

Changed paths:
U   php/php-src/trunk/Zend/tests/bug61165.phpt

Modified: php/php-src/trunk/Zend/tests/bug61165.phpt
===
--- php/php-src/trunk/Zend/tests/bug61165.phpt  2012-02-25 03:16:28 UTC (rev 
323487)
+++ php/php-src/trunk/Zend/tests/bug61165.phpt  2012-02-25 03:19:27 UTC (rev 
323488)
@@ -21,8 +21,8 @@
 for ($i = 0; $i  3; $i++) {
 strip_tags($t);
strip_tags(new T);
-echo $i\n;
 }
+var_dump($handler);
 --EXPECTF--
 object(T)#%d (1) {
   [_this]=

-- 
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/main/streams/ php_stream_context.h streams.c

2012-02-22 Thread Pierre Joye
hi,

On Tue, Feb 21, 2012 at 11:09 PM, Gustavo Lopes glo...@nebm.ist.utl.pt wrote:

 Perhaps someone's private code used it?


 Sure, it's possible. In that case, they'll have a long time to complain
 since this is only for trunk and PHP 5.5 is years away.

No, php-next begins next year, one year after we began 5.4.

However, where is the discussion about dropping this?

I'm not saying we should keep it but a discussion is a must in this
case, on internals, at least to give a chance to possible users or
other devs to raise their points.

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/ UPGRADING UPGRADING.INTERNALS

2012-02-22 Thread Gustavo André dos Santos Lopes
cataphract   Wed, 22 Feb 2012 10:08:37 +

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

Log:
- Cleanup UPGRADING and UPGRADING.INTERNALS from 5.4 changes.
- Added information about removal of streams pooling API.

Changed paths:
U   php/php-src/trunk/UPGRADING
U   php/php-src/trunk/UPGRADING.INTERNALS

Modified: php/php-src/trunk/UPGRADING
===
--- php/php-src/trunk/UPGRADING	2012-02-22 09:33:01 UTC (rev 323422)
+++ php/php-src/trunk/UPGRADING	2012-02-22 10:08:37 UTC (rev 323423)
@@ -36,57 +36,8 @@
 1. Changes made to default configuration
 

-- The default_charset setting now defaults to UTF-8.
-  It was ISO-88590-1 before, so if you were relying
-  on the default, you will need to add:
+-

-default_charset = iso-8859-1
-
-  to your php.ini to preserve pre-PHPX.Y behavior.
-
-- We now check at compile time if /dev/urandom or /dev/arandom
-  are present to provide non-blocking entropy to session id
-  generation.  If either is present, session.entropy_file
-  now defaults to that file and session.entropy_length defaults
-  to 32.  If you do not want extra entropy for your session ids
-  for some reason, add:
-
-session.entropy_file=
-session.entropy_length=0
-
-  to your php.ini to preserve pre-PHPX.Y behavior.
-
-- Deprecated ini directives will now throw an E_CORE_WARNING's
-  instead of the previous E_WARNING's.
-
-  The following directives are marked as deprecated:
-  - magic_quotes_gpc
-  - magic_quotes_runtime
-  - magic_quotes_sybase
-
-- The following directives, which indicates a removed feature
-  in PHP will now throw an E_CORE_ERROR upon startup like the
-  deprecation warnings.
-
-  The following directives are no longer available:
-  - allow_call_time_pass_reference
-  - define_syslog_variables
-  - highlight.bg
-  - register_globals
-  - register_long_arrays
-  - safe_mode
-  - safe_mode_gid
-  - safe_mode_include_dir
-  - safe_mode_exec_dir
-  - safe_mode_allowed_env_vars
-  - safe_mode_protected_env_vars
-  - zend.ze1_compatibility_mode
-
-- the following new directives were added
-
-  - max_input_vars - specifies how many GET/POST/COOKIE input variables may be
-accepted. default value 1000.
-
 =
 2. Reserved words and classes
 =
@@ -97,96 +48,13 @@
 3. Changes made to engine behaviour
 =

-- Turning null, false or empty string into an object by adding a property
-  will now emit a warning instead of an E_STRICT error.
-
-  $test = null;
-  $test-baz = 1;
-
-  To create a generic object you can use StdClass:
-  $test = new StdClass;
-  $test-baz = 1;
+-

-- In previous versions, names of superglobals could be used for parameter
-  names, thereby shadowing the corresponding superglobal. This now causes a
-  fatal error such as Cannot re-assign auto-global variable GLOBALS.
-
 =
 4. Changes made to existing functions
 =

-- array_combine now returns array() instead of FALSE when two empty arrays are
-  provided as parameters.
-- Added an extra parameter to dns_get_record(), which allows requesting DNS
-  records by numeric type and makes the result include only the raw data of
-  the response.
-- call_user_func_array no longer allows call-time pass by reference.
-- htmlentities/htmlspecialchars are stricter in the code units they accept for
-  the asian encodings. For Big5-HKSCS, the octets 0x80 and 0xFF are rejected.
-  For GB2312/EUC-CN, the octets 0x8E, 0x8F, 0xA0 and 0xFF are rejected. For
-  SJIS, the octets 0x80, 0xA0, 0xFD, 0xFE and 0xFF are rejected, except maybe
-  after a valid starting byte. For EUC-JP, the octets 0xA0 and 0xFF are
-  rejected.
-- htmlentities now emits an E_STRICT warning when used with asian characters,
-  as in that case htmlentities has (and already had before this version) the
-  same functionality as htmlspecialchars.
-- htmlentities no longer numerically encodes high characters for single-byte
-  encodings (except when there's actually a corresponding named entity). This
-  behavior was not documented and was inconsistent with that for UTF-8.
-- html_entity_decode/htmlspecialchars_decode behave more consistently, now
-  decoding entities in malformed strings such as amp; or #amp;.
-- htmlentities/htmlspecialchars/html_entity_decode/htmlspecialchars_decode:
-  Added the flags ENT_HTML401, ENT_XML1, ENT_XHTML, and ENT_HTML5. The
-  behavior of these functions including, but not limited to, the characters
-  that are encoded and the entities that are decoded depend on the document
-  type that is specified by those flags.
-- htmlentities/htmlspecialchars with !$double_encode do more strict checks on
-  the validity of the entities. Numerical entities are checked for a valid
-  range (0 to 0x10); if the flag ENT_DISALLOWED is 

[PHP-CVS] svn: /php/php-src/trunk/ UPGRADING ext/spl/spl_fixedarray.c ext/spl/tests/SplFixedArray_serialize.phpt

2012-02-21 Thread Adam Harvey
aharvey  Tue, 21 Feb 2012 10:34:42 +

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

Log:
Add a __wakeup() method to SplFixedArray, thereby fixing serialising an
SplFixedArray object and bug #60560 (SplFixedArray un-/serialize, getSize(),
count() return 0, keys are strings).

Bug: https://bugs.php.net/60560 (Open) SplFixedArray un-/serialize, getSize(), 
count() return 0, keys are strings
  
Changed paths:
U   php/php-src/trunk/UPGRADING
U   php/php-src/trunk/ext/spl/spl_fixedarray.c
A   php/php-src/trunk/ext/spl/tests/SplFixedArray_serialize.phpt

Modified: php/php-src/trunk/UPGRADING
===
--- php/php-src/trunk/UPGRADING 2012-02-21 10:07:05 UTC (rev 323407)
+++ php/php-src/trunk/UPGRADING 2012-02-21 10:34:42 UTC (rev 323408)
@@ -450,6 +450,9 @@
- SplFileObject
  - SplFileObject::fputcsv()

+   - SplFixedArray
+ - SplFixedArray::__wakeup()
+
  i. New class constants

-

Modified: php/php-src/trunk/ext/spl/spl_fixedarray.c
===
--- php/php-src/trunk/ext/spl/spl_fixedarray.c  2012-02-21 10:07:05 UTC (rev 
323407)
+++ php/php-src/trunk/ext/spl/spl_fixedarray.c  2012-02-21 10:34:42 UTC (rev 
323408)
@@ -579,6 +579,38 @@
 }
 /* }}} */

+/* {{{ proto void SplFixedArray::__wakeup()
+*/
+SPL_METHOD(SplFixedArray, __wakeup)
+{
+   spl_fixedarray_object *intern = (spl_fixedarray_object *) 
zend_object_store_get_object(getThis() TSRMLS_CC);
+   HashPosition ptr;
+   HashTable *intern_ht = zend_std_get_properties(getThis() TSRMLS_CC);
+   zval **data;
+
+   if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, )) {
+   return;
+   }
+
+   if (!intern-array) {
+   int index = 0;
+   int size = zend_hash_num_elements(intern_ht);
+
+   intern-array = emalloc(sizeof(spl_fixedarray));
+   spl_fixedarray_init(intern-array, size TSRMLS_CC);
+
+   for (zend_hash_internal_pointer_reset_ex(intern_ht, ptr); 
zend_hash_get_current_data_ex(intern_ht, (void **) data, ptr) == SUCCESS; 
zend_hash_move_forward_ex(intern_ht, ptr)) {
+   Z_ADDREF_PP(data);
+   intern-array-elements[index++] = *data;
+   }
+
+   /* Remove the unserialised properties, since we now have the 
elements
+* within the spl_fixedarray_object structure. */
+   zend_hash_clean(intern_ht);
+   }
+}
+/* }}} */
+
 /* {{{ proto int SplFixedArray::count(void)
 */
 SPL_METHOD(SplFixedArray, count)
@@ -1056,6 +1088,7 @@

 static zend_function_entry spl_funcs_SplFixedArray[] = { /* {{{ */
SPL_ME(SplFixedArray, __construct, 
arginfo_splfixedarray_construct,ZEND_ACC_PUBLIC)
+   SPL_ME(SplFixedArray, __wakeup,arginfo_splfixedarray_void, 
ZEND_ACC_PUBLIC)
SPL_ME(SplFixedArray, count,   arginfo_splfixedarray_void, 
ZEND_ACC_PUBLIC)
SPL_ME(SplFixedArray, toArray, arginfo_splfixedarray_void, 
ZEND_ACC_PUBLIC)
SPL_ME(SplFixedArray, fromArray,   arginfo_fixedarray_fromArray,   
ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)

Added: php/php-src/trunk/ext/spl/tests/SplFixedArray_serialize.phpt
===
--- php/php-src/trunk/ext/spl/tests/SplFixedArray_serialize.phpt
(rev 0)
+++ php/php-src/trunk/ext/spl/tests/SplFixedArray_serialize.phpt
2012-02-21 10:34:42 UTC (rev 323408)
@@ -0,0 +1,52 @@
+--TEST--
+SplFixedArray serialisation
+--FILE--
+?php
+
+$array = new SplFixedArray(5);
+
+$obj = new stdClass;
+$obj-prop = 'value';
+
+$array[0] = 'foo';
+$array[2] = 42;
+$array[3] = $obj;
+$array[4] = range(1, 5);
+
+$ser = serialize($array);
+echo $ser\n;
+$unser = unserialize($ser);
+
+printf(count: %d\n, count($unser));
+printf(getSize(): %d\n, $unser-getSize());
+
+var_dump($unser[0], $unser[1], $unser[2], $unser[3], $unser[4]);
+
+$unser[4] = 'quux';
+var_dump($unser[4]);
+
+?
+--EXPECT--
+O:13:SplFixedArray:5:{i:0;s:3:foo;i:1;N;i:2;i:42;i:3;O:8:stdClass:1:{s:4:prop;s:5:value;}i:4;a:5:{i:0;i:1;i:1;i:2;i:2;i:3;i:3;i:4;i:4;i:5;}}
+count: 5
+getSize(): 5
+string(3) foo
+NULL
+int(42)
+object(stdClass)#4 (1) {
+  [prop]=
+  string(5) value
+}
+array(5) {
+  [0]=
+  int(1)
+  [1]=
+  int(2)
+  [2]=
+  int(3)
+  [3]=
+  int(4)
+  [4]=
+  int(5)
+}
+string(4) quux

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

[PHP-CVS] svn: /php/php-src/trunk/main/streams/ php_stream_context.h streams.c

2012-02-21 Thread Gustavo André dos Santos Lopes
cataphract   Tue, 21 Feb 2012 21:55:00 +

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

Log:
- Revert r134029. The streams pooling API was never used in more
  than 8 years and therefore unnecessarily adds complexity.

Changed paths:
U   php/php-src/trunk/main/streams/php_stream_context.h
U   php/php-src/trunk/main/streams/streams.c

Modified: php/php-src/trunk/main/streams/php_stream_context.h
===
--- php/php-src/trunk/main/streams/php_stream_context.h 2012-02-21 20:57:57 UTC 
(rev 323415)
+++ php/php-src/trunk/main/streams/php_stream_context.h 2012-02-21 21:55:00 UTC 
(rev 323416)
@@ -53,7 +53,6 @@
 struct _php_stream_context {
php_stream_notifier *notifier;
zval *options;  /* hash keyed by wrapper family or specific wrapper */
-   zval *links;/* hash keyed by hostent for connection pooling */
int rsrc_id;/* used for auto-cleanup */
 };

@@ -65,13 +64,6 @@
 PHPAPI int php_stream_context_set_option(php_stream_context *context,
const char *wrappername, const char *optionname, zval 
*optionvalue);

-PHPAPI int php_stream_context_get_link(php_stream_context *context,
-   const char *hostent, php_stream **stream);
-PHPAPI int php_stream_context_set_link(php_stream_context *context,
-   const char *hostent, php_stream *stream);
-PHPAPI int php_stream_context_del_link(php_stream_context *context,
-   php_stream *stream);
-
 PHPAPI php_stream_notifier *php_stream_notification_alloc(void);
 PHPAPI void php_stream_notification_free(php_stream_notifier *notifier);
 END_EXTERN_C()

Modified: php/php-src/trunk/main/streams/streams.c
===
--- php/php-src/trunk/main/streams/streams.c2012-02-21 20:57:57 UTC (rev 
323415)
+++ php/php-src/trunk/main/streams/streams.c2012-02-21 21:55:00 UTC (rev 
323416)
@@ -444,11 +444,6 @@
while (zend_list_delete(stream-rsrc_id) == SUCCESS) {}
}

-   /* Remove stream from any context link list */
-   if (stream-context  stream-context-links) {
-   php_stream_context_del_link(stream-context, stream);
-   }
-
if (close_options  PHP_STREAM_FREE_CALL_DTOR) {
if (release_cast  stream-fclose_stdiocast == 
PHP_STREAM_FCLOSE_FOPENCOOKIE) {
/* calling fclose on an fopencookied stream will 
ultimately
@@ -2143,10 +2138,6 @@
php_stream_notification_free(context-notifier);
context-notifier = NULL;
}
-   if (context-links) {
-   zval_ptr_dtor(context-links);
-   context-links = NULL;
-   }
efree(context);
 }

@@ -2209,66 +2200,6 @@
}
return zend_hash_update(Z_ARRVAL_PP(wrapperhash), (char*)optionname, 
strlen(optionname)+1, (void**)copied_val, sizeof(zval *), NULL);
 }
-
-PHPAPI int php_stream_context_get_link(php_stream_context *context,
-const char *hostent, php_stream **stream)
-{
-   php_stream **pstream;
-
-   if (!stream || !hostent || !context || !(context-links)) {
-   return FAILURE;
-   }
-   if (SUCCESS == zend_hash_find(Z_ARRVAL_P(context-links), 
(char*)hostent, strlen(hostent)+1, (void**)pstream)) {
-   *stream = *pstream;
-   return SUCCESS;
-   }
-   return FAILURE;
-}
-
-PHPAPI int php_stream_context_set_link(php_stream_context *context,
-const char *hostent, php_stream *stream)
-{
-   if (!context) {
-   return FAILURE;
-   }
-   if (!context-links) {
-   ALLOC_INIT_ZVAL(context-links);
-   array_init(context-links);
-   }
-   if (!stream) {
-   /* Delete any entry for hostent */
-   return zend_hash_del(Z_ARRVAL_P(context-links), 
(char*)hostent, strlen(hostent)+1);
-   }
-   return zend_hash_update(Z_ARRVAL_P(context-links), (char*)hostent, 
strlen(hostent)+1, (void**)stream, sizeof(php_stream *), NULL);
-}
-
-PHPAPI int php_stream_context_del_link(php_stream_context *context,
-php_stream *stream)
-{
-   php_stream **pstream;
-   char *hostent;
-   int ret = SUCCESS;
-
-   if (!context || !context-links || !stream) {
-   return FAILURE;
-   }
-
-   for(zend_hash_internal_pointer_reset(Z_ARRVAL_P(context-links));
-   SUCCESS == 
zend_hash_get_current_data(Z_ARRVAL_P(context-links), (void**)pstream);
-   zend_hash_move_forward(Z_ARRVAL_P(context-links))) {
-   if (*pstream == stream) {
-   if (SUCCESS == 
zend_hash_get_current_key(Z_ARRVAL_P(context-links), hostent, NULL, 0)) {
-   if (FAILURE == 
zend_hash_del(Z_ARRVAL_P(context-links), (char*)hostent, strlen(hostent)+1)) {
-   ret = FAILURE;

Re: [PHP-CVS] svn: /php/php-src/trunk/main/streams/ php_stream_context.h streams.c

2012-02-21 Thread Christopher Jones



On 02/21/2012 01:55 PM, Gustavo André dos Santos Lopes wrote:

cataphract   Tue, 21 Feb 2012 21:55:00 +

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

Log:
- Revert r134029. The streams pooling API was never used in more
   than 8 years and therefore unnecessarily adds complexity.


Perhaps someone's private code used it?

In any case, since this is a breakage, it should be in UPGRADING and NEWS.

Chris

--
Email: christopher.jo...@oracle.com
Tel:  +1 650 506 8630
Blog:  http://blogs.oracle.com/opal/

--
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/main/streams/ php_stream_context.h streams.c

2012-02-21 Thread Gustavo Lopes
On Tue, 21 Feb 2012 23:00:21 +0100, Christopher Jones  
christopher.jo...@oracle.com wrote:





On 02/21/2012 01:55 PM, Gustavo André dos Santos Lopes wrote:

cataphract   Tue, 21 Feb 2012 21:55:00 +

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

Log:
- Revert r134029. The streams pooling API was never used in more
   than 8 years and therefore unnecessarily adds complexity.


Perhaps someone's private code used it?



Sure, it's possible. In that case, they'll have a long time to complain  
since this is only for trunk and PHP 5.5 is years away.


In any case, since this is a breakage, it should be in UPGRADING and  
NEWS.




Thank you for the reminder; I will add it.

--
Gustavo Lopes

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



[PHP-CVS] svn: /php/php-src/trunk/sapi/cli/tests/ php_cli_server_004.phpt php_cli_server_005.phpt php_cli_server_006.phpt php_cli_server_007.phpt php_cli_server_008.phpt php_cli_server_009.phpt php_cl

2012-02-18 Thread Nikita Popov
nikicSat, 18 Feb 2012 11:59:13 +

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

Log:
Fix cli server tests broken by r323078

Needs to be merged to 5.4 after r323078 is merged.

Changed paths:
U   php/php-src/trunk/sapi/cli/tests/php_cli_server_004.phpt
U   php/php-src/trunk/sapi/cli/tests/php_cli_server_005.phpt
U   php/php-src/trunk/sapi/cli/tests/php_cli_server_006.phpt
U   php/php-src/trunk/sapi/cli/tests/php_cli_server_007.phpt
U   php/php-src/trunk/sapi/cli/tests/php_cli_server_008.phpt
U   php/php-src/trunk/sapi/cli/tests/php_cli_server_009.phpt
U   php/php-src/trunk/sapi/cli/tests/php_cli_server_010.phpt
U   php/php-src/trunk/sapi/cli/tests/php_cli_server_012.phpt
U   php/php-src/trunk/sapi/cli/tests/php_cli_server_013.phpt
U   php/php-src/trunk/sapi/cli/tests/php_cli_server_014.phpt
U   php/php-src/trunk/sapi/cli/tests/php_cli_server_015.phpt

Modified: php/php-src/trunk/sapi/cli/tests/php_cli_server_004.phpt
===
--- php/php-src/trunk/sapi/cli/tests/php_cli_server_004.phpt2012-02-18 
11:27:34 UTC (rev 323323)
+++ php/php-src/trunk/sapi/cli/tests/php_cli_server_004.phpt2012-02-18 
11:59:13 UTC (rev 323324)
@@ -38,7 +38,7 @@
 --EXPECTF--
 HTTP/1.1 200 OK
 Host: %s
-Connection: closed
+Connection: close
 X-Powered-By: PHP/%s
 Content-type: text/html


Modified: php/php-src/trunk/sapi/cli/tests/php_cli_server_005.phpt
===
--- php/php-src/trunk/sapi/cli/tests/php_cli_server_005.phpt2012-02-18 
11:27:34 UTC (rev 323323)
+++ php/php-src/trunk/sapi/cli/tests/php_cli_server_005.phpt2012-02-18 
11:59:13 UTC (rev 323324)
@@ -50,7 +50,7 @@
 --EXPECTF--
 HTTP/1.1 200 OK
 Host: %s
-Connection: closed
+Connection: close
 X-Powered-By: PHP/%s
 Content-type: text/html


Modified: php/php-src/trunk/sapi/cli/tests/php_cli_server_006.phpt
===
--- php/php-src/trunk/sapi/cli/tests/php_cli_server_006.phpt2012-02-18 
11:27:34 UTC (rev 323323)
+++ php/php-src/trunk/sapi/cli/tests/php_cli_server_006.phpt2012-02-18 
11:59:13 UTC (rev 323324)
@@ -34,7 +34,7 @@
 --EXPECTF--
 HTTP/1.1 200 OK
 Host: %s
-Connection: closed
+Connection: close
 X-Powered-By: PHP/%s
 Content-type: text/html


Modified: php/php-src/trunk/sapi/cli/tests/php_cli_server_007.phpt
===
--- php/php-src/trunk/sapi/cli/tests/php_cli_server_007.phpt2012-02-18 
11:27:34 UTC (rev 323323)
+++ php/php-src/trunk/sapi/cli/tests/php_cli_server_007.phpt2012-02-18 
11:59:13 UTC (rev 323324)
@@ -34,7 +34,7 @@
 --EXPECTF--
 HTTP/1.1 401 Unauthorized
 Host: %s
-Connection: closed
+Connection: close
 X-Powered-By: PHP/%s
 WWW-Authenticate: Digest 
realm=foo,qop=auth,nonce=X,opaque=acbd18db4cc2f85cedef654fccc4a4d8
 Content-type: text/html

Modified: php/php-src/trunk/sapi/cli/tests/php_cli_server_008.phpt
===
--- php/php-src/trunk/sapi/cli/tests/php_cli_server_008.phpt2012-02-18 
11:27:34 UTC (rev 323323)
+++ php/php-src/trunk/sapi/cli/tests/php_cli_server_008.phpt2012-02-18 
11:59:13 UTC (rev 323324)
@@ -54,14 +54,14 @@
 --EXPECTF--
 HTTP/1.1 200 OK
 Host: %s
-Connection: closed
+Connection: close
 X-Powered-By: PHP/%s
 Content-type: text/html

 string(8) HTTP/1.1
 HTTP/1.0 200 OK
 Host: %s
-Connection: closed
+Connection: close
 X-Powered-By: PHP/%s
 Content-type: text/html


Modified: php/php-src/trunk/sapi/cli/tests/php_cli_server_009.phpt
===
--- php/php-src/trunk/sapi/cli/tests/php_cli_server_009.phpt2012-02-18 
11:27:34 UTC (rev 323323)
+++ php/php-src/trunk/sapi/cli/tests/php_cli_server_009.phpt2012-02-18 
11:59:13 UTC (rev 323324)
@@ -78,14 +78,14 @@
 --EXPECTF--
 HTTP/1.1 200 OK
 Host: %s
-Connection: closed
+Connection: close
 X-Powered-By: PHP/%s
 Content-type: text/html

 string(8) /foo/bar
 HTTP/1.0 200 OK
 Host: %s
-Connection: closed
+Connection: close
 X-Powered-By: PHP/%s
 Content-type: text/html


Modified: php/php-src/trunk/sapi/cli/tests/php_cli_server_010.phpt
===
--- php/php-src/trunk/sapi/cli/tests/php_cli_server_010.phpt2012-02-18 
11:27:34 UTC (rev 323323)
+++ php/php-src/trunk/sapi/cli/tests/php_cli_server_010.phpt2012-02-18 
11:59:13 UTC (rev 323324)
@@ -55,7 +55,7 @@
 --EXPECTF--
 HTTP/1.1 200 OK
 Host: %s
-Connection: closed
+Connection: close
 X-Powered-By: PHP/%s
 Content-type: text/html

@@ -65,7 +65,7 @@
 string(7) foo=bar
 HTTP/1.0 200 OK
 Host: %s
-Connection: closed
+Connection: close
 X-Powered-By: PHP/%s
 Content-type: text/html


Modified: php/php-src/trunk/sapi/cli/tests/php_cli_server_012.phpt

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

2012-02-17 Thread Rasmus Lerdorf
rasmus   Fri, 17 Feb 2012 17:54:11 +

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

Log:
I think we should let this be settable from .htaccess to match the other 
post/upload
related limits like upload_max_filesize, post_max_size, and max_input_vars.

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

Modified: php/php-src/trunk/main/main.c
===
--- php/php-src/trunk/main/main.c   2012-02-17 17:45:36 UTC (rev 323295)
+++ php/php-src/trunk/main/main.c   2012-02-17 17:54:11 UTC (rev 323296)
@@ -552,7 +552,7 @@
PHP_INI_ENTRY(mail.force_extra_parameters,NULL,   
PHP_INI_SYSTEM|PHP_INI_PERDIR,  OnChangeMailForceExtra)
PHP_INI_ENTRY(disable_functions,  , 
PHP_INI_SYSTEM, NULL)
PHP_INI_ENTRY(disable_classes,, 
PHP_INI_SYSTEM, NULL)
-   PHP_INI_ENTRY(max_file_uploads,   20,   
PHP_INI_SYSTEM, NULL)
+   PHP_INI_ENTRY(max_file_uploads,   20,   
PHP_INI_SYSTEM|PHP_INI_PERDIR,  NULL)

STD_PHP_INI_BOOLEAN(allow_url_fopen,  1,
PHP_INI_SYSTEM, OnUpdateBool,   allow_url_fopen,
php_core_globals,   core_globals)
STD_PHP_INI_BOOLEAN(allow_url_include,0,
PHP_INI_SYSTEM, OnUpdateBool,   allow_url_include,  
php_core_globals,   core_globals)

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

2012-02-09 Thread Christopher Jones
sixd Thu, 09 Feb 2012 23:53:07 +

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

Log:
Merge Stas's 5.4 r323128 to trunk

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   2012-02-09 22:18:50 UTC (rev 
323145)
+++ php/php-src/trunk/php.ini-development   2012-02-09 23:53:07 UTC (rev 
323146)
@@ -424,7 +424,7 @@
 ; development and early testing.
 ;
 ; Error Level Constants:
-; E_ALL - All errors and warnings (includes E_STRICT as of PHP 
6.0.0)
+; E_ALL - All errors and warnings (includes E_STRICT as of PHP 
5.4.0)
 ; E_ERROR   - fatal run-time errors
 ; E_RECOVERABLE_ERROR  - almost fatal run-time errors
 ; E_WARNING - run-time warnings (non-fatal errors)

Modified: php/php-src/trunk/php.ini-production
===
--- php/php-src/trunk/php.ini-production2012-02-09 22:18:50 UTC (rev 
323145)
+++ php/php-src/trunk/php.ini-production2012-02-09 23:53:07 UTC (rev 
323146)
@@ -424,7 +424,7 @@
 ; development and early testing.
 ;
 ; Error Level Constants:
-; E_ALL - All errors and warnings (includes E_STRICT as of PHP 
6.0.0)
+; E_ALL - All errors and warnings (includes E_STRICT as of PHP 
5.4.0)
 ; E_ERROR   - fatal run-time errors
 ; E_RECOVERABLE_ERROR  - almost fatal run-time errors
 ; E_WARNING - run-time warnings (non-fatal errors)

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

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

2012-02-05 Thread Gustavo André dos Santos Lopes
cataphract   Sun, 05 Feb 2012 11:45:01 +

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

Log:
- Connection: close, not closed.

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

Modified: php/php-src/trunk/sapi/cli/php_cli_server.c
===
--- php/php-src/trunk/sapi/cli/php_cli_server.c 2012-02-05 10:35:56 UTC (rev 
323077)
+++ php/php-src/trunk/sapi/cli/php_cli_server.c 2012-02-05 11:45:01 UTC (rev 
323078)
@@ -351,7 +351,7 @@
smart_str_appendl_ex(buffer, \r\n, 2, persistent);
}
}
-   smart_str_appendl_ex(buffer, Connection: closed\r\n, 
sizeof(Connection: closed\r\n) - 1, persistent);
+   smart_str_appendl_ex(buffer, Connection: close\r\n, 
sizeof(Connection: close\r\n) - 1, persistent);
 } /* }}} */

 static const char *get_mime_type(const char *ext, size_t ext_len) /* {{{ */

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

2012-02-05 Thread Gustavo André dos Santos Lopes
cataphract   Sun, 05 Feb 2012 14:57:57 +

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

Log:
- Fixed possible unsigned int wrap around in html.c. Note that 5.3 has the same
  (potential) problem; even though the code is substantially different, the
  variable name and the fashion it was incremented was kept.

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   2012-02-05 11:45:01 UTC (rev 
323078)
+++ php/php-src/trunk/ext/standard/html.c   2012-02-05 14:57:57 UTC (rev 
323079)
@@ -1257,9 +1257,13 @@
maxlen = 128;
} else {
maxlen = 2 * oldlen;
+   if (maxlen  oldlen) {
+   zend_error_noreturn(E_ERROR, Input string is too 
long);
+   return NULL;
+   }
}

-   replaced = emalloc(maxlen + 1);
+   replaced = emalloc(maxlen + 1); /* adding 1 is safe: maxlen is even */
len = 0;
cursor = 0;
while (cursor  oldlen) {
@@ -1271,8 +1275,9 @@

/* guarantee we have at least 40 bytes to write.
 * In HTML5, entities may take up to 33 bytes */
-   if (len + 40  maxlen) {
-   replaced = erealloc(replaced, (maxlen += 128) + 1);
+   if (len  maxlen - 40) { /* maxlen can never be smaller than 
128 */
+   replaced = safe_erealloc(replaced, maxlen , 1, 128 + 1);
+   maxlen += 128;
}

if (status == FAILURE) {
@@ -1401,8 +1406,11 @@
}
/* checks passed; copy entity to result */
/* entity size is unbounded, we may need more 
memory */
-   if (maxlen  len + ent_len + 2 /*  and ; */) {
-   replaced = erealloc(replaced, (maxlen 
+= ent_len + 128) + 1);
+   /* at this point maxlen - len = 40 */
+   if (maxlen - len  ent_len + 2 /*  and ; */) {
+   /* ent_len  oldlen, which is certainly 
= SIZE_MAX/2 */
+   replaced = safe_erealloc(replaced, 
maxlen, 1, ent_len + 128 + 1);
+   maxlen += ent_len + 128;
}
replaced[len++] = '';
memcpy(replaced[len], old[cursor], ent_len);

-- 
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/bug60965.phpt

2012-02-04 Thread Gustavo André dos Santos Lopes
cataphract   Sat, 04 Feb 2012 18:12:18 +

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

Log:
- Fixed bug #60965 (Buffer overflow on htmlspecialchars/entities with
  $double=false).
- Removed unused variable.
- Given maxlen the usual meaning of *len variables (terminator not included).
- Changed some comments.

Bug: https://bugs.php.net/60965 (Critical) Buffer overflow on 
htmlspecialchars/entities with $double=false
  
Changed paths:
U   php/php-src/trunk/ext/standard/html.c
A   php/php-src/trunk/ext/standard/tests/strings/bug60965.phpt

Modified: php/php-src/trunk/ext/standard/html.c
===
--- php/php-src/trunk/ext/standard/html.c   2012-02-04 12:58:07 UTC (rev 
323055)
+++ php/php-src/trunk/ext/standard/html.c   2012-02-04 18:12:18 UTC (rev 
323056)
@@ -1215,7 +1215,6 @@
size_t cursor, maxlen, len;
char *replaced;
enum entity_charset charset = determine_charset(hint_charset TSRMLS_CC);
-   int matches_map;
int doctype = flags  ENT_HTML_DOC_TYPE_MASK;
entity_table_opt entity_table;
const enc_to_uni *to_uni_table = NULL;
@@ -1253,12 +1252,14 @@
}
}

+   /* initial estimate */
if (oldlen  64) {
maxlen = 128;
} else {
maxlen = 2 * oldlen;
}
-   replaced = emalloc(maxlen);
+
+   replaced = emalloc(maxlen + 1);
len = 0;
cursor = 0;
while (cursor  oldlen) {
@@ -1271,7 +1272,7 @@
/* guarantee we have at least 40 bytes to write.
 * In HTML5, entities may take up to 33 bytes */
if (len + 40  maxlen) {
-   replaced = erealloc(replaced, maxlen += 128);
+   replaced = erealloc(replaced, (maxlen += 128) + 1);
}

if (status == FAILURE) {
@@ -1291,7 +1292,6 @@
mbsequence = old[cursor_before];
mbseqlen = cursor - cursor_before;
}
-   matches_map = 0;

if (this_char != '') { /* no entity on this position */
const unsigned char *rep= NULL;
@@ -1302,12 +1302,15 @@
goto pass_char_through;

if (all) { /* false that 
CHARSET_PARTIAL_SUPPORT(charset) */
-   /* look for entity for this char */
if (to_uni_table != NULL) {
+   /* !CHARSET_UNICODE_COMPAT therefore 
not UTF-8; since UTF-8
+* is the only multibyte encoding with 
!CHARSET_PARTIAL_SUPPORT,
+* we're using a single byte encoding */
map_to_unicode(this_char, to_uni_table, 
this_char);
if (this_char == 0x) /* no mapping; 
pass through */
goto pass_char_through;
}
+   /* the cursor may advance */
find_entity_for_char(this_char, charset, 
entity_table.ms_table, rep,
rep_len, old, oldlen, cursor);
} else {
@@ -1397,6 +1400,10 @@
}
}
/* checks passed; copy entity to result */
+   /* entity size is unbounded, we may need more 
memory */
+   if (maxlen  len + ent_len + 2 /*  and ; */) {
+   replaced = erealloc(replaced, (maxlen 
+= ent_len + 128) + 1);
+   }
replaced[len++] = '';
memcpy(replaced[len], old[cursor], ent_len);
len += ent_len;

Added: php/php-src/trunk/ext/standard/tests/strings/bug60965.phpt
===
--- php/php-src/trunk/ext/standard/tests/strings/bug60965.phpt  
(rev 0)
+++ php/php-src/trunk/ext/standard/tests/strings/bug60965.phpt  2012-02-04 
18:12:18 UTC (rev 323056)
@@ -0,0 +1,10 @@
+--TEST--
+Bug #60965: Buffer overflow on htmlspecialchars/entities with $double=false
+--FILE--
+?php
+echo 
htmlspecialchars('#x05;',
+ENT_QUOTES, 'UTF-8', false), \n;
+echo Done.\n;
+--EXPECT--

[PHP-CVS] svn: /php/php-src/trunk/ ext/standard/tests/general_functions/bug60227_1.phpt ext/standard/tests/general_functions/bug60227_2.phpt ext/standard/tests/general_functions/bug60227_3.phpt ext/st

2012-02-03 Thread Gustavo André dos Santos Lopes
cataphract   Fri, 03 Feb 2012 13:56:37 +

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

Log:
- Headers: forbid \r and \n also after \0, allow CRLF followed by HT or SP and
  forbid \0. See bug #60227.

Bug: https://bugs.php.net/60227 (Closed) header() cannot detect the multi-line 
header with CR(0x0D).
  
Changed paths:
U   php/php-src/trunk/ext/standard/tests/general_functions/bug60227_1.phpt
U   php/php-src/trunk/ext/standard/tests/general_functions/bug60227_2.phpt
A + php/php-src/trunk/ext/standard/tests/general_functions/bug60227_3.phpt
(from 
php/php-src/trunk/ext/standard/tests/general_functions/bug60227_2.phpt:r323040)
A + php/php-src/trunk/ext/standard/tests/general_functions/bug60227_4.phpt
(from 
php/php-src/trunk/ext/standard/tests/general_functions/bug60227_2.phpt:r323040)
U   php/php-src/trunk/main/SAPI.c

Modified: php/php-src/trunk/ext/standard/tests/general_functions/bug60227_1.phpt
===
--- php/php-src/trunk/ext/standard/tests/general_functions/bug60227_1.phpt  
2012-02-03 11:35:15 UTC (rev 323042)
+++ php/php-src/trunk/ext/standard/tests/general_functions/bug60227_1.phpt  
2012-02-03 13:56:37 UTC (rev 323043)
@@ -10,7 +10,7 @@
 echo 'foo';
 ?
 --EXPECTF--
-Warning: Header may not contain more than a single header, new line detected. 
in %s on line %d
+Warning: Header may not contain more than a single header, new line detected 
in %s on line %d
 foo
 --EXPECTHEADERS--
 X-Foo1: a

Modified: php/php-src/trunk/ext/standard/tests/general_functions/bug60227_2.phpt
===
--- php/php-src/trunk/ext/standard/tests/general_functions/bug60227_2.phpt  
2012-02-03 11:35:15 UTC (rev 323042)
+++ php/php-src/trunk/ext/standard/tests/general_functions/bug60227_2.phpt  
2012-02-03 13:56:37 UTC (rev 323043)
@@ -7,7 +7,7 @@
 echo 'foo';
 ?
 --EXPECTF--
-Warning: Header may not contain more than a single header, new line detected. 
in %s on line %d
+Warning: Header may not contain more than a single header, new line detected 
in %s on line %d
 foo
 --EXPECTHEADERS--
 X-foo: e

Copied: php/php-src/trunk/ext/standard/tests/general_functions/bug60227_3.phpt 
(from rev 323040, 
php/php-src/trunk/ext/standard/tests/general_functions/bug60227_2.phpt)
===
--- php/php-src/trunk/ext/standard/tests/general_functions/bug60227_3.phpt  
(rev 0)
+++ php/php-src/trunk/ext/standard/tests/general_functions/bug60227_3.phpt  
2012-02-03 13:56:37 UTC (rev 323043)
@@ -0,0 +1,14 @@
+--TEST--
+Bug #60227 (header() cannot detect the multi-line header with CR), \0 before \n
+--FILE--
+?php
+header(X-foo: e\n foo);
+header(X-Foo6: e\0Set-Cookie: ID=\n123\n d);
+echo 'foo';
+?
+--EXPECTF--
+Warning: Header may not contain NUL bytes in %s on line %d
+foo
+--EXPECTHEADERS--
+X-foo: e
+foo

Copied: php/php-src/trunk/ext/standard/tests/general_functions/bug60227_4.phpt 
(from rev 323040, 
php/php-src/trunk/ext/standard/tests/general_functions/bug60227_2.phpt)
===
--- php/php-src/trunk/ext/standard/tests/general_functions/bug60227_4.phpt  
(rev 0)
+++ php/php-src/trunk/ext/standard/tests/general_functions/bug60227_4.phpt  
2012-02-03 13:56:37 UTC (rev 323043)
@@ -0,0 +1,14 @@
+--TEST--
+Bug #60227 (header() cannot detect the multi-line header with CR), CRLF
+--FILE--
+?php
+header(X-foo: e\r\n foo);
+header(X-foo: e\r\nfoo);
+echo 'foo';
+?
+--EXPECTF--
+Warning: Header may not contain more than a single header, new line detected 
in %s on line %d
+foo
+--EXPECTHEADERS--
+X-foo: e
+ foo

Modified: php/php-src/trunk/main/SAPI.c
===
--- php/php-src/trunk/main/SAPI.c   2012-02-03 11:35:15 UTC (rev 323042)
+++ php/php-src/trunk/main/SAPI.c   2012-02-03 13:56:37 UTC (rev 323043)
@@ -710,17 +710,26 @@
efree(header_line);
return SUCCESS;
} else {
-   /* new line safety check */
-   char *s = header_line;
-   while (s = strpbrk(s, \n\r)) {
-   if (s[1] == ' ' || s[1] == '\t') {
-   /* RFC 2616 allows new lines if followed by SP 
or HT */
-   s++;
-   continue;
+   /* new line/NUL character safety check */
+   int i;
+   for (i = 0; i  header_line_len; i++) {
+   /* RFC 2616 allows new lines if followed by SP or HT */
+   int illegal_break =
+   (header_line[i+1] != ' '  
header_line[i+1] != '\t')
+(
+   

[PHP-CVS] svn: /php/php-src/trunk/ ext/standard/tests/general_functions/bug60227.phpt ext/standard/tests/general_functions/bug60227_1.phpt ext/standard/tests/general_functions/bug60227_2.phpt main/SAP

2012-02-02 Thread Gustavo André dos Santos Lopes
cataphract   Thu, 02 Feb 2012 18:24:53 +

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

Log:
- Hopefully correct fix for bug #60227.
#No commit for 5.4 for now

Bug: https://bugs.php.net/60227 (Closed) header() cannot detect the multi-line 
header with CR(0x0D).
  
Changed paths:
D   php/php-src/trunk/ext/standard/tests/general_functions/bug60227.phpt
A + php/php-src/trunk/ext/standard/tests/general_functions/bug60227_1.phpt
(from 
php/php-src/trunk/ext/standard/tests/general_functions/bug60227.phpt:r323031)
A   php/php-src/trunk/ext/standard/tests/general_functions/bug60227_2.phpt
U   php/php-src/trunk/main/SAPI.c

Deleted: php/php-src/trunk/ext/standard/tests/general_functions/bug60227.phpt
===
--- php/php-src/trunk/ext/standard/tests/general_functions/bug60227.phpt
2012-02-02 18:22:46 UTC (rev 323032)
+++ php/php-src/trunk/ext/standard/tests/general_functions/bug60227.phpt
2012-02-02 18:24:53 UTC (rev 323033)
@@ -1,20 +0,0 @@
---TEST--
-Bug #60227 (header() cannot detect the multi-line header with CR)
---FILE--
-?php
-header(X-Foo1: a);
-header(X-Foo2: b\n );
-header(X-Foo3: c\r\n );
-header(X-Foo4: d\r );
-header(X-Foo5: e\rSet-Cookie: ID=123);
-echo 'foo';
-?
---EXPECTF--
-Warning: Header may not contain more than a single header, new line detected. 
in %s on line %d
-foo
---EXPECTHEADERS--
-X-Foo1: a
-X-Foo2: b
-X-Foo3: c
-X-Foo4: d
-

Copied: php/php-src/trunk/ext/standard/tests/general_functions/bug60227_1.phpt 
(from rev 323031, 
php/php-src/trunk/ext/standard/tests/general_functions/bug60227.phpt)
===
--- php/php-src/trunk/ext/standard/tests/general_functions/bug60227_1.phpt  
(rev 0)
+++ php/php-src/trunk/ext/standard/tests/general_functions/bug60227_1.phpt  
2012-02-02 18:24:53 UTC (rev 323033)
@@ -0,0 +1,20 @@
+--TEST--
+Bug #60227 (header() cannot detect the multi-line header with CR)
+--FILE--
+?php
+header(X-Foo1: a);
+header(X-Foo2: b\n );
+header(X-Foo3: c\r\n );
+header(X-Foo4: d\r );
+header(X-Foo5: e\rSet-Cookie: ID=123);
+echo 'foo';
+?
+--EXPECTF--
+Warning: Header may not contain more than a single header, new line detected. 
in %s on line %d
+foo
+--EXPECTHEADERS--
+X-Foo1: a
+X-Foo2: b
+X-Foo3: c
+X-Foo4: d
+

Added: php/php-src/trunk/ext/standard/tests/general_functions/bug60227_2.phpt
===
--- php/php-src/trunk/ext/standard/tests/general_functions/bug60227_2.phpt  
(rev 0)
+++ php/php-src/trunk/ext/standard/tests/general_functions/bug60227_2.phpt  
2012-02-02 18:24:53 UTC (rev 323033)
@@ -0,0 +1,14 @@
+--TEST--
+Bug #60227 (header() cannot detect the multi-line header with CR), \r before \n
+--FILE--
+?php
+header(X-foo: e\n foo);
+header(X-Foo6: e\rSet-Cookie: ID=123\n d);
+echo 'foo';
+?
+--EXPECTF--
+Warning: Header may not contain more than a single header, new line detected. 
in %s on line %d
+foo
+--EXPECTHEADERS--
+X-foo: e
+foo


Property changes on: 
php/php-src/trunk/ext/standard/tests/general_functions/bug60227_2.phpt
___
Added: svn:keywords
   + Id Rev Revision
Added: svn:eol-style
   + native

Modified: php/php-src/trunk/main/SAPI.c
===
--- php/php-src/trunk/main/SAPI.c   2012-02-02 18:22:46 UTC (rev 323032)
+++ php/php-src/trunk/main/SAPI.c   2012-02-02 18:24:53 UTC (rev 323033)
@@ -711,10 +711,11 @@
return SUCCESS;
} else {
/* new line safety check */
-   char *s = header_line, *e = header_line + header_line_len, *p;
-   while (s  e  ((p = memchr(s, '\n', (e - s))) || (p = 
memchr(s, '\r', (e - s) {
-   if (*(p + 1) == ' ' || *(p + 1) == '\t') {
-   s = p + 1;
+   char *s = header_line;
+   while (s = strpbrk(s, \n\r)) {
+   if (s[1] == ' ' || s[1] == '\t') {
+   /* RFC 2616 allows new lines if followed by SP 
or HT */
+   s++;
continue;
}
efree(header_line);

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

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

2012-01-31 Thread Michael Wallner
mike Tue, 31 Jan 2012 08:51:24 +

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

Log:
fix headers print to stdout/stderr if no output written; need to make some more 
testsbefore committing to PHP_5_4; fix crashes and invalid usage of output 
control in cli server while passing by

Changed paths:
U   php/php-src/trunk/main/main.c
U   php/php-src/trunk/main/output.c
U   php/php-src/trunk/sapi/cli/php_cli_server.c

Modified: php/php-src/trunk/main/main.c
===
--- php/php-src/trunk/main/main.c   2012-01-31 07:17:05 UTC (rev 322962)
+++ php/php-src/trunk/main/main.c   2012-01-31 08:51:24 UTC (rev 322963)
@@ -1738,12 +1738,11 @@
} else {
php_output_end_all(TSRMLS_C);
}
-   php_output_deactivate(TSRMLS_C);
} zend_end_try();

-   /* 4. Send the set HTTP headers (note: This must be done AFTER 
php_output_discard_all() / php_output_end_all() !!) */
+   /* 4. Shutdown output layer (send the set HTTP headers, cleanup output 
handlers, etc.) */
zend_try {
-   sapi_send_headers(TSRMLS_C);
+   php_output_deactivate(TSRMLS_C);
} zend_end_try();

/* 5. Reset max_execution_time (no longer executing php code after 
response sent) */

Modified: php/php-src/trunk/main/output.c
===
--- php/php-src/trunk/main/output.c 2012-01-31 07:17:05 UTC (rev 322962)
+++ php/php-src/trunk/main/output.c 2012-01-31 08:51:24 UTC (rev 322963)
@@ -103,6 +103,29 @@
 static int (*php_output_direct)(const char *str, size_t str_len) = 
php_output_stderr;
 /* }}} */

+/* {{{ void php_output_header(TSRMLS_D) */
+static void php_output_header(TSRMLS_D)
+{
+   if (!SG(headers_sent)) {
+   if (!OG(output_start_filename)) {
+   if (zend_is_compiling(TSRMLS_C)) {
+   OG(output_start_filename) = 
zend_get_compiled_filename(TSRMLS_C);
+   OG(output_start_lineno) = 
zend_get_compiled_lineno(TSRMLS_C);
+   } else if (zend_is_executing(TSRMLS_C)) {
+   OG(output_start_filename) = 
zend_get_executed_filename(TSRMLS_C);
+   OG(output_start_lineno) = 
zend_get_executed_lineno(TSRMLS_C);
+   }
+#if PHP_OUTPUT_DEBUG
+   fprintf(stderr, !!! output started at: %s (%d)\n, 
OG(output_start_filename), OG(output_start_lineno));
+#endif
+   }
+   if (!php_header(TSRMLS_C)) {
+   OG(flags) |= PHP_OUTPUT_DISABLED;
+   }
+   }
+}
+/* }}} */
+
 /* {{{ void php_output_startup(void)
  * Set up module globals and initalize the conflict and reverse conflict hash 
tables */
 PHPAPI void php_output_startup(void)
@@ -149,6 +172,9 @@
 {
php_output_handler **handler = NULL;

+   php_output_header(TSRMLS_C);
+
+   OG(flags) ^= PHP_OUTPUT_ACTIVATED;
OG(active) = NULL;
OG(running) = NULL;

@@ -161,7 +187,6 @@
zend_stack_destroy(OG(handlers));
}

-   OG(flags) ^= PHP_OUTPUT_ACTIVATED;
 }
 /* }}} */

@@ -1045,26 +1070,20 @@
}

if (context.out.data  context.out.used) {
+   php_output_header(TSRMLS_C);
+
+   if (!(OG(flags)  PHP_OUTPUT_DISABLED)) {
 #if PHP_OUTPUT_DEBUG
-   fprintf(stderr, ::: sapi_write('%s', %zu)\n, 
context.out.data, context.out.used);
+   fprintf(stderr, ::: sapi_write('%s', %zu)\n, 
context.out.data, context.out.used);
 #endif
-   if (!SG(headers_sent)  php_header(TSRMLS_C)) {
-   if (zend_is_compiling(TSRMLS_C)) {
-   OG(output_start_filename) = 
zend_get_compiled_filename(TSRMLS_C);
-   OG(output_start_lineno) = 
zend_get_compiled_lineno(TSRMLS_C);
-   } else if (zend_is_executing(TSRMLS_C)) {
-   OG(output_start_filename) = 
zend_get_executed_filename(TSRMLS_C);
-   OG(output_start_lineno) = 
zend_get_executed_lineno(TSRMLS_C);
+   sapi_module.ub_write(context.out.data, context.out.used 
TSRMLS_CC);
+
+   if (OG(flags)  PHP_OUTPUT_IMPLICITFLUSH) {
+   sapi_flush(TSRMLS_C);
}
-#if PHP_OUTPUT_DEBUG
-   fprintf(stderr, !!! output started at: %s (%d)\n, 
OG(output_start_filename), OG(output_start_lineno));
-#endif
+
+   OG(flags) |= PHP_OUTPUT_SENT;
}
-   sapi_module.ub_write(context.out.data, context.out.used 
TSRMLS_CC);
-   if (OG(flags)  PHP_OUTPUT_IMPLICITFLUSH) {
-   

[PHP-CVS] svn: /php/php-src/trunk/ext/standard/ string.c tests/strings/bug60801.phpt

2012-01-30 Thread Adam Harvey
aharvey  Mon, 30 Jan 2012 13:29:15 +

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

Log:
Fix bug #60801 (strpbrk() mishandles NUL byte) on trunk only for now.

Bug: https://bugs.php.net/60801 (Assigned) strpbrk() mishandles NUL byte
  
Changed paths:
U   php/php-src/trunk/ext/standard/string.c
A   php/php-src/trunk/ext/standard/tests/strings/bug60801.phpt

Modified: php/php-src/trunk/ext/standard/string.c
===
--- php/php-src/trunk/ext/standard/string.c 2012-01-30 13:02:10 UTC (rev 
322933)
+++ php/php-src/trunk/ext/standard/string.c 2012-01-30 13:29:15 UTC (rev 
322934)
@@ -5315,7 +5315,7 @@
 {
char *haystack, *char_list;
int haystack_len, char_list_len;
-   char *p;
+   char *haystack_ptr, *cl_ptr;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ss, haystack, 
haystack_len, char_list, char_list_len) == FAILURE) {
RETURN_FALSE;
@@ -5326,11 +5326,15 @@
RETURN_FALSE;
}

-   if ((p = strpbrk(haystack, char_list))) {
-   RETURN_STRINGL(p, (haystack + haystack_len - p), 1);
-   } else {
-   RETURN_FALSE;
+   for (haystack_ptr = haystack; haystack_ptr  (haystack + haystack_len); 
++haystack_ptr) {
+   for (cl_ptr = char_list; cl_ptr  (char_list + char_list_len); 
++cl_ptr) {
+   if (*cl_ptr == *haystack_ptr) {
+   RETURN_STRINGL(haystack_ptr, (haystack + 
haystack_len - haystack_ptr), 1);
+   }
+   }
}
+
+   RETURN_FALSE;
 }
 /* }}} */


Added: php/php-src/trunk/ext/standard/tests/strings/bug60801.phpt
===
--- php/php-src/trunk/ext/standard/tests/strings/bug60801.phpt  
(rev 0)
+++ php/php-src/trunk/ext/standard/tests/strings/bug60801.phpt  2012-01-30 
13:29:15 UTC (rev 322934)
@@ -0,0 +1,23 @@
+--TEST--
+Bug #60801 (strpbrk() mishandles NUL byte)
+--FILE--
+?php
+$haystack = foob\x00ar;
+$needle = a\x00b;
+
+var_dump(strpbrk($haystack, 'ar'));
+var_dump(strpbrk($haystack, \x00));
+var_dump(strpbrk($haystack, $needle));
+var_dump(strpbrk('foobar', $needle));
+var_dump(strpbrk(\x00, $needle));
+var_dump(strpbrk('xyz', $needle));
+var_dump(strpbrk($haystack, 'xyz'));
+?
+--EXPECT--
+string(2) ar
+string(3) 
+string(4) b
+string(3) bar
+string(1) 
+bool(false)
+bool(false)


Property changes on: php/php-src/trunk/ext/standard/tests/strings/bug60801.phpt
___
Added: svn:mime-type
   + text/x-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/Zend/ zend_alloc.c

2012-01-29 Thread Derick Rethans
derick   Sun, 29 Jan 2012 11:17:07 +

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

Log:
CS fixes.

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

Modified: php/php-src/trunk/Zend/zend_alloc.c
===
--- php/php-src/trunk/Zend/zend_alloc.c 2012-01-29 09:20:28 UTC (rev 322920)
+++ php/php-src/trunk/Zend/zend_alloc.c 2012-01-29 11:17:07 UTC (rev 322921)
@@ -1882,7 +1882,7 @@
size_t segment_size;
zend_mm_segment *segment;
int keep_rest = 0;
-#ifdef ZEND_SIGNALS
+#ifdef ZEND_SIGNALS
TSRMLS_FETCH();
 #endif

@@ -2058,7 +2058,7 @@
zend_mm_block *mm_block;
zend_mm_block *next_block;
size_t size;
-#ifdef ZEND_SIGNALS
+#ifdef ZEND_SIGNALS
TSRMLS_FETCH();
 #endif
if (!ZEND_MM_VALID_PTR(p)) {
@@ -2548,7 +2548,7 @@
 ZEND_API void *_ecalloc(size_t nmemb, size_t size ZEND_FILE_LINE_DC 
ZEND_FILE_LINE_ORIG_DC)
 {
void *p;
-#ifdef ZEND_SIGNALS
+#ifdef ZEND_SIGNALS
TSRMLS_FETCH();
 #endif
HANDLE_BLOCK_INTERRUPTIONS();
@@ -2567,7 +2567,7 @@
 {
int length;
char *p;
-#ifdef ZEND_SIGNALS
+#ifdef ZEND_SIGNALS
TSRMLS_FETCH();
 #endif

@@ -2587,7 +2587,7 @@
 ZEND_API char *_estrndup(const char *s, uint length ZEND_FILE_LINE_DC 
ZEND_FILE_LINE_ORIG_DC)
 {
char *p;
-#ifdef ZEND_SIGNALS
+#ifdef ZEND_SIGNALS
TSRMLS_FETCH();
 #endif

@@ -2608,7 +2608,7 @@
 ZEND_API char *zend_strndup(const char *s, uint length)
 {
char *p;
-#ifdef ZEND_SIGNALS
+#ifdef ZEND_SIGNALS
TSRMLS_FETCH();
 #endif


-- 
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/session/ mod_user.c tests/bug60860.phpt

2012-01-27 Thread Felipe Pena
felipe   Sat, 28 Jan 2012 01:24:54 +

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

Log:
- Fixed bug #60860 (session.save_handler=user without defined function core 
dumps)

Bug: https://bugs.php.net/60860 (Open) session.save_handler=user without 
defined function core dumps
  
Changed paths:
U   php/php-src/trunk/ext/session/mod_user.c
A   php/php-src/trunk/ext/session/tests/bug60860.phpt

Modified: php/php-src/trunk/ext/session/mod_user.c
===
--- php/php-src/trunk/ext/session/mod_user.c2012-01-28 00:37:53 UTC (rev 
322896)
+++ php/php-src/trunk/ext/session/mod_user.c2012-01-28 01:24:54 UTC (rev 
322897)
@@ -80,6 +80,13 @@
 {
zval *args[2];
STDVARS;
+
+   if (PSF(open) == NULL) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING,
+   user session functions not defined);
+
+   return FAILURE;
+   }

SESS_ZVAL_STRING((char*)save_path, args[0]);
SESS_ZVAL_STRING((char*)session_name, args[1]);

Added: php/php-src/trunk/ext/session/tests/bug60860.phpt
===
--- php/php-src/trunk/ext/session/tests/bug60860.phpt   
(rev 0)
+++ php/php-src/trunk/ext/session/tests/bug60860.phpt   2012-01-28 01:24:54 UTC 
(rev 322897)
@@ -0,0 +1,17 @@
+--TEST--
+Bug #60860 (session.save_handler=user without defined function core dumps)
+--SKIPIF--
+?php include('skipif.inc'); ?
+--INI--
+session.save_handler=user
+--FILE--
+?php
+
+session_start();
+echo ok\n;
+
+?
+--EXPECTF--
+Warning: session_start(): user session functions not defined in %s on line 3
+
+Fatal error: session_start(): Failed to initialize storage module: user (path: 
) in %s on line 3

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

[PHP-CVS] svn: /php/php-src/trunk/ run-tests.php

2012-01-25 Thread Michael Wallner
mike Wed, 25 Jan 2012 19:36:36 +

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

Log:
find a php-cgi which is a sibling of the php executable

Changed paths:
U   php/php-src/trunk/run-tests.php

Modified: php/php-src/trunk/run-tests.php
===
--- php/php-src/trunk/run-tests.php 2012-01-25 19:32:58 UTC (rev 322757)
+++ php/php-src/trunk/run-tests.php 2012-01-25 19:36:36 UTC (rev 322758)
@@ -1357,6 +1357,9 @@
} else if (file_exists(./sapi/cgi/php-cgi)) {
$old_php = $php;
$php = realpath(./sapi/cgi/php-cgi) . ' -C ';
+   } else if (file_exists(dirname($php) . /php-cgi)) {
+   $old_php = $php;
+   $php = realpath(dirname($php) . /php-cgi) . ' 
-C ';
} else {
show_result('SKIP', $tested, $tested_file, 
reason: CGI not available);
if ($JUNIT) {

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

[PHP-CVS] svn: /php/php-src/trunk/ Makefile.gcov configure.in

2012-01-23 Thread Michael Wallner
mike Mon, 23 Jan 2012 09:48:18 +

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

Log:
LTP/gcov/lcov

- allow ltp v1.9
- make sure `test`s are catched by `if`s
- introduce LCOV_INCLUDE make variable, simple coverage for your extension:
  ./configure --enable-gcov  make lcov TESTS=~/src/pecl/http/test 
LCOV_INCLUDE=/http/
  coverage takes just a few seconds instead of a few minutes for the full 
source tree

Changed paths:
U   php/php-src/trunk/Makefile.gcov
U   php/php-src/trunk/configure.in

Modified: php/php-src/trunk/Makefile.gcov
===
--- php/php-src/trunk/Makefile.gcov 2012-01-23 09:26:27 UTC (rev 322615)
+++ php/php-src/trunk/Makefile.gcov 2012-01-23 09:48:18 UTC (rev 322616)
@@ -3,6 +3,8 @@
 # LCOV
 #

+LCOV_INCLUDE=.
+
 lcov: lcov-html

 lcov-test: lcov-clean-data test
@@ -12,7 +14,7 @@
@rm -rf lcov_data/
@$(mkinstalldirs) lcov_data/
@echo
-   -@find . -name \*.gcda -o -name \*.gcno -o -name \*.da -o -name \*.h | 
sed -e 's/^\.\///' | sed -e 's/\.gcda//g' -e 's/\.gcno//g' -e 's/\.da//g' | 
uniq | while read x; do \
+   -@find . -name \*.gcda -o -name \*.gcno -o -name \*.da -o -name \*.h | 
sed -e 's/^\.\///' | sed -e 's/\.gcda//g' -e 's/\.gcno//g' -e 's/\.da//g' | 
$(EGREP) $(LCOV_INCLUDE) | uniq | while read x; do \
echo -n . ;\
y=`echo $$x | sed -e 's!\.libs/!!'`; \
dir=lcov_data/`dirname $$x`; \
@@ -38,14 +40,26 @@
if test -f $(top_builddir)/$$y.c; then \
ln -f -s $(top_builddir)/$$y.c lcov_data/$$y.c; \
fi; \
-   test -f $$x.gcno  cp $$x.gcno lcov_data/$$y.gcno ; \
-   test -f $$x.gcda  cp $$x.gcda lcov_data/$$y.gcda ; \
-   test -f $$x.dacp $$x.da   lcov_data/$$y.da ; \
-   test -f $$x.bbcp $$x.bb   lcov_data/$$y.bb ; \
-   test -f $$x.bbg   cp $$x.bbg  lcov_data/$$y.bbg ; \
-   done
+   if test -f $$x.gcno; then \
+   cp $$x.gcno lcov_data/$$y.gcno ; \
+   fi; \
+   if test -f $$x.gcda; then \
+   cp $$x.gcda lcov_data/$$y.gcda ; \
+   fi; \
+   if test -f $$x.da; then \
+   cp $$x.da   lcov_data/$$y.da ; \
+   fi; \
+   if test -f $$x.bb; then \
+   cp $$x.bb   lcov_data/$$y.bb ; \
+   fi; \
+   if test -f $$x.bbg; then \
+   cp $$x.bbg  lcov_data/$$y.bbg ; \
+   fi; \
+   done; \
for dir in ext/bcmath/libbcmath ext/fileinfo/libmagic ext/gd/libgd 
ext/mbstring/libmbfl ext/mbstring/oniguruma ext/pcre/pcrelib 
ext/pdo_sqlite/libsqlite ext/sqlite/libsqlite ext/sqlite3/libsqlite 
ext/xmlrpc/libxmlrpc ext/zip/lib; do \
-   test -d lcov_data/$$dir  rm -rf lcov_data/$$dir ; \
+   if test -d lcov_data/$$dir; then \
+   rm -rf lcov_data/$$dir ; \
+   fi; \
done
@echo
@echo Generating $@

Modified: php/php-src/trunk/configure.in
===
--- php/php-src/trunk/configure.in  2012-01-23 09:26:27 UTC (rev 322615)
+++ php/php-src/trunk/configure.in  2012-01-23 09:48:18 UTC (rev 322616)
@@ -784,7 +784,7 @@
 AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. 
You can disable ccache by setting environment variable CCACHE_DISABLE=1.])
   fi

-  ltp_version_list=1.5 1.6 1.7
+  ltp_version_list=1.5 1.6 1.7 1.9

   AC_CHECK_PROG(LTP, lcov, lcov)
   AC_CHECK_PROG(LTP_GENHTML, genhtml, genhtml)

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

[PHP-CVS] svn: /php/php-src/trunk/ NEWS Zend/tests/bug60825.phpt Zend/zend_vm_def.h Zend/zend_vm_execute.h

2012-01-21 Thread Xinchen Hui
laruence Sat, 21 Jan 2012 17:13:53 +

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

Log:
Fixed bug #60825 (Segfault when running symfony 2 tests)

Bug: https://bugs.php.net/60825 (Critical) Segfault when running symfony 2 tests
  
Changed paths:
U   php/php-src/trunk/NEWS
A   php/php-src/trunk/Zend/tests/bug60825.phpt
U   php/php-src/trunk/Zend/zend_vm_def.h
U   php/php-src/trunk/Zend/zend_vm_execute.h

Modified: php/php-src/trunk/NEWS
===
--- php/php-src/trunk/NEWS  2012-01-21 12:05:47 UTC (rev 322540)
+++ php/php-src/trunk/NEWS  2012-01-21 17:13:53 UTC (rev 322541)
@@ -8,6 +8,7 @@
 - Core:
   . Fixed bug #60573 (type hinting with self keyword causes weird errors).
 (Laruence)
+  . Fixed bug #60825 (Segfault when running symfony 2 tests). (Laruence)

 - cURL:
   . Added support for CURLOPT_FTP_RESPONSE_TIMEOUT, CURLOPT_APPEND,

Added: php/php-src/trunk/Zend/tests/bug60825.phpt
===
--- php/php-src/trunk/Zend/tests/bug60825.phpt  (rev 0)
+++ php/php-src/trunk/Zend/tests/bug60825.phpt  2012-01-21 17:13:53 UTC (rev 
322541)
@@ -0,0 +1,18 @@
+--TEST--
+Bug #60825 (Segfault when running symfony 2 tests)
+--DESCRIPTION--
+run this with valgrind
+--FILE--
+?php
+if (isset($loaded)) {
+$loaded = true;
+   class test {
+   public function __toString() {
+   return __FILE__;
+   }
+   }
+   $a = new test;
+   require_once $a;
+}
+?
+--EXPECT--

Modified: php/php-src/trunk/Zend/zend_vm_def.h
===
--- php/php-src/trunk/Zend/zend_vm_def.h2012-01-21 12:05:47 UTC (rev 
322540)
+++ php/php-src/trunk/Zend/zend_vm_def.h2012-01-21 17:13:53 UTC (rev 
322541)
@@ -3700,7 +3700,7 @@
inc_filename = GET_OP1_ZVAL_PTR(BP_VAR_R);

if (inc_filename-type!=IS_STRING) {
-   ZVAL_COPY_VALUE(tmp_inc_filename, inc_filename);
+   INIT_PZVAL_COPY(tmp_inc_filename, inc_filename);
zval_copy_ctor(tmp_inc_filename);
convert_to_string(tmp_inc_filename);
inc_filename = tmp_inc_filename;

Modified: php/php-src/trunk/Zend/zend_vm_execute.h
===
--- php/php-src/trunk/Zend/zend_vm_execute.h2012-01-21 12:05:47 UTC (rev 
322540)
+++ php/php-src/trunk/Zend/zend_vm_execute.h2012-01-21 17:13:53 UTC (rev 
322541)
@@ -2529,7 +2529,7 @@
inc_filename = opline-op1.zv;

if (inc_filename-type!=IS_STRING) {
-   ZVAL_COPY_VALUE(tmp_inc_filename, inc_filename);
+   INIT_PZVAL_COPY(tmp_inc_filename, inc_filename);
zval_copy_ctor(tmp_inc_filename);
convert_to_string(tmp_inc_filename);
inc_filename = tmp_inc_filename;
@@ -6859,7 +6859,7 @@
inc_filename = _get_zval_ptr_tmp(opline-op1.var, EX_Ts(), free_op1 
TSRMLS_CC);

if (inc_filename-type!=IS_STRING) {
-   ZVAL_COPY_VALUE(tmp_inc_filename, inc_filename);
+   INIT_PZVAL_COPY(tmp_inc_filename, inc_filename);
zval_copy_ctor(tmp_inc_filename);
convert_to_string(tmp_inc_filename);
inc_filename = tmp_inc_filename;
@@ -11216,7 +11216,7 @@
inc_filename = _get_zval_ptr_var(opline-op1.var, EX_Ts(), free_op1 
TSRMLS_CC);

if (inc_filename-type!=IS_STRING) {
-   ZVAL_COPY_VALUE(tmp_inc_filename, inc_filename);
+   INIT_PZVAL_COPY(tmp_inc_filename, inc_filename);
zval_copy_ctor(tmp_inc_filename);
convert_to_string(tmp_inc_filename);
inc_filename = tmp_inc_filename;
@@ -27068,7 +27068,7 @@
inc_filename = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline-op1.var 
TSRMLS_CC);

if (inc_filename-type!=IS_STRING) {
-   ZVAL_COPY_VALUE(tmp_inc_filename, inc_filename);
+   INIT_PZVAL_COPY(tmp_inc_filename, inc_filename);
zval_copy_ctor(tmp_inc_filename);
convert_to_string(tmp_inc_filename);
inc_filename = tmp_inc_filename;

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

2012-01-20 Thread Pierrick Charron
pierrick Fri, 20 Jan 2012 13:20:14 +

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

Log:
Remove memory leak in substr_replace (to commit in 5.4 after code freeze)

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

Modified: php/php-src/trunk/ext/standard/string.c
===
--- php/php-src/trunk/ext/standard/string.c 2012-01-20 12:31:37 UTC (rev 
322496)
+++ php/php-src/trunk/ext/standard/string.c 2012-01-20 13:20:14 UTC (rev 
322497)
@@ -2518,6 +2518,9 @@

if(Z_REFCOUNT_P(orig_str) != refcount) {
php_error_docref(NULL 
TSRMLS_CC, E_WARNING, Argument was modified while replacing);
+   if(Z_TYPE_PP(tmp_repl) != 
IS_STRING) {
+   zval_dtor(repl_str);
+   }
break;
}


-- 
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/ ftp/ftp.c openssl/xp_ssl.c

2012-01-19 Thread Scott MacVicar
scottmac Fri, 20 Jan 2012 05:31:53 +

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

Log:
Fix CVE-2011-3389. Possible attack on CBC mode with TLS 1.0.

See http://www.openssl.org/~bodo/tls-cbc.txt

The biggest reason for this mode being in SSL_OP_ALL was older versions
of IE (2002) talking to servers using OpenSSL.

Can hopefully get this into 5.4.

Changed paths:
U   php/php-src/trunk/ext/ftp/ftp.c
U   php/php-src/trunk/ext/openssl/xp_ssl.c

Modified: php/php-src/trunk/ext/ftp/ftp.c
===
--- php/php-src/trunk/ext/ftp/ftp.c 2012-01-20 05:16:03 UTC (rev 322484)
+++ php/php-src/trunk/ext/ftp/ftp.c 2012-01-20 05:31:53 UTC (rev 322485)
@@ -243,6 +243,7 @@
 {
 #if HAVE_OPENSSL_EXT
SSL_CTX *ctx = NULL;
+   long ssl_ctx_options = SSL_OP_ALL;
 #endif
if (ftp == NULL) {
return 0;
@@ -279,7 +280,10 @@
return 0;
}

-   SSL_CTX_set_options(ctx, SSL_OP_ALL);
+#if OPENSSL_VERSION_NUMBER = 0x0090605fL
+   ssl_ctx_options = ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS;
+#endif
+   SSL_CTX_set_options(ctx, ssl_ctx_options);

ftp-ssl_handle = SSL_new(ctx);
if (ftp-ssl_handle == NULL) {
@@ -1495,6 +1499,7 @@

 #if HAVE_OPENSSL_EXT
SSL_CTX *ctx;
+   long ssl_ctx_options = SSL_OP_ALL;
 #endif

if (data-fd != -1) {
@@ -1521,7 +1526,10 @@
return 0;
}

-   SSL_CTX_set_options(ctx, SSL_OP_ALL);
+#if OPENSSL_VERSION_NUMBER = 0x0090605fL
+   ssl_ctx_options = ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS;
+#endif
+   SSL_CTX_set_options(ctx, ssl_ctx_options);

data-ssl_handle = SSL_new(ctx);
if (data-ssl_handle == NULL) {

Modified: php/php-src/trunk/ext/openssl/xp_ssl.c
===
--- php/php-src/trunk/ext/openssl/xp_ssl.c  2012-01-20 05:16:03 UTC (rev 
322484)
+++ php/php-src/trunk/ext/openssl/xp_ssl.c  2012-01-20 05:31:53 UTC (rev 
322485)
@@ -310,6 +310,7 @@
TSRMLS_DC)
 {
SSL_METHOD *method;
+   long ssl_ctx_options = SSL_OP_ALL;

if (sslsock-ssl_handle) {
if (sslsock-s.is_blocked) {
@@ -377,7 +378,10 @@
return -1;
}

-   SSL_CTX_set_options(sslsock-ctx, SSL_OP_ALL);
+#if OPENSSL_VERSION_NUMBER = 0x0090605fL
+   ssl_ctx_options = ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS;
+#endif
+   SSL_CTX_set_options(sslsock-ctx, ssl_ctx_options);

 #if OPENSSL_VERSION_NUMBER = 0x0090806fL
{

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

[PHP-CVS] svn: /php/php-src/trunk/ NEWS ext/reflection/php_reflection.c ext/reflection/tests/ReflectionClass_setFinal.phpt ext/reflection/tests/ReflectionClass_toString_001.phpt ext/reflection/tests/R

2012-01-17 Thread Sebastian Bergmann
sebastianTue, 17 Jan 2012 12:59:33 +

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

Log:
Implement ReflectionClass::setFinal() and ReflectionMethod::setFinal().

Patch by Jan Dolecek juzna...@gmail.com.

Changed paths:
U   php/php-src/trunk/NEWS
U   php/php-src/trunk/ext/reflection/php_reflection.c
A   php/php-src/trunk/ext/reflection/tests/ReflectionClass_setFinal.phpt
U   php/php-src/trunk/ext/reflection/tests/ReflectionClass_toString_001.phpt
A   php/php-src/trunk/ext/reflection/tests/ReflectionMethod_setFinal.phpt

Modified: php/php-src/trunk/NEWS
===
--- php/php-src/trunk/NEWS  2012-01-17 10:35:39 UTC (rev 322389)
+++ php/php-src/trunk/NEWS  2012-01-17 12:59:33 UTC (rev 322390)
@@ -35,4 +35,9 @@
 - pgsql
   . Added pg_escape_literal() and pg_escape_identifier() (Yasuo)

+- Reflection:
+  . Added ReflectionCLass::setFinal() and ReflectionMethod::setFinal() to allow
+stubbing and mocking of final classes and methods, for instance.
+(Sebastian, Jan Dolecek juzna...@gmail.com)
+
  NOTE: Insert NEWS from last stable release here prior to actual release! 


Modified: php/php-src/trunk/ext/reflection/php_reflection.c
===
--- php/php-src/trunk/ext/reflection/php_reflection.c   2012-01-17 10:35:39 UTC 
(rev 322389)
+++ php/php-src/trunk/ext/reflection/php_reflection.c   2012-01-17 12:59:33 UTC 
(rev 322390)
@@ -3113,6 +3113,28 @@
 }
 /* }}} */

+/* {{{ proto public void ReflectionMethod::setFinal([bool isFinal = true])
+  Sets/unsets class as final */
+ZEND_METHOD(reflection_method, setFinal)
+{
+   reflection_object *intern;
+   zend_function *mptr;
+   zend_bool isFinal = 1;
+
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |b, isFinal) == 
FAILURE) {
+   return;
+   }
+
+   GET_REFLECTION_OBJECT_PTR(mptr);
+
+   if (isFinal) {
+   mptr-common.fn_flags |= ZEND_ACC_FINAL;
+   } else {
+   mptr-common.fn_flags = ~ZEND_ACC_FINAL;
+   }
+}
+/* }}} */
+
 /* {{{ proto public ReflectionClass ReflectionMethod::getDeclaringClass()
Get the declaring class */
 ZEND_METHOD(reflection_method, getDeclaringClass)
@@ -4047,6 +4069,28 @@
 }
 /* }}} */

+/* {{{ proto public void ReflectionClass::setFinal([bool isFinal = true])
+   Sets/unsets class as final */
+ZEND_METHOD(reflection_class, setFinal)
+{
+   reflection_object *intern;
+   zend_class_entry *ce;
+   zend_bool isFinal = 1;
+
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |b, isFinal) == 
FAILURE) {
+   return;
+   }
+
+   GET_REFLECTION_OBJECT_PTR(ce);
+
+   if (isFinal) {
+   ce-ce_flags |= ZEND_ACC_FINAL_CLASS;
+   } else {
+   ce-ce_flags = ~ZEND_ACC_FINAL_CLASS;
+   }
+}
+/* }}} */
+
 /* {{{ proto public int ReflectionClass::getModifiers()
Returns a bitfield of the access modifiers for this class */
 ZEND_METHOD(reflection_class, getModifiers)
@@ -5651,6 +5695,10 @@
ZEND_ARG_INFO(0, value)
 ZEND_END_ARG_INFO()

+ZEND_BEGIN_ARG_INFO(arginfo_reflection_method_setFinal, 0)
+   ZEND_ARG_INFO(0, value)
+ZEND_END_ARG_INFO()
+
 ZEND_BEGIN_ARG_INFO(arginfo_reflection_method_getClosure, 0)
ZEND_ARG_INFO(0, object)
 ZEND_END_ARG_INFO()
@@ -5664,6 +5712,7 @@
ZEND_ME(reflection_method, isProtected, arginfo_reflection__void, 0)
ZEND_ME(reflection_method, isAbstract, arginfo_reflection__void, 0)
ZEND_ME(reflection_method, isFinal, arginfo_reflection__void, 0)
+   ZEND_ME(reflection_method, setFinal, 
arginfo_reflection_method_setFinal, 0)
ZEND_ME(reflection_method, isStatic, arginfo_reflection__void, 0)
ZEND_ME(reflection_method, isConstructor, arginfo_reflection__void, 0)
ZEND_ME(reflection_method, isDestructor, arginfo_reflection__void, 0)
@@ -5733,6 +5782,10 @@
ZEND_ARG_INFO(0, object)
 ZEND_END_ARG_INFO()

+ZEND_BEGIN_ARG_INFO(arginfo_reflection_class_setFinal, 0)
+   ZEND_ARG_INFO(0, value)
+ZEND_END_ARG_INFO()
+
 ZEND_BEGIN_ARG_INFO(arginfo_reflection_class_newInstance, 0)
ZEND_ARG_INFO(0, args)
 ZEND_END_ARG_INFO()
@@ -5785,6 +5838,7 @@
ZEND_ME(reflection_class, isTrait, arginfo_reflection__void, 0)
ZEND_ME(reflection_class, isAbstract, arginfo_reflection__void, 0)
ZEND_ME(reflection_class, isFinal, arginfo_reflection__void, 0)
+   ZEND_ME(reflection_class, setFinal, arginfo_reflection_class_setFinal, 
0)
ZEND_ME(reflection_class, getModifiers, arginfo_reflection__void, 0)
ZEND_ME(reflection_class, isInstance, 
arginfo_reflection_class_isInstance, 0)
ZEND_ME(reflection_class, newInstance, 
arginfo_reflection_class_newInstance, 0)

Added: php/php-src/trunk/ext/reflection/tests/ReflectionClass_setFinal.phpt

[PHP-CVS] svn: /php/php-src/trunk/ NEWS ext/reflection/php_reflection.c ext/reflection/tests/ReflectionClass_setFinal.phpt ext/reflection/tests/ReflectionClass_toString_001.phpt ext/reflection/tests/R

2012-01-17 Thread Sebastian Bergmann
sebastianTue, 17 Jan 2012 13:46:31 +

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

Log:
Revert r322390.

Changed paths:
U   php/php-src/trunk/NEWS
U   php/php-src/trunk/ext/reflection/php_reflection.c
D   php/php-src/trunk/ext/reflection/tests/ReflectionClass_setFinal.phpt
U   php/php-src/trunk/ext/reflection/tests/ReflectionClass_toString_001.phpt
D   php/php-src/trunk/ext/reflection/tests/ReflectionMethod_setFinal.phpt

Modified: php/php-src/trunk/NEWS
===
--- php/php-src/trunk/NEWS  2012-01-17 13:38:26 UTC (rev 322397)
+++ php/php-src/trunk/NEWS  2012-01-17 13:46:31 UTC (rev 322398)
@@ -35,9 +35,4 @@
 - pgsql
   . Added pg_escape_literal() and pg_escape_identifier() (Yasuo)

-- Reflection:
-  . Added ReflectionCLass::setFinal() and ReflectionMethod::setFinal() to allow
-stubbing and mocking of final classes and methods, for instance.
-(Sebastian, Jan Dolecek juzna...@gmail.com)
-
  NOTE: Insert NEWS from last stable release here prior to actual release! 


Modified: php/php-src/trunk/ext/reflection/php_reflection.c
===
--- php/php-src/trunk/ext/reflection/php_reflection.c   2012-01-17 13:38:26 UTC 
(rev 322397)
+++ php/php-src/trunk/ext/reflection/php_reflection.c   2012-01-17 13:46:31 UTC 
(rev 322398)
@@ -3113,28 +3113,6 @@
 }
 /* }}} */

-/* {{{ proto public void ReflectionMethod::setFinal([bool isFinal = true])
-  Sets/unsets class as final */
-ZEND_METHOD(reflection_method, setFinal)
-{
-   reflection_object *intern;
-   zend_function *mptr;
-   zend_bool isFinal = 1;
-
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |b, isFinal) == 
FAILURE) {
-   return;
-   }
-
-   GET_REFLECTION_OBJECT_PTR(mptr);
-
-   if (isFinal) {
-   mptr-common.fn_flags |= ZEND_ACC_FINAL;
-   } else {
-   mptr-common.fn_flags = ~ZEND_ACC_FINAL;
-   }
-}
-/* }}} */
-
 /* {{{ proto public ReflectionClass ReflectionMethod::getDeclaringClass()
Get the declaring class */
 ZEND_METHOD(reflection_method, getDeclaringClass)
@@ -4069,28 +4047,6 @@
 }
 /* }}} */

-/* {{{ proto public void ReflectionClass::setFinal([bool isFinal = true])
-   Sets/unsets class as final */
-ZEND_METHOD(reflection_class, setFinal)
-{
-   reflection_object *intern;
-   zend_class_entry *ce;
-   zend_bool isFinal = 1;
-
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |b, isFinal) == 
FAILURE) {
-   return;
-   }
-
-   GET_REFLECTION_OBJECT_PTR(ce);
-
-   if (isFinal) {
-   ce-ce_flags |= ZEND_ACC_FINAL_CLASS;
-   } else {
-   ce-ce_flags = ~ZEND_ACC_FINAL_CLASS;
-   }
-}
-/* }}} */
-
 /* {{{ proto public int ReflectionClass::getModifiers()
Returns a bitfield of the access modifiers for this class */
 ZEND_METHOD(reflection_class, getModifiers)
@@ -5695,10 +5651,6 @@
ZEND_ARG_INFO(0, value)
 ZEND_END_ARG_INFO()

-ZEND_BEGIN_ARG_INFO(arginfo_reflection_method_setFinal, 0)
-   ZEND_ARG_INFO(0, value)
-ZEND_END_ARG_INFO()
-
 ZEND_BEGIN_ARG_INFO(arginfo_reflection_method_getClosure, 0)
ZEND_ARG_INFO(0, object)
 ZEND_END_ARG_INFO()
@@ -5712,7 +5664,6 @@
ZEND_ME(reflection_method, isProtected, arginfo_reflection__void, 0)
ZEND_ME(reflection_method, isAbstract, arginfo_reflection__void, 0)
ZEND_ME(reflection_method, isFinal, arginfo_reflection__void, 0)
-   ZEND_ME(reflection_method, setFinal, 
arginfo_reflection_method_setFinal, 0)
ZEND_ME(reflection_method, isStatic, arginfo_reflection__void, 0)
ZEND_ME(reflection_method, isConstructor, arginfo_reflection__void, 0)
ZEND_ME(reflection_method, isDestructor, arginfo_reflection__void, 0)
@@ -5782,10 +5733,6 @@
ZEND_ARG_INFO(0, object)
 ZEND_END_ARG_INFO()

-ZEND_BEGIN_ARG_INFO(arginfo_reflection_class_setFinal, 0)
-   ZEND_ARG_INFO(0, value)
-ZEND_END_ARG_INFO()
-
 ZEND_BEGIN_ARG_INFO(arginfo_reflection_class_newInstance, 0)
ZEND_ARG_INFO(0, args)
 ZEND_END_ARG_INFO()
@@ -5838,7 +5785,6 @@
ZEND_ME(reflection_class, isTrait, arginfo_reflection__void, 0)
ZEND_ME(reflection_class, isAbstract, arginfo_reflection__void, 0)
ZEND_ME(reflection_class, isFinal, arginfo_reflection__void, 0)
-   ZEND_ME(reflection_class, setFinal, arginfo_reflection_class_setFinal, 
0)
ZEND_ME(reflection_class, getModifiers, arginfo_reflection__void, 0)
ZEND_ME(reflection_class, isInstance, 
arginfo_reflection_class_isInstance, 0)
ZEND_ME(reflection_class, newInstance, 
arginfo_reflection_class_newInstance, 0)

Deleted: php/php-src/trunk/ext/reflection/tests/ReflectionClass_setFinal.phpt
===
--- 

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

2012-01-17 Thread Xinchen Hui
laruence Tue, 17 Jan 2012 14:32:01 +

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

Log:
unnecessay slash

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

Modified: php/php-src/trunk/ext/mysqli/mysqli_prop.c
===
--- php/php-src/trunk/ext/mysqli/mysqli_prop.c  2012-01-17 14:25:28 UTC (rev 
322412)
+++ php/php-src/trunk/ext/mysqli/mysqli_prop.c  2012-01-17 14:32:01 UTC (rev 
322413)
@@ -253,8 +253,8 @@
 MYSQLI_MAP_PROPERTY_FUNC_LONG(link_warning_count_read, mysql_warning_count, 
MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), ulong, %lu)

 /* {{{ property link_stat_read */
-static int link_stat_read(mysqli_object *obj, zval **retval TSRMLS_DC)\
-{\
+static int link_stat_read(mysqli_object *obj, zval **retval TSRMLS_DC)
+{
MY_MYSQL *mysql;

MAKE_STD_ZVAL(*retval);

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

[PHP-CVS] svn: /php/php-src/trunk/ NEWS ext/hash/hash_tiger.c ext/hash/tests/tiger.phpt

2012-01-17 Thread Michael Wallner
mike Tue, 17 Jan 2012 15:25:54 +

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

Log:
adapted tiger hash byte print order to those of md5 and sha1

see http://en.wikipedia.org/wiki/Tiger_(cryptography)

http://www.cs.technion.ac.il/~biham/Reports/Tiger/test-vectors-nessie-format.dat

Closes Bug #60221 Tiger hash output byte order

Bug: https://bugs.php.net/60221 (error getting bug information)
  
Changed paths:
U   php/php-src/trunk/NEWS
U   php/php-src/trunk/ext/hash/hash_tiger.c
U   php/php-src/trunk/ext/hash/tests/tiger.phpt

Modified: php/php-src/trunk/NEWS
===
--- php/php-src/trunk/NEWS  2012-01-17 14:48:41 UTC (rev 322418)
+++ php/php-src/trunk/NEWS  2012-01-17 15:25:54 UTC (rev 322419)
@@ -32,6 +32,9 @@
still exists for backward compatibility but is doing nothing). 
(Pierrick)
   . Fixed bug #54995 (Missing CURLINFO_RESPONSE_CODE support). (Pierrick)

+- hash
+  . Fixed bug #60221 (Tiger hash output byte order) (Mike)
+
 - pgsql
   . Added pg_escape_literal() and pg_escape_identifier() (Yasuo)


Modified: php/php-src/trunk/ext/hash/hash_tiger.c
===
--- php/php-src/trunk/ext/hash/hash_tiger.c 2012-01-17 14:48:41 UTC (rev 
322418)
+++ php/php-src/trunk/ext/hash/hash_tiger.c 2012-01-17 15:25:54 UTC (rev 
322419)
@@ -169,6 +169,15 @@
tiger_compress(context-passes, ((php_hash_uint64 *) context-buffer), 
context-state);
 }

+static inline void TigerDigest(unsigned char *digest_str, unsigned int 
digest_len, PHP_TIGER_CTX *context)
+{
+   unsigned int i;
+
+   for (i = 0; i  digest_len; ++i) {
+   digest_str[i] = (unsigned char) ((context-state[i/8]  (8 * 
(i%8)))  0xff);
+   }
+}
+
 PHP_HASH_API void PHP_3TIGERInit(PHP_TIGER_CTX *context)
 {
memset(context, 0, sizeof(*context));
@@ -216,84 +225,21 @@
 PHP_HASH_API void PHP_TIGER128Final(unsigned char digest[16], PHP_TIGER_CTX 
*context)
 {
TigerFinalize(context);
-
-   digest[0] = (unsigned char) ((context-state[0]  56)  0xff);
-   digest[1] = (unsigned char) ((context-state[0]  48)  0xff);
-   digest[2] = (unsigned char) ((context-state[0]  40)  0xff);
-   digest[3] = (unsigned char) ((context-state[0]  32)  0xff);
-   digest[4] = (unsigned char) ((context-state[0]  24)  0xff);
-   digest[5] = (unsigned char) ((context-state[0]  16)  0xff);
-   digest[6] = (unsigned char) ((context-state[0]  8)  0xff);
-   digest[7] = (unsigned char) (context-state[0]  0xff);
-   digest[8] = (unsigned char) ((context-state[1]  56)  0xff);
-   digest[9] = (unsigned char) ((context-state[1]  48)  0xff);
-   digest[10] = (unsigned char) ((context-state[1]  40)  0xff);
-   digest[11] = (unsigned char) ((context-state[1]  32)  0xff);
-   digest[12] = (unsigned char) ((context-state[1]  24)  0xff);
-   digest[13] = (unsigned char) ((context-state[1]  16)  0xff);
-   digest[14] = (unsigned char) ((context-state[1]  8)  0xff);
-   digest[15] = (unsigned char) (context-state[1]  0xff);
-
+   TigerDigest(digest, 16, context);
memset(context, 0, sizeof(*context));
 }

 PHP_HASH_API void PHP_TIGER160Final(unsigned char digest[20], PHP_TIGER_CTX 
*context)
 {
TigerFinalize(context);
-
-   digest[0] = (unsigned char) ((context-state[0]  56)  0xff);
-   digest[1] = (unsigned char) ((context-state[0]  48)  0xff);
-   digest[2] = (unsigned char) ((context-state[0]  40)  0xff);
-   digest[3] = (unsigned char) ((context-state[0]  32)  0xff);
-   digest[4] = (unsigned char) ((context-state[0]  24)  0xff);
-   digest[5] = (unsigned char) ((context-state[0]  16)  0xff);
-   digest[6] = (unsigned char) ((context-state[0]  8)  0xff);
-   digest[7] = (unsigned char) (context-state[0]  0xff);
-   digest[8] = (unsigned char) ((context-state[1]  56)  0xff);
-   digest[9] = (unsigned char) ((context-state[1]  48)  0xff);
-   digest[10] = (unsigned char) ((context-state[1]  40)  0xff);
-   digest[11] = (unsigned char) ((context-state[1]  32)  0xff);
-   digest[12] = (unsigned char) ((context-state[1]  24)  0xff);
-   digest[13] = (unsigned char) ((context-state[1]  16)  0xff);
-   digest[14] = (unsigned char) ((context-state[1]  8)  0xff);
-   digest[15] = (unsigned char) (context-state[1]  0xff);
-   digest[16] = (unsigned char) ((context-state[2]  56)  0xff);
-   digest[17] = (unsigned char) ((context-state[2]  48)  0xff);
-   digest[18] = (unsigned char) ((context-state[2]  40)  0xff);
-   digest[19] = (unsigned char) ((context-state[2]  32)  0xff);
-
+   TigerDigest(digest, 20, context);
memset(context, 0, sizeof(*context));
 }

 PHP_HASH_API void PHP_TIGER192Final(unsigned char digest[24], PHP_TIGER_CTX 
*context)
 {
TigerFinalize(context);

[PHP-CVS] svn: /php/php-src/trunk/ NEWS ext/hash/config.m4 ext/hash/config.w32 ext/hash/hash.c ext/hash/hash_salsa.c ext/hash/php_hash.h ext/hash/php_hash_salsa.h ext/hash/tests/hash_algos.phpt ext/ha

2012-01-17 Thread Michael Wallner
mike Tue, 17 Jan 2012 16:35:32 +

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

Log:
remove Salsa10/Salsa20, which are actually stream ciphers not hash functions

Changed paths:
U   php/php-src/trunk/NEWS
U   php/php-src/trunk/ext/hash/config.m4
U   php/php-src/trunk/ext/hash/config.w32
U   php/php-src/trunk/ext/hash/hash.c
D   php/php-src/trunk/ext/hash/hash_salsa.c
U   php/php-src/trunk/ext/hash/php_hash.h
D   php/php-src/trunk/ext/hash/php_hash_salsa.h
U   php/php-src/trunk/ext/hash/tests/hash_algos.phpt
U   php/php-src/trunk/ext/hash/tests/hash_copy_001.phpt

Modified: php/php-src/trunk/NEWS
===
--- php/php-src/trunk/NEWS	2012-01-17 15:59:44 UTC (rev 322420)
+++ php/php-src/trunk/NEWS	2012-01-17 16:35:32 UTC (rev 322421)
@@ -34,6 +34,7 @@

 - hash
   . Fixed bug #60221 (Tiger hash output byte order) (Mike)
+  . Removed Salsa10/Salsa20, which are actually stream ciphers (Mike)

 - pgsql
   . Added pg_escape_literal() and pg_escape_identifier() (Yasuo)

Modified: php/php-src/trunk/ext/hash/config.m4
===
--- php/php-src/trunk/ext/hash/config.m4	2012-01-17 15:59:44 UTC (rev 322420)
+++ php/php-src/trunk/ext/hash/config.m4	2012-01-17 16:35:32 UTC (rev 322421)
@@ -27,10 +27,10 @@

   EXT_HASH_SOURCES=hash.c hash_md.c hash_sha.c hash_ripemd.c hash_haval.c \
 hash_tiger.c hash_gost.c hash_snefru.c hash_whirlpool.c hash_adler32.c \
-hash_crc32.c hash_salsa.c hash_fnv.c hash_joaat.c
+hash_crc32.c hash_fnv.c hash_joaat.c
   EXT_HASH_HEADERS=php_hash.h php_hash_md.h php_hash_sha.h php_hash_ripemd.h \
 php_hash_haval.h php_hash_tiger.h php_hash_gost.h php_hash_snefru.h \
-php_hash_whirlpool.h php_hash_adler32.h php_hash_crc32.h php_hash_salsa.h \
+php_hash_whirlpool.h php_hash_adler32.h php_hash_crc32.h \
 php_hash_fnv.h php_hash_joaat.h php_hash_types.h

   PHP_NEW_EXTENSION(hash, $EXT_HASH_SOURCES, $ext_shared)

Modified: php/php-src/trunk/ext/hash/config.w32
===
--- php/php-src/trunk/ext/hash/config.w32	2012-01-17 15:59:44 UTC (rev 322420)
+++ php/php-src/trunk/ext/hash/config.w32	2012-01-17 16:35:32 UTC (rev 322421)
@@ -15,11 +15,11 @@
 	AC_DEFINE('HAVE_HASH_EXT', 1);
 	EXTENSION(hash, hash.c hash_md.c hash_sha.c hash_ripemd.c hash_haval.c 
 		+ hash_tiger.c hash_gost.c hash_snefru.c hash_whirlpool.c 
-		+ hash_adler32.c hash_crc32.c hash_salsa.c hash_joaat.c hash_fnv.c);
+		+ hash_adler32.c hash_crc32.c hash_joaat.c hash_fnv.c);

 		PHP_INSTALL_HEADERS(ext/hash/, php_hash.h php_hash_md.h php_hash_sha.h php_hash_ripemd.h  +
 		php_hash_haval.h php_hash_tiger.h php_hash_gost.h php_hash_snefru.h  +
-		php_hash_whirlpool.h php_hash_adler32.h php_hash_crc32.h php_hash_salsa.h  +
+		php_hash_whirlpool.h php_hash_adler32.h php_hash_crc32.h  +
 		php_hash_types.h);
 }


Modified: php/php-src/trunk/ext/hash/hash.c
===
--- php/php-src/trunk/ext/hash/hash.c	2012-01-17 15:59:44 UTC (rev 322420)
+++ php/php-src/trunk/ext/hash/hash.c	2012-01-17 16:35:32 UTC (rev 322421)
@@ -851,8 +851,6 @@
 	php_hash_register_algo(adler32,		php_hash_adler32_ops);
 	php_hash_register_algo(crc32,			php_hash_crc32_ops);
 	php_hash_register_algo(crc32b,		php_hash_crc32b_ops);
-	php_hash_register_algo(salsa10,		php_hash_salsa10_ops);
-	php_hash_register_algo(salsa20,		php_hash_salsa20_ops);
 	php_hash_register_algo(fnv132,		php_hash_fnv132_ops);
 	php_hash_register_algo(fnv164,		php_hash_fnv164_ops);
 	php_hash_register_algo(joaat,			php_hash_joaat_ops);

Deleted: php/php-src/trunk/ext/hash/hash_salsa.c
===
--- php/php-src/trunk/ext/hash/hash_salsa.c	2012-01-17 15:59:44 UTC (rev 322420)
+++ php/php-src/trunk/ext/hash/hash_salsa.c	2012-01-17 16:35:32 UTC (rev 322421)
@@ -1,224 +0,0 @@
-/*
-  +--+
-  | PHP Version 5|
-  +--+
-  | Copyright (c) 1997-2012 The PHP Group|
-  +--+
-  | This source file is subject to version 3.01 of the PHP license,  |
-  | that is bundled with this package in the file LICENSE, and is|
-  | available through the world-wide-web at the following url:   |
-  | http://www.php.net/license/3_01.txt  |
-  | If you did not receive a copy of the PHP license and are unable to   |
-  | obtain it through the world-wide-web, please send a note to  |
-  | lice...@php.net so we can mail you a copy immediately.   |
-  

[PHP-CVS] svn: /php/php-src/trunk/ext/hash/tests/ hash_copy_001.phpt hash_file_basic1.phpt hash_hmac_basic.phpt hash_hmac_file_basic.phpt

2012-01-17 Thread Michael Wallner
mike Tue, 17 Jan 2012 17:21:32 +

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

Log:
fix tests I borked

Changed paths:
U   php/php-src/trunk/ext/hash/tests/hash_copy_001.phpt
U   php/php-src/trunk/ext/hash/tests/hash_file_basic1.phpt
U   php/php-src/trunk/ext/hash/tests/hash_hmac_basic.phpt
U   php/php-src/trunk/ext/hash/tests/hash_hmac_file_basic.phpt

Modified: php/php-src/trunk/ext/hash/tests/hash_copy_001.phpt
===
--- php/php-src/trunk/ext/hash/tests/hash_copy_001.phpt 2012-01-17 16:48:19 UTC 
(rev 322422)
+++ php/php-src/trunk/ext/hash/tests/hash_copy_001.phpt 2012-01-17 17:21:32 UTC 
(rev 322423)
@@ -71,23 +71,23 @@
 string(128) 
6e60597340640e621e25f975cef2b000b0c4c09a7af7d240a52d193002b0a8426fa7da7acc5b37ed9608016d4f396db834a0ea2f2c35f900461c9ac7e5604082
 string(128) 
6e60597340640e621e25f975cef2b000b0c4c09a7af7d240a52d193002b0a8426fa7da7acc5b37ed9608016d4f396db834a0ea2f2c35f900461c9ac7e5604082
 string(10) tiger128,3
-string(32) a92be6c58be7688dc6cf9585a47aa625
-string(32) a92be6c58be7688dc6cf9585a47aa625
+string(32) 8d68e78bc5e62ba925a67aa48595cfc6
+string(32) 8d68e78bc5e62ba925a67aa48595cfc6
 string(10) tiger160,3
-string(40) a92be6c58be7688dc6cf9585a47aa62535fc2482
-string(40) a92be6c58be7688dc6cf9585a47aa62535fc2482
+string(40) 8d68e78bc5e62ba925a67aa48595cfc62cd1e5e0
+string(40) 8d68e78bc5e62ba925a67aa48595cfc62cd1e5e0
 string(10) tiger192,3
-string(48) a92be6c58be7688dc6cf9585a47aa62535fc2482e0e5d12c
-string(48) a92be6c58be7688dc6cf9585a47aa62535fc2482e0e5d12c
+string(48) 8d68e78bc5e62ba925a67aa48595cfc62cd1e5e08224fc35
+string(48) 8d68e78bc5e62ba925a67aa48595cfc62cd1e5e08224fc35
 string(10) tiger128,4
-string(32) 32fb748ef5a36ca222511bcb99b044ee
-string(32) 32fb748ef5a36ca222511bcb99b044ee
+string(32) a26ca3f58e74fb32ee44b099cb1b5122
+string(32) a26ca3f58e74fb32ee44b099cb1b5122
 string(10) tiger160,4
-string(40) 32fb748ef5a36ca222511bcb99b044ee1d740bf3
-string(40) 32fb748ef5a36ca222511bcb99b044ee1d740bf3
+string(40) a26ca3f58e74fb32ee44b099cb1b512203375900
+string(40) a26ca3f58e74fb32ee44b099cb1b512203375900
 string(10) tiger192,4
-string(48) 32fb748ef5a36ca222511bcb99b044ee1d740bf300593703
-string(48) 32fb748ef5a36ca222511bcb99b044ee1d740bf300593703
+string(48) a26ca3f58e74fb32ee44b099cb1b512203375900f30b741d
+string(48) a26ca3f58e74fb32ee44b099cb1b512203375900f30b741d
 string(6) snefru
 string(64) fbe88daa74c89b9e29468fa3cd3a657d31845e21bb58dd3f8d806f5179a85c26
 string(64) fbe88daa74c89b9e29468fa3cd3a657d31845e21bb58dd3f8d806f5179a85c26
@@ -200,23 +200,23 @@
 string(128) 
6e60597340640e621e25f975cef2b000b0c4c09a7af7d240a52d193002b0a8426fa7da7acc5b37ed9608016d4f396db834a0ea2f2c35f900461c9ac7e5604082
 string(128) 
e8c6a921e7d8eac2fd21d4df6054bb27a02321b2beb5b01b6f88c40706164e64d67ec97519bf76c8af8df896745478b78d42a0159f1a0db1671fd9d420dc
 string(10) tiger128,3
-string(32) a92be6c58be7688dc6cf9585a47aa625
-string(32) dc80d448032c9da9f1e0262985353c0f
+string(32) 8d68e78bc5e62ba925a67aa48595cfc6
+string(32) a99d2c0348d480dc0f3c35852926e0f1
 string(10) tiger160,3
-string(40) a92be6c58be7688dc6cf9585a47aa62535fc2482
-string(40) dc80d448032c9da9f1e0262985353c0fe37e9551
+string(40) 8d68e78bc5e62ba925a67aa48595cfc62cd1e5e0
+string(40) a99d2c0348d480dc0f3c35852926e0f1e1825c16
 string(10) tiger192,3
-string(48) a92be6c58be7688dc6cf9585a47aa62535fc2482e0e5d12c
-string(48) dc80d448032c9da9f1e0262985353c0fe37e9551165c82e1
+string(48) 8d68e78bc5e62ba925a67aa48595cfc62cd1e5e08224fc35
+string(48) a99d2c0348d480dc0f3c35852926e0f1e1825c1651957ee3
 string(10) tiger128,4
-string(32) 32fb748ef5a36ca222511bcb99b044ee
-string(32) e5c4212432c0e266e581d4ee6a8e20a9
+string(32) a26ca3f58e74fb32ee44b099cb1b5122
+string(32) 66e2c0322421c4e5a9208e6aeed481e5
 string(10) tiger160,4
-string(40) 32fb748ef5a36ca222511bcb99b044ee1d740bf3
-string(40) e5c4212432c0e266e581d4ee6a8e20a9d0d944e3
+string(40) a26ca3f58e74fb32ee44b099cb1b512203375900
+string(40) 66e2c0322421c4e5a9208e6aeed481e5c4b00448
 string(10) tiger192,4
-string(48) 32fb748ef5a36ca222511bcb99b044ee1d740bf300593703
-string(48) e5c4212432c0e266e581d4ee6a8e20a9d0d944e34804b0c4
+string(48) a26ca3f58e74fb32ee44b099cb1b512203375900f30b741d
+string(48) 66e2c0322421c4e5a9208e6aeed481e5c4b00448e344d9d0
 string(6) snefru
 string(64) fbe88daa74c89b9e29468fa3cd3a657d31845e21bb58dd3f8d806f5179a85c26
 string(64) 614ca924864fa0e8fa309aa0944e047d5edbfd4964a35858f4d8ec66a0fb88b0

Modified: php/php-src/trunk/ext/hash/tests/hash_file_basic1.phpt
===
--- php/php-src/trunk/ext/hash/tests/hash_file_basic1.phpt  2012-01-17 
16:48:19 UTC (rev 322422)
+++ php/php-src/trunk/ext/hash/tests/hash_file_basic1.phpt  2012-01-17 
17:21:32 UTC (rev 322423)
@@ -77,7 +77,7 @@
 sha384: 
a35d875ed96d94b6452acad910f97978200faa2398d8a0e6b9cffa33704c3809e3d2e5b0d63700d8f32a0716e7d2d528
 

[PHP-CVS] svn: /php/php-src/trunk/ NEWS Zend/tests/bug60573.phpt Zend/zend_compile.c

2012-01-16 Thread Xinchen Hui
laruence Mon, 16 Jan 2012 09:53:45 +

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

Log:
Fixed Bug #60573 (type hinting with self keyword causes weird errors)

Bug: https://bugs.php.net/60573 (error getting bug information)
  
Changed paths:
U   php/php-src/trunk/NEWS
A   php/php-src/trunk/Zend/tests/bug60573.phpt
U   php/php-src/trunk/Zend/zend_compile.c

Modified: php/php-src/trunk/NEWS
===
--- php/php-src/trunk/NEWS  2012-01-16 09:33:06 UTC (rev 322359)
+++ php/php-src/trunk/NEWS  2012-01-16 09:53:45 UTC (rev 322360)
@@ -5,6 +5,10 @@
 - General improvements:
   . World domination

+- Core
+  . Fixed bug #60573 (type hinting with self keyword causes weird errors).
+(Laruence)
+
 - cURL:
   . Added support for CURLOPT_FTP_RESPONSE_TIMEOUT, CURLOPT_APPEND,
 CURLOPT_DIRLISTONLY, CURLOPT_NEW_DIRECTORY_PERMS, CURLOPT_NEW_FILE_PERMS,

Added: php/php-src/trunk/Zend/tests/bug60573.phpt
===
--- php/php-src/trunk/Zend/tests/bug60573.phpt  (rev 0)
+++ php/php-src/trunk/Zend/tests/bug60573.phpt  2012-01-16 09:53:45 UTC (rev 
322360)
@@ -0,0 +1,84 @@
+--TEST--
+Bug #60573 (type hinting with self keyword causes weird errors)
+--FILE--
+?php
+class Foo1 {
+
+public function setSelf(self $s) { }
+
+}
+
+class Bar1 extends Foo1 {
+
+public function setSelf(parent $s) { }
+
+}
+
+class Foo2 {
+
+public function setSelf(Foo2 $s) { }
+
+}
+
+class Bar2 extends Foo2 {
+
+public function setSelf(parent $s) { }
+
+}
+
+class Base {
+}
+
+class Foo3 extends Base{
+
+public function setSelf(parent $s) { }
+
+}
+
+class Bar3 extends Foo3 {
+
+public function setSelf(Base $s) { }
+
+}
+
+class Foo4 {
+
+public function setSelf(self $s) { }
+
+}
+
+class Bar4 extends Foo4 {
+
+public function setSelf(self $s) { }
+
+}
+
+class Foo5 extends Base {
+
+public function setSelf(parent $s) { }
+
+}
+
+class Bar5 extends Foo5 {
+
+public function setSelf(parent $s) { }
+
+}
+
+abstract class Foo6 extends Base {
+
+abstract public function setSelf(parent $s);
+
+}
+
+class Bar6 extends Foo6 {
+
+public function setSelf(Foo6 $s) { }
+
+}
+--EXPECTF--
+Strict Standards: Declaration of Bar4::setSelf() should be compatible with 
Foo4::setSelf(Foo4 $s) in %sbug60573.php on line %d
+
+Strict Standards: Declaration of Bar5::setSelf() should be compatible with 
Foo5::setSelf(Base $s) in %sbug60573.php on line %d
+
+Fatal error: Declaration of Bar6::setSelf() must be compatible with 
Foo6::setSelf(Base $s) in %sbug60573.php on line %d


Property changes on: php/php-src/trunk/Zend/tests/bug60573.phpt
___
Added: svn:executable
   + *

Modified: php/php-src/trunk/Zend/zend_compile.c
===
--- php/php-src/trunk/Zend/zend_compile.c   2012-01-16 09:33:06 UTC (rev 
322359)
+++ php/php-src/trunk/Zend/zend_compile.c   2012-01-16 09:53:45 UTC (rev 
322360)
@@ -2958,30 +2958,57 @@
/* Only one has a type hint and the other one doesn't */
return 0;
}
-   if (fe-common.arg_info[i].class_name
-strcasecmp(fe-common.arg_info[i].class_name, 
proto-common.arg_info[i].class_name)!=0) {
-   const char *colon;

-   if (fe-common.type != ZEND_USER_FUNCTION) {
-   return 0;
-   } else if (strchr(proto-common.arg_info[i].class_name, 
'\\') != NULL ||
-   (colon = 
zend_memrchr(fe-common.arg_info[i].class_name, '\\', 
fe-common.arg_info[i].class_name_len)) == NULL ||
-   strcasecmp(colon+1, 
proto-common.arg_info[i].class_name) != 0) {
-   zend_class_entry **fe_ce, **proto_ce;
-   int found, found2;
-
-   found = 
zend_lookup_class(fe-common.arg_info[i].class_name, 
fe-common.arg_info[i].class_name_len, fe_ce TSRMLS_CC);
-   found2 = 
zend_lookup_class(proto-common.arg_info[i].class_name, 
proto-common.arg_info[i].class_name_len, proto_ce TSRMLS_CC);
-
-   /* Check for class alias */
-   if (found != SUCCESS || found2 != SUCCESS ||
-   (*fe_ce)-type == ZEND_INTERNAL_CLASS ||
-   (*proto_ce)-type == 
ZEND_INTERNAL_CLASS ||
-   *fe_ce != *proto_ce) {
+   if (fe-common.arg_info[i].class_name) {
+   const char *fe_class_name, *proto_class_name;
+   zend_uint fe_class_name_len, proto_class_name_len;
+
+   if 

[PHP-CVS] svn: /php/php-src/trunk/ NEWS

2012-01-16 Thread Xinchen Hui
laruence Mon, 16 Jan 2012 10:20:18 +

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

Log:
typo

Changed paths:
U   php/php-src/trunk/NEWS

Modified: php/php-src/trunk/NEWS
===
--- php/php-src/trunk/NEWS  2012-01-16 10:12:47 UTC (rev 322361)
+++ php/php-src/trunk/NEWS  2012-01-16 10:20:18 UTC (rev 322362)
@@ -5,7 +5,7 @@
 - General improvements:
   . World domination

-- Core
+- Core:
   . Fixed bug #60573 (type hinting with self keyword causes weird errors).
 (Laruence)


-- 
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/snmp/ snmp.c tests/bug60749.phpt tests/ipv6.phpt

2012-01-13 Thread Boris Lytochkin
lytboris Fri, 13 Jan 2012 18:34:21 +

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

Log:
Fixed bug #60585 (php build fails with USE flag snmp when IPv6 support is 
disabled)
Fixed bug #60749 (SNMP module should not strip non-standard SNMP port from 
hostname)
Fixed ipv6 test skipto if IPv6 support is disabled

Bugs: https://bugs.php.net/60585 (Assigned) php build fails with USE flag snmp 
when IPv6 support is disabled
  https://bugs.php.net/60749 (Assigned) SNMP module should not strip 
non-standard SNMP port from hostname
  
Changed paths:
U   php/php-src/trunk/ext/snmp/snmp.c
A   php/php-src/trunk/ext/snmp/tests/bug60749.phpt
U   php/php-src/trunk/ext/snmp/tests/ipv6.phpt

Modified: php/php-src/trunk/ext/snmp/snmp.c
===
--- php/php-src/trunk/ext/snmp/snmp.c   2012-01-13 17:15:19 UTC (rev 322212)
+++ php/php-src/trunk/ext/snmp/snmp.c   2012-01-13 18:34:21 UTC (rev 322213)
@@ -1186,11 +1186,11 @@
continue;
}
 #else
-   if (res-sa_family != AF_INET) {
+   if ((*res)-sa_family != AF_INET) {
res++;
continue;
}
-   strcat(pptr, inet_ntoa(res));
+   strcat(pptr, inet_ntoa(((struct 
sockaddr_in*)(*res))-sin_addr));
 #endif
break;
}
@@ -1203,6 +1203,12 @@
There should be check for non-empty session-peername!
*/

+   /* put back non-standard SNMP port */
+   if (session-remote_port != SNMP_PORT) {
+   pptr = session-peername + strlen(session-peername);
+   sprintf(pptr, :%d, session-remote_port);
+   }
+
php_network_freeaddresses(psal);

if (version == SNMP_VERSION_3) {

Added: php/php-src/trunk/ext/snmp/tests/bug60749.phpt
===
--- php/php-src/trunk/ext/snmp/tests/bug60749.phpt  
(rev 0)
+++ php/php-src/trunk/ext/snmp/tests/bug60749.phpt  2012-01-13 18:34:21 UTC 
(rev 322213)
@@ -0,0 +1,28 @@
+--TEST--
+Bug #60749: SNMP module should not strip non-standard SNMP port from hostname
+--CREDITS--
+Boris Lytochkin
+--SKIPIF--
+?php
+require_once(dirname(__FILE__).'/skipif.inc');
+?
+--FILE--
+?php
+require_once(dirname(__FILE__).'/snmp_include.inc');
+
+$hostname = php.net;
+$ip = gethostbyname($hostname);
+if (ip2long($ip) === FALSE) {
+   echo Could not resolve $hostname properly!\n;
+   exit(1);
+}
+$port = 1161;
+$session = new SNMP(SNMP::VERSION_1, $hostname:$port, $community, $timeout, 
$retries);
+$info = $session-info;
+if (strcmp($info[hostname], $ip:$port) !== 0) {
+   echo ' . $info[hostname] . ' != '$ip:$port'\n;
+}
+var_dump($session-close());
+?
+--EXPECTF--
+bool(true)

Modified: php/php-src/trunk/ext/snmp/tests/ipv6.phpt
===
--- php/php-src/trunk/ext/snmp/tests/ipv6.phpt  2012-01-13 17:15:19 UTC (rev 
322212)
+++ php/php-src/trunk/ext/snmp/tests/ipv6.phpt  2012-01-13 18:34:21 UTC (rev 
322213)
@@ -4,16 +4,17 @@
 Boris Lytochkin
 --SKIPIF--
 ?php
-   require_once(dirname(__FILE__).'/skipif.inc');
+require_once(dirname(__FILE__).'/skipif.inc');

-   if (!function_exists(inet_ntop)) die(skip no inet_ntop());
+$packed = str_repeat(chr(0), 15) . chr(1);
+if (@inet_ntop($packed) === false) {
+   die(skip no IPv6 support);
+}
 ?
 --FILE--
 ?php
 require_once(dirname(__FILE__).'/snmp_include.inc');

-$default_port = 161;
-
 //EXPECTF format is quickprint OFF
 snmp_set_quick_print(false);
 snmp_set_valueretrieval(SNMP_VALUE_PLAIN);

-- 
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/intl/ intl_error.c intl_error.h php_intl.c php_intl.h tests/ini_use_exceptions_basic.phpt

2012-01-08 Thread Gustavo André dos Santos Lopes
cataphract   Sun, 08 Jan 2012 18:41:53 +

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

Log:
- Added the ability for the intl exception to throw exceptions when a global 
error is set.

Changed paths:
U   php/php-src/trunk/ext/intl/intl_error.c
U   php/php-src/trunk/ext/intl/intl_error.h
U   php/php-src/trunk/ext/intl/php_intl.c
U   php/php-src/trunk/ext/intl/php_intl.h
A   php/php-src/trunk/ext/intl/tests/ini_use_exceptions_basic.phpt

Modified: php/php-src/trunk/ext/intl/intl_error.c
===
--- php/php-src/trunk/ext/intl/intl_error.c 2012-01-08 18:22:50 UTC (rev 
321935)
+++ php/php-src/trunk/ext/intl/intl_error.c 2012-01-08 18:41:53 UTC (rev 
321936)
@@ -21,12 +21,15 @@
 #endif

 #include php.h
+#include zend_exceptions.h

 #include php_intl.h
 #include intl_error.h

 ZEND_EXTERN_MODULE_GLOBALS( intl )

+static zend_class_entry *IntlException_ce_ptr;
+
 /* {{{ intl_error* intl_g_error_get()
  * Return global error structure.
  */
@@ -102,8 +105,11 @@
if( !msg )
return;

-   if(!err  INTL_G(error_level)) {
-   php_error_docref(NULL TSRMLS_CC, INTL_G(error_level), %s, 
msg);
+   if( !err ) {
+   if( INTL_G( error_level ) )
+   php_error_docref( NULL TSRMLS_CC, INTL_G( error_level 
), %s, msg );
+   if( INTL_G( use_exceptions ) )
+   zend_throw_exception_ex( IntlException_ce_ptr, 0 
TSRMLS_CC, %s, msg );
}
if( !err  !( err = intl_g_error_get( TSRMLS_C ) ) )
return;
@@ -223,6 +229,21 @@
 }
 /* }}} */

+void intl_register_IntlException_class( TSRMLS_D )
+{
+   zend_class_entry ce,
+*default_exception_ce;
+
+   default_exception_ce = zend_exception_get_default( TSRMLS_C );
+
+   /* Create and register 'IntlException' class. */
+   INIT_CLASS_ENTRY_EX( ce, IntlException, sizeof( IntlException ) - 
1, NULL );
+   IntlException_ce_ptr = zend_register_internal_class_ex( ce,
+   default_exception_ce, NULL TSRMLS_CC );
+   IntlException_ce_ptr-create_object = 
default_exception_ce-create_object;
+}
+/* }}} */
+
 /*
  * Local variables:
  * tab-width: 4

Modified: php/php-src/trunk/ext/intl/intl_error.h
===
--- php/php-src/trunk/ext/intl/intl_error.h 2012-01-08 18:22:50 UTC (rev 
321935)
+++ php/php-src/trunk/ext/intl/intl_error.h 2012-01-08 18:41:53 UTC (rev 
321936)
@@ -44,4 +44,7 @@
 voidintl_errors_set_code( intl_error* err, UErrorCode err_code 
TSRMLS_DC );
 voidintl_errors_set( intl_error* err, UErrorCode code, char* msg, int 
copyMsg TSRMLS_DC );

+// exported to be called on extension MINIT
+void   intl_register_IntlException_class( TSRMLS_D );
+
 #endif // INTL_ERROR_H

Modified: php/php-src/trunk/ext/intl/php_intl.c
===
--- php/php-src/trunk/ext/intl/php_intl.c   2012-01-08 18:22:50 UTC (rev 
321935)
+++ php/php-src/trunk/ext/intl/php_intl.c   2012-01-08 18:41:53 UTC (rev 
321936)
@@ -545,7 +545,7 @@
 PHP_INI_BEGIN()
 STD_PHP_INI_ENTRY(LOCALE_INI_NAME, NULL, PHP_INI_ALL, 
OnUpdateStringUnempty, default_locale, zend_intl_globals, intl_globals)
 STD_PHP_INI_ENTRY(intl.error_level, 0, PHP_INI_ALL, OnUpdateLong, 
error_level, zend_intl_globals, intl_globals)
-
+   STD_PHP_INI_ENTRY(intl.use_exceptions, 0, PHP_INI_ALL, 
OnUpdateBool, use_exceptions, zend_intl_globals, intl_globals)
 PHP_INI_END()
 /* }}} */

@@ -653,6 +653,10 @@
/* Expose Spoofchecker constants to PHP scripts */
spoofchecker_register_constants( INIT_FUNC_ARGS_PASSTHRU );
 #endif
+
+   /* Register 'IntlException' PHP class */
+   intl_register_IntlException_class( TSRMLS_C );
+
/* Global error handling. */
intl_error_init( NULL TSRMLS_CC );


Modified: php/php-src/trunk/ext/intl/php_intl.h
===
--- php/php-src/trunk/ext/intl/php_intl.h   2012-01-08 18:22:50 UTC (rev 
321935)
+++ php/php-src/trunk/ext/intl/php_intl.h   2012-01-08 18:41:53 UTC (rev 
321936)
@@ -46,6 +46,7 @@
UBreakIterator* grapheme_iterator;
intl_error g_error;
long error_level;
+   zend_bool use_exceptions;
 ZEND_END_MODULE_GLOBALS(intl)

 /* Macro to access request-wide global variables. */

Added: php/php-src/trunk/ext/intl/tests/ini_use_exceptions_basic.phpt
===
--- php/php-src/trunk/ext/intl/tests/ini_use_exceptions_basic.phpt  
(rev 0)
+++ php/php-src/trunk/ext/intl/tests/ini_use_exceptions_basic.phpt  
2012-01-08 18:41:53 UTC (rev 321936)
@@ -0,0 +1,21 @@
+--TEST--
+intl.use_exceptions INI setting
+--SKIPIF--
+?php 

[PHP-CVS] svn: /php/php-src/trunk/main/ php_variables.c

2012-01-06 Thread Patrick Allaert
patrickallaert   Fri, 06 Jan 2012 13:37:51 +

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

Log:
Changed: restoring REQUEST_TIME as a long, introducing REQUEST_TIME_FLOAT 
instead as discussed on the ML

Changed paths:
U   php/php-src/trunk/main/php_variables.c

Modified: php/php-src/trunk/main/php_variables.c
===
--- php/php-src/trunk/main/php_variables.c  2012-01-06 10:34:31 UTC (rev 
321826)
+++ php/php-src/trunk/main/php_variables.c  2012-01-06 13:37:51 UTC (rev 
321827)
@@ -581,10 +581,13 @@
}
/* store request init time */
{
-   zval new_entry;
-   Z_TYPE(new_entry) = IS_DOUBLE;
-   Z_DVAL(new_entry) = sapi_get_request_time(TSRMLS_C);
-   php_register_variable_ex(REQUEST_TIME, new_entry, array_ptr 
TSRMLS_CC);
+   zval request_time_float, request_time_long;
+   Z_TYPE(request_time_float) = IS_DOUBLE;
+   Z_DVAL(request_time_float) = sapi_get_request_time(TSRMLS_C);
+   php_register_variable_ex(REQUEST_TIME_FLOAT, 
request_time_float, array_ptr TSRMLS_CC);
+   Z_TYPE(request_time_long) = IS_LONG;
+   Z_LVAL(request_time_long) = 
zend_dval_to_lval(Z_DVAL(request_time_float));
+   php_register_variable_ex(REQUEST_TIME, request_time_long, 
array_ptr 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/ext/standard/tests/strings/ bug60675.phpt

2012-01-06 Thread Daniel Convissor
danielc  Fri, 06 Jan 2012 22:10:04 +

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

Log:
Test for bug 60675.

Bug: https://bugs.php.net/60675 (Open) htmlentities(ENT_COMPAT, windows-1251) 
for ISO-8859-1 encoded scripts
  
Changed paths:
A   php/php-src/trunk/ext/standard/tests/strings/bug60675.phpt

Added: php/php-src/trunk/ext/standard/tests/strings/bug60675.phpt
===
--- php/php-src/trunk/ext/standard/tests/strings/bug60675.phpt  
(rev 0)
+++ php/php-src/trunk/ext/standard/tests/strings/bug60675.phpt  2012-01-06 
22:10:04 UTC (rev 321841)
@@ -0,0 +1,24 @@
+--TEST--
+Bug 60675: htmlentities(ENT_COMPAT, windows-1251) for ISO-8859-1 encoded 
scripts
+--CREDITS--
+Daniel Convissor dani...@php.net
+--XFAIL--
+Bug 60675 exists
+--FILE--
+?php
+
+/*
+ * This script needs to be encoded in ISO-8859-1 for the test to work.
+ * Check the encoding with file -bi
+ * If the encoding is wrong, change it with:
+ *   mv bug60675.phpt bug60675.tmp
+ *   iconv -f output of file -bi -t ISO-8859-1 bug60675.tmp  bug60675.phpt
+ *   rm bug60675.tmp
+ */
+
+$in = '�';
+echo htmlentities($in, ENT_COMPAT, 'windows-1251');
+
+?
+--EXPECT--
+#1058;#1077;#1089;#1090;#1080;#1088;#1091;#1077;#1084;

-- 
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/pdo_firebird/ EXPERIMENTAL

2011-12-28 Thread Popa Adrian Marius
mariuz   Wed, 28 Dec 2011 09:31:18 +

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

Log:
remove experimental status for pdo_Firebird , see the general status 
http://www.firebirdnews.org/?p=6619

Changed paths:
D   php/php-src/trunk/ext/pdo_firebird/EXPERIMENTAL

Deleted: php/php-src/trunk/ext/pdo_firebird/EXPERIMENTAL
===
-- 
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/pdo_firebird/tests/ bug_48877.phpt

2011-12-27 Thread Popa Adrian Marius
mariuz   Tue, 27 Dec 2011 10:54:47 +

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

Log:
PDO_Firebird: bug 48877 test

Bug: https://bugs.php.net/48877 (Closed) bindValue and bindParam do not 
work for PDO Firebird
  
Changed paths:
A   php/php-src/trunk/ext/pdo_firebird/tests/bug_48877.phpt

Added: php/php-src/trunk/ext/pdo_firebird/tests/bug_48877.phpt
===
--- php/php-src/trunk/ext/pdo_firebird/tests/bug_48877.phpt 
(rev 0)
+++ php/php-src/trunk/ext/pdo_firebird/tests/bug_48877.phpt 2011-12-27 
10:54:47 UTC (rev 321433)
@@ -0,0 +1,42 @@
+--TEST--
+PDO_Firebird: bug 48877 test
+--SKIPIF--
+?php extension_loaded(pdo_firebird) or die(skip); ?
+--FILE--
+?php /* $Id: rowCount.phpt 316540 2011-09-12 13:41:28Z mariuz $ */
+
+require(testdb.inc);
+
+$dbh = new PDO(firebird:dbname=$test_base,$user,$password) or die;
+$value = '2';
+@$dbh-exec('DROP TABLE testz');
+$dbh-exec('CREATE TABLE testz (A integer)');
+$dbh-exec(INSERT INTO testz VALUES ('1'));
+$dbh-exec(INSERT INTO testz VALUES ('2'));
+$dbh-exec(INSERT INTO testz VALUES ('3'));
+$dbh-commit();
+
+$query = SELECT * FROM testz WHERE A = :paramno;
+
+$stmt = $dbh-prepare($query);
+$stmt-bindParam(':paramno', $value, PDO::PARAM_STR);
+$stmt-execute();
+$rows = $stmt-fetch();
+var_dump($stmt-fetch());
+var_dump($stmt-rowCount());
+
+
+$stmt = $dbh-prepare('DELETE FROM testz');
+$stmt-execute();
+
+$dbh-commit();
+
+$dbh-exec('DROP TABLE testz');
+
+unset($stmt);
+unset($dbh);
+
+?
+--EXPECT--
+bool(false)
+int(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/zlib/ zlib.c

2011-12-26 Thread Pierre Joye
pajoye   Tue, 27 Dec 2011 02:39:14 +

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

Log:
- fix bug 60326, fix crash introduce by the fix

Bug: https://bugs.php.net/60326 (Assigned) ob_gzhander() removed
  
Changed paths:
U   php/php-src/trunk/ext/zlib/zlib.c

Modified: php/php-src/trunk/ext/zlib/zlib.c
===
--- php/php-src/trunk/ext/zlib/zlib.c   2011-12-27 02:13:55 UTC (rev 321419)
+++ php/php-src/trunk/ext/zlib/zlib.c   2011-12-27 02:39:14 UTC (rev 321420)
@@ -938,7 +938,7 @@
REGISTER_LONG_CONSTANT(ZLIB_ENCODING_GZIP, PHP_ZLIB_ENCODING_GZIP, 
CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT(ZLIB_ENCODING_DEFLATE, 
PHP_ZLIB_ENCODING_DEFLATE, CONST_CS|CONST_PERSISTENT);
REGISTER_INI_ENTRIES();
-
+   ZLIBG(ob_gzhandler) = NULL;
return SUCCESS;
 }
 /* }}} */

-- 
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/curl/ interface.c multi.c

2011-12-23 Thread Pierrick Charron
pierrick Fri, 23 Dec 2011 21:01:05 +

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

Log:
Coding standards

Changed paths:
U   php/php-src/trunk/ext/curl/interface.c
U   php/php-src/trunk/ext/curl/multi.c

Modified: php/php-src/trunk/ext/curl/interface.c
===
--- php/php-src/trunk/ext/curl/interface.c  2011-12-23 19:52:57 UTC (rev 
321358)
+++ php/php-src/trunk/ext/curl/interface.c  2011-12-23 21:01:05 UTC (rev 
321359)
@@ -960,7 +960,7 @@
 #endif

 #if LIBCURL_VERSION_NUM = 0x071202 /* Available since 7.18.2 */
-REGISTER_CURL_CONSTANT(CURLINFO_REDIRECT_URL);
+   REGISTER_CURL_CONSTANT(CURLINFO_REDIRECT_URL);
 #endif

 #if LIBCURL_VERSION_NUM = 0x071300 /* Available since 7.19.0 */
@@ -1743,14 +1743,14 @@
char *split;

if(org) {
-do {
+   do {
char *key;
char *val;
char *tmp;

-split = strstr(s, ; );
-if(split)
-*split = '\0';
+   split = strstr(s, ; );
+   if(split)
+   *split = '\0';

key = s;
tmp = memchr(key, '=', 64);
@@ -2672,7 +2672,7 @@
case CURLOPT_SHARE:
{
php_curlsh *sh = NULL;
-   ZEND_FETCH_RESOURCE(sh, php_curlsh *, zvalue, -1, 
le_curl_share_handle_name, le_curl_share_handle);
+   ZEND_FETCH_RESOURCE(sh, php_curlsh *, zvalue, 
-1, le_curl_share_handle_name, le_curl_share_handle);
if (sh) {
curl_easy_setopt(ch-cp, CURLOPT_SHARE, 
sh-share);
}
@@ -3237,7 +3237,7 @@
if (ch-handlers-fnmatch) {
if (ch-handlers-fnmatch-func_name) {
zval_ptr_dtor(ch-handlers-fnmatch-func_name);
-   }
+   }
efree(ch-handlers-fnmatch);
ch-handlers-fnmatch = NULL;
}

Modified: php/php-src/trunk/ext/curl/multi.c
===
--- php/php-src/trunk/ext/curl/multi.c  2011-12-23 19:52:57 UTC (rev 321358)
+++ php/php-src/trunk/ext/curl/multi.c  2011-12-23 21:01:05 UTC (rev 321359)
@@ -125,8 +125,8 @@
 static int curl_compare_resources( zval *z1, zval **z2 ) /* {{{ */
 {
return (Z_TYPE_P( z1 ) == Z_TYPE_PP( z2 ) 
-Z_TYPE_P( z1 ) == IS_RESOURCE 
-Z_LVAL_P( z1 ) == Z_LVAL_PP( z2 ) );
+   Z_TYPE_P( z1 ) == IS_RESOURCE 
+   Z_LVAL_P( z1 ) == Z_LVAL_PP( z2 ) );
 }
 /* }}} */


-- 
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/tests/array/ arsort_variation5.phpt krsort_variation5.phpt ksort_variation5.phpt sort_variation5.phpt

2011-12-16 Thread Xinchen Hui
laruence Sat, 17 Dec 2011 04:21:14 +

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

Log:
fix tests

Changed paths:
U   php/php-src/trunk/ext/standard/tests/array/arsort_variation5.phpt
U   php/php-src/trunk/ext/standard/tests/array/krsort_variation5.phpt
U   php/php-src/trunk/ext/standard/tests/array/ksort_variation5.phpt
U   php/php-src/trunk/ext/standard/tests/array/sort_variation5.phpt

Modified: php/php-src/trunk/ext/standard/tests/array/arsort_variation5.phpt
===
--- php/php-src/trunk/ext/standard/tests/array/arsort_variation5.phpt   
2011-12-17 03:57:01 UTC (rev 321083)
+++ php/php-src/trunk/ext/standard/tests/array/arsort_variation5.phpt   
2011-12-17 04:21:14 UTC (rev 321084)
@@ -81,9 +81,9 @@
   string(2) \a
   []=
   string(1) 
-  [
+  [
 ]=
-  string(1) 
+  string(1) 
 
   []=
   string(1) 
@@ -113,9 +113,9 @@
   string(2) \a
   []=
   string(1) 
-  [
+  [
 ]=
-  string(1) 
+  string(1) 
 
   []=
   string(1) 
@@ -145,9 +145,9 @@
   string(2) \a
   []=
   string(1) 
-  [
+  [
 ]=
-  string(1) 
+  string(1) 
 
   []=
   string(1) 

Modified: php/php-src/trunk/ext/standard/tests/array/krsort_variation5.phpt
===
--- php/php-src/trunk/ext/standard/tests/array/krsort_variation5.phpt   
2011-12-17 03:57:01 UTC (rev 321083)
+++ php/php-src/trunk/ext/standard/tests/array/krsort_variation5.phpt   
2011-12-17 04:21:14 UTC (rev 321084)
@@ -81,9 +81,9 @@
   string(2) \a
   []=
   string(1) 
-  [
+  [
 ]=
-  string(1) 
+  string(1) 
 
   []=
   string(1) 
@@ -111,9 +111,9 @@
   string(2) \a
   []=
   string(1) 
-  [
+  [
 ]=
-  string(1) 
+  string(1) 
 
   []=
   string(1) 
@@ -141,9 +141,9 @@
   string(2) \a
   []=
   string(1) 
-  [
+  [
 ]=
-  string(1) 
+  string(1) 
 
   []=
   string(1) 

Modified: php/php-src/trunk/ext/standard/tests/array/ksort_variation5.phpt
===
--- php/php-src/trunk/ext/standard/tests/array/ksort_variation5.phpt
2011-12-17 03:57:01 UTC (rev 321083)
+++ php/php-src/trunk/ext/standard/tests/array/ksort_variation5.phpt
2011-12-17 04:21:14 UTC (rev 321084)
@@ -83,9 +83,9 @@
   string(1) 
   []=
   string(1) 
-  [
+  [
 ]=
-  string(1) 
+  string(1) 
 
   []=
   string(1) 
@@ -113,9 +113,9 @@
   string(1) 
   []=
   string(1) 
-  [
+  [
 ]=
-  string(1) 
+  string(1) 
 
   []=
   string(1) 
@@ -143,9 +143,9 @@
   string(1) 
   []=
   string(1) 
-  [
+  [
 ]=
-  string(1) 
+  string(1) 
 
   []=
   string(1) 

Modified: php/php-src/trunk/ext/standard/tests/array/sort_variation5.phpt
===
--- php/php-src/trunk/ext/standard/tests/array/sort_variation5.phpt 
2011-12-17 03:57:01 UTC (rev 321083)
+++ php/php-src/trunk/ext/standard/tests/array/sort_variation5.phpt 
2011-12-17 04:21:14 UTC (rev 321084)
@@ -79,7 +79,7 @@
   [5]=
   string(1) 
   [6]=
-  string(1) 
+  string(1) 
 
   [7]=
   string(1) 
@@ -109,7 +109,7 @@
   [5]=
   string(1) 
   [6]=
-  string(1) 
+  string(1) 
 
   [7]=
   string(1) 
@@ -139,7 +139,7 @@
   [5]=
   string(1) 
   [6]=
-  string(1) 
+  string(1) 
 
   [7]=
   string(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/mysqlnd/ mysqlnd_driver.c mysqlnd_priv.h

2011-12-14 Thread Andrey Hristov
andrey   Wed, 14 Dec 2011 16:28:13 +

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

Log:
add some PHPAPI

Changed paths:
U   php/php-src/trunk/ext/mysqlnd/mysqlnd_driver.c
U   php/php-src/trunk/ext/mysqlnd/mysqlnd_priv.h

Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_driver.c
===
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_driver.c  2011-12-14 16:27:52 UTC 
(rev 321016)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_driver.c  2011-12-14 16:28:13 UTC 
(rev 321017)
@@ -269,7 +269,7 @@


 /* {{{ mysqlnd_object_factory::get_protocol_decoder */
-PHPAPI MYSQLND_PROTOCOL *
+static MYSQLND_PROTOCOL *
 MYSQLND_METHOD(mysqlnd_object_factory, get_protocol_decoder)(zend_bool 
persistent TSRMLS_DC)
 {
size_t alloc_size = sizeof(MYSQLND_PROTOCOL) + mysqlnd_plugin_count() * 
sizeof(void *);
@@ -287,7 +287,7 @@
 /* }}} */


-MYSQLND_CLASS_METHODS_START(mysqlnd_object_factory)
+PHPAPI MYSQLND_CLASS_METHODS_START(mysqlnd_object_factory)
MYSQLND_METHOD(mysqlnd_object_factory, get_connection),
MYSQLND_METHOD(mysqlnd_object_factory, clone_connection_object),
MYSQLND_METHOD(mysqlnd_object_factory, get_prepared_statement),

Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_priv.h
===
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_priv.h2011-12-14 16:27:52 UTC 
(rev 321016)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_priv.h2011-12-14 16:28:13 UTC 
(rev 321017)
@@ -193,12 +193,12 @@
 PHPAPI extern const char * const mysqlnd_server_gone;
 PHPAPI extern const char * const mysqlnd_out_of_memory;

-extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_object_factory);
-extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_conn);
-extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_conn_data);
-extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_res);
-extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_protocol);
-extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_net);
+PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_object_factory);
+PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_conn);
+PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_conn_data);
+PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_res);
+PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_protocol);
+PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_net);

 enum_func_status mysqlnd_handle_local_infile(MYSQLND_CONN_DATA * conn, const 
char *filename, zend_bool *is_warning TSRMLS_DC);


-- 
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/curl/ config.m4 config.w32 interface.c

2011-12-13 Thread Pierrick Charron
pierrick Wed, 14 Dec 2011 03:45:44 +

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

Log:
Remove dead code
# curl_version_info was introduced in 7.10 and the PHP requirement is 7.10.5

Changed paths:
U   php/php-src/trunk/ext/curl/config.m4
U   php/php-src/trunk/ext/curl/config.w32
U   php/php-src/trunk/ext/curl/interface.c

Modified: php/php-src/trunk/ext/curl/config.m4
===
--- php/php-src/trunk/ext/curl/config.m42011-12-14 03:31:55 UTC (rev 
321000)
+++ php/php-src/trunk/ext/curl/config.m42011-12-14 03:45:44 UTC (rev 
321001)
@@ -131,13 +131,6 @@
 $CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR
   ])

-  PHP_CHECK_LIBRARY(curl,curl_version_info,
-  [
-AC_DEFINE(HAVE_CURL_VERSION_INFO,1,[ ])
-  ],[],[
-$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR
-  ])
-
   PHP_CHECK_LIBRARY(curl,curl_easy_strerror,
   [
 AC_DEFINE(HAVE_CURL_EASY_STRERROR,1,[ ])

Modified: php/php-src/trunk/ext/curl/config.w32
===
--- php/php-src/trunk/ext/curl/config.w32   2011-12-14 03:31:55 UTC (rev 
321000)
+++ php/php-src/trunk/ext/curl/config.w32   2011-12-14 03:45:44 UTC (rev 
321001)
@@ -18,7 +18,6 @@
AC_DEFINE('HAVE_CURL_SSL', 1, 'Have SSL suppurt in cURL');
AC_DEFINE('HAVE_CURL_EASY_STRERROR', 1, 'Have 
curl_easy_strerror in cURL');
AC_DEFINE('HAVE_CURL_MULTI_STRERROR', 1, 'Have 
curl_multi_strerror in cURL');
-   AC_DEFINE('HAVE_CURL_VERSION_INFO', 1, 'Have curl_version_info 
in cURL');
ADD_FLAG(CFLAGS_CURL, /D CURL_STATICLIB);
// TODO: check for curl_version_info
// AC_DEFINE('PHP_CURL_URL_WRAPPERS', 0, 'Use curl for URL 
wrappers [experimental]');

Modified: php/php-src/trunk/ext/curl/interface.c
===
--- php/php-src/trunk/ext/curl/interface.c  2011-12-14 03:31:55 UTC (rev 
321000)
+++ php/php-src/trunk/ext/curl/interface.c  2011-12-14 03:45:44 UTC (rev 
321001)
@@ -1141,7 +1141,6 @@
}

 #ifdef PHP_CURL_URL_WRAPPERS
-# if HAVE_CURL_VERSION_INFO
{
curl_version_info_data *info = 
curl_version_info(CURLVERSION_NOW);
char **p = (char **)info-protocols;
@@ -1155,18 +1154,6 @@
(void) *p++;
}
}
-# else
-   php_unregister_url_stream_wrapper(http);
-   php_register_url_stream_wrapper(http, php_curl_wrapper TSRMLS_CC);
-   php_unregister_url_stream_wrapper(https);
-   php_register_url_stream_wrapper(https, php_curl_wrapper TSRMLS_CC);
-   php_unregister_url_stream_wrapper(ftp);
-   php_register_url_stream_wrapper(ftp, php_curl_wrapper TSRMLS_CC);
-   php_unregister_url_stream_wrapper(ftps);
-   php_register_url_stream_wrapper(ftps, php_curl_wrapper TSRMLS_CC);
-   php_unregister_url_stream_wrapper(ldap);
-   php_register_url_stream_wrapper(ldap, php_curl_wrapper TSRMLS_CC);
-# endif
 #endif

return SUCCESS;

-- 
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/curl/ interface.c

2011-12-13 Thread Pierrick Charron
pierrick Wed, 14 Dec 2011 04:02:56 +

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

Log:
Unregister appropriate curl wrappers

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

Modified: php/php-src/trunk/ext/curl/interface.c
===
--- php/php-src/trunk/ext/curl/interface.c  2011-12-14 03:45:44 UTC (rev 
321001)
+++ php/php-src/trunk/ext/curl/interface.c  2011-12-14 04:02:56 UTC (rev 
321002)
@@ -1165,10 +1165,18 @@
 PHP_MSHUTDOWN_FUNCTION(curl)
 {
 #ifdef PHP_CURL_URL_WRAPPERS
-   php_unregister_url_stream_wrapper(http TSRMLS_CC);
-   php_unregister_url_stream_wrapper(https TSRMLS_CC);
-   php_unregister_url_stream_wrapper(ftp TSRMLS_CC);
-   php_unregister_url_stream_wrapper(ldap TSRMLS_CC);
+   {
+   curl_version_info_data *info = 
curl_version_info(CURLVERSION_NOW);
+   char **p = (char **)info-protocols;
+
+   while (*p != NULL) {
+   /* Do not enable cURL file protocol and make sure 
cURL is always used when --with-curlwrappers is enabled */
+   if (strncasecmp(*p, file, sizeof(file)-1) != 0) {
+   php_unregister_url_stream_wrapper(*p TSRMLS_CC);
+   }
+   (void) *p++;
+   }
+   }
 #endif
curl_global_cleanup();
 #ifdef PHP_CURL_NEED_OPENSSL_TSL

-- 
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/pdo_firebird/ firebird_driver.c

2011-12-10 Thread Popa Adrian Marius
mariuz   Sat, 10 Dec 2011 22:08:39 +

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

Log:
bug fixed #48877 - bindValue and bindParam do not work for PDO Firebird

Bug: https://bugs.php.net/48877 (Assigned) bindValue and bindParam do not 
work for PDO Firebird
  
Changed paths:
U   php/php-src/trunk/ext/pdo_firebird/firebird_driver.c

Modified: php/php-src/trunk/ext/pdo_firebird/firebird_driver.c
===
--- php/php-src/trunk/ext/pdo_firebird/firebird_driver.c2011-12-10 
22:04:23 UTC (rev 320854)
+++ php/php-src/trunk/ext/pdo_firebird/firebird_driver.c2011-12-10 
22:08:39 UTC (rev 320855)
@@ -433,6 +433,7 @@
case ':':
in_param = 1;
ppname = pname;
+   *ppname++ = sql[l];
case '?':
*c++ = '?';
++pindex;

-- 
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/ spl/tests/spl_autoload_call_basic.phpt standard/tests/streams/stream_context_set_option_basic.phpt standard/tests/streams/stream_context_set_option_error_001.php

2011-12-09 Thread Patrick Allaert
patrickallaert   Fri, 09 Dec 2011 11:15:12 +

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

Log:
Added tests contributions on spl_autoload and stream_context_set_option()

Thank you Jean-Marc Fontaine and Alter Way

Changed paths:
A   php/php-src/trunk/ext/spl/tests/spl_autoload_call_basic.phpt
A   
php/php-src/trunk/ext/standard/tests/streams/stream_context_set_option_basic.phpt
A   
php/php-src/trunk/ext/standard/tests/streams/stream_context_set_option_error_001.phpt
A   
php/php-src/trunk/ext/standard/tests/streams/stream_context_set_option_error_002.phpt

Added: php/php-src/trunk/ext/spl/tests/spl_autoload_call_basic.phpt
===
--- php/php-src/trunk/ext/spl/tests/spl_autoload_call_basic.phpt
(rev 0)
+++ php/php-src/trunk/ext/spl/tests/spl_autoload_call_basic.phpt
2011-12-09 11:15:12 UTC (rev 320771)
@@ -0,0 +1,18 @@
+--TEST--
+spl_autoload_call() function - basic test for spl_autoload_call()
+--CREDITS--
+Jean-Marc Fontaine jean-marc.fonta...@alterway.fr
+# Alter Way Contribution Day 2011
+--FILE--
+?php
+function customAutolader($class) {
+require_once __DIR__ . '/testclass.class.inc';
+}
+spl_autoload_register('customAutolader');
+
+spl_autoload_call('TestClass');
+var_dump(class_exists('TestClass', false));
+?
+--EXPECTF--
+%stestclass.class.inc
+bool(true)

Added: 
php/php-src/trunk/ext/standard/tests/streams/stream_context_set_option_basic.phpt
===
--- 
php/php-src/trunk/ext/standard/tests/streams/stream_context_set_option_basic.phpt
   (rev 0)
+++ 
php/php-src/trunk/ext/standard/tests/streams/stream_context_set_option_basic.phpt
   2011-12-09 11:15:12 UTC (rev 320771)
@@ -0,0 +1,37 @@
+--TEST--
+stream_context_set_option() function - basic test for 
stream_context_set_option()
+--CREDITS--
+Jean-Marc Fontaine jean-marc.fonta...@alterway.fr
+# Alter Way Contribution Day 2011
+--FILE--
+?php
+$context = stream_context_create();
+
+// Single option
+var_dump(stream_context_set_option($context, 'http', 'method', 'POST'));
+
+// Array of options
+$options = array(
+'http' = array(
+'protocol_version' = 1.1,
+'user_agent'   = 'PHPT Agent',
+),
+);
+var_dump(stream_context_set_option($context, $options));
+
+var_dump(stream_context_get_options($context));
+?
+--EXPECT--
+bool(true)
+bool(true)
+array(1) {
+  [http]=
+  array(3) {
+[method]=
+string(4) POST
+[protocol_version]=
+float(1.1)
+[user_agent]=
+string(10) PHPT Agent
+  }
+}

Added: 
php/php-src/trunk/ext/standard/tests/streams/stream_context_set_option_error_001.phpt
===
--- 
php/php-src/trunk/ext/standard/tests/streams/stream_context_set_option_error_001.phpt
   (rev 0)
+++ 
php/php-src/trunk/ext/standard/tests/streams/stream_context_set_option_error_001.phpt
   2011-12-09 11:15:12 UTC (rev 320771)
@@ -0,0 +1,21 @@
+--TEST--
+stream_context_set_option() function - error : invalid argument
+--CREDITS--
+Jean-Marc Fontaine jean-marc.fonta...@alterway.fr
+# Alter Way Contribution Day 2011
+--FILE--
+?php
+$context = stream_context_create();
+
+// Single option
+var_dump(stream_context_set_option($context, 'http'));
+
+// Array of options
+var_dump(stream_context_set_option($context, array(), 'foo', 'bar'));
+?
+--EXPECTF--
+Warning: stream_context_set_option(): called with wrong number or type of 
parameters; please RTM in %s on line %d
+bool(false)
+
+Warning: stream_context_set_option(): called with wrong number or type of 
parameters; please RTM in %s on line %d
+bool(false)

Added: 
php/php-src/trunk/ext/standard/tests/streams/stream_context_set_option_error_002.phpt
===
--- 
php/php-src/trunk/ext/standard/tests/streams/stream_context_set_option_error_002.phpt
   (rev 0)
+++ 
php/php-src/trunk/ext/standard/tests/streams/stream_context_set_option_error_002.phpt
   2011-12-09 11:15:12 UTC (rev 320771)
@@ -0,0 +1,18 @@
+--TEST--
+stream_context_set_option() function - error : missing argument
+--CREDITS--
+Jean-Marc Fontaine jean-marc.fonta...@alterway.fr
+# Alter Way Contribution Day 2011
+--FILE--
+?php
+var_dump(stream_context_set_option());
+
+$context = stream_context_create();
+var_dump(stream_context_set_option($context));
+?
+--EXPECTF--
+Warning: stream_context_set_option(): called with wrong number or type of 
parameters; please RTM in %s on line %d
+bool(false)
+
+Warning: stream_context_set_option(): called with wrong number or type of 
parameters; please RTM in %s on line %d
+bool(false)

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

[PHP-CVS] svn: /php/php-src/trunk/main/ php_ini.c

2011-12-07 Thread Xinchen Hui
laruence Wed, 07 Dec 2011 10:28:56 +

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

Log:
Merge -r317306 to trunk

Changed paths:
U   php/php-src/trunk/main/php_ini.c

Modified: php/php-src/trunk/main/php_ini.c
===
--- php/php-src/trunk/main/php_ini.c2011-12-07 10:09:33 UTC (rev 320565)
+++ php/php-src/trunk/main/php_ini.c2011-12-07 10:28:56 UTC (rev 320566)
@@ -421,7 +421,11 @@
env_location = ;
} else {
size = GetEnvironmentVariableA(PHPRC, 
phprc_path, size);
-   env_location = phprc_path;
+   if (size == 0) {
+   env_location = ;
+   } else {
+   env_location = phprc_path;
+   }
}
}
}

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

2011-12-06 Thread Pierre Joye
pajoye   Tue, 06 Dec 2011 13:06:22 +

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

Log:
- force LF as EOL as the code expects it.
  however it sounds like a bug in the implementation
phar.c:720
if (4 != php_stream_read(fp, buffer, 4)) {
MAPPHAR_ALLOC_FAIL(internal corruption of phar \%s\ 
(truncated manifest at manifest length))
}

that code will fail if non LF eol are used. Or does phar supports only LF?

Changed paths:
_U  php/php-src/trunk/ext/phar/tests/005.phpt


Property changes on: php/php-src/trunk/ext/phar/tests/005.phpt
___
Modified: svn:eol-style
   - native
   + LF

-- 
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/curl/ interface.c

2011-12-06 Thread Pierre Joye
pajoye   Tue, 06 Dec 2011 15:35:07 +

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

Log:
- fix build, CURLOPT_FNMATCH_DATA exists since 7.21.0 only

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

Modified: php/php-src/trunk/ext/curl/interface.c
===
--- php/php-src/trunk/ext/curl/interface.c  2011-12-06 14:15:27 UTC (rev 
320508)
+++ php/php-src/trunk/ext/curl/interface.c  2011-12-06 15:35:07 UTC (rev 
320509)
@@ -1982,7 +1982,9 @@
dupch-handlers-fnmatch-func_name = 
ch-handlers-fnmatch-func_name;
}
dupch-handlers-fnmatch-method = 
ch-handlers-fnmatch-method;
+#if LIBCURL_VERSION_NUM = 0x071500 /* Available since 7.21.0 */
curl_easy_setopt(dupch-cp, CURLOPT_FNMATCH_DATA, (void *) 
dupch);
+#endif
}

efree(dupch-to_free);

-- 
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/curl/ interface.c

2011-12-06 Thread Pierre Joye
pajoye   Tue, 06 Dec 2011 15:57:43 +

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

Log:
- fix build, CURLOPT_FNMATCH_DATA exists since 7.21.0 only

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

Modified: php/php-src/trunk/ext/curl/interface.c
===
--- php/php-src/trunk/ext/curl/interface.c  2011-12-06 15:35:07 UTC (rev 
320509)
+++ php/php-src/trunk/ext/curl/interface.c  2011-12-06 15:57:43 UTC (rev 
320510)
@@ -1975,6 +1975,8 @@
curl_easy_setopt(dupch-cp, CURLOPT_PROGRESSDATA, (void *) 
dupch);
}

+/* Available since 7.21.0 */
+#if LIBCURL_VERSION_NUM = 0x071500
if (ch-handlers-fnmatch) {
dupch-handlers-fnmatch = ecalloc(1, sizeof(php_curl_fnmatch));
if (ch-handlers-fnmatch-func_name) {
@@ -1982,7 +1984,6 @@
dupch-handlers-fnmatch-func_name = 
ch-handlers-fnmatch-func_name;
}
dupch-handlers-fnmatch-method = 
ch-handlers-fnmatch-method;
-#if LIBCURL_VERSION_NUM = 0x071500 /* Available since 7.21.0 */
curl_easy_setopt(dupch-cp, CURLOPT_FNMATCH_DATA, (void *) 
dupch);
 #endif
}

-- 
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/curl/ interface.c

2011-12-06 Thread Pierre Joye
pajoye   Tue, 06 Dec 2011 16:09:06 +

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

Log:
- fix the fix, wrong endif pos

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

Modified: php/php-src/trunk/ext/curl/interface.c
===
--- php/php-src/trunk/ext/curl/interface.c  2011-12-06 15:57:43 UTC (rev 
320510)
+++ php/php-src/trunk/ext/curl/interface.c  2011-12-06 16:09:06 UTC (rev 
320511)
@@ -1985,8 +1985,8 @@
}
dupch-handlers-fnmatch-method = 
ch-handlers-fnmatch-method;
curl_easy_setopt(dupch-cp, CURLOPT_FNMATCH_DATA, (void *) 
dupch);
+   }
 #endif
-   }

efree(dupch-to_free);
dupch-to_free = ch-to_free;

-- 
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/curl/ interface.c

2011-12-05 Thread Pierrick Charron
pierrick Mon, 05 Dec 2011 22:23:19 +

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

Log:
We should free the memory of any curl_slist returned by curl_easy_getinfo

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

Modified: php/php-src/trunk/ext/curl/interface.c
===
--- php/php-src/trunk/ext/curl/interface.c  2011-12-05 21:55:40 UTC (rev 
320465)
+++ php/php-src/trunk/ext/curl/interface.c  2011-12-05 22:23:19 UTC (rev 
320466)
@@ -3031,6 +3031,7 @@

add_next_index_string(return_value, slist-data, 1);
slist = 
slist-next;
}
+   
curl_slist_free_all(slist);
} else {
RETURN_FALSE;
}

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

2011-12-03 Thread Pierrick Charron
pierrick Sat, 03 Dec 2011 20:14:06 +

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

Log:
Fix test for libcurl  7.12.1

Changed paths:
U   php/php-src/trunk/ext/curl/tests/curl_reset.phpt

Modified: php/php-src/trunk/ext/curl/tests/curl_reset.phpt
===
--- php/php-src/trunk/ext/curl/tests/curl_reset.phpt2011-12-03 19:41:28 UTC 
(rev 320312)
+++ php/php-src/trunk/ext/curl/tests/curl_reset.phpt2011-12-03 20:14:06 UTC 
(rev 320313)
@@ -1,7 +1,9 @@
 --TEST--
 Test curl_reset
 --SKIPIF--
-?php if (!extension_loaded(curl)) print skip; ?
+?php if (!extension_loaded(curl)) print skip;
+if (!function_exists(curl_reset)) exit(skip curl_reset doesn't exists 
(require libcurl = 7.12.1));
+?
 --FILE--
 ?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/curl/ interface.c

2011-12-03 Thread Pierrick Charron
pierrick Sat, 03 Dec 2011 20:16:32 +

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

Log:
Clean curl_getinfo and add new constants from newer libcurl versions

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

Modified: php/php-src/trunk/ext/curl/interface.c
===
--- php/php-src/trunk/ext/curl/interface.c	2011-12-03 20:14:06 UTC (rev 320313)
+++ php/php-src/trunk/ext/curl/interface.c	2011-12-03 20:16:32 UTC (rev 320314)
@@ -832,7 +832,8 @@
 	REGISTER_CURL_CONSTANT(CURLAUTH_NTLM);
 #endif

-#if LIBCURL_VERSION_NUM = 0x070a07 /* Available since 7.10.7 */
+#if LIBCURL_VERSION_NUM = 0x070a07 /* Available since 7.10.7 */
+	REGISTER_CURL_CONSTANT(CURLINFO_HTTP_CONNECTCODE);
 	REGISTER_CURL_CONSTANT(CURLOPT_FTP_CREATE_MISSING_DIRS);
 	REGISTER_CURL_CONSTANT(CURLOPT_PROXYAUTH);
 #endif
@@ -840,7 +841,9 @@
 #if LIBCURL_VERSION_NUM = 0x070a08 /* Available since 7.10.8 */
 	REGISTER_CURL_CONSTANT(CURLE_FILESIZE_EXCEEDED);
 	REGISTER_CURL_CONSTANT(CURLE_LDAP_INVALID_URL);
+	REGISTER_CURL_CONSTANT(CURLINFO_HTTPAUTH_AVAIL);
 	REGISTER_CURL_CONSTANT(CURLINFO_RESPONSE_CODE);
+	REGISTER_CURL_CONSTANT(CURLINFO_PROXYAUTH_AVAIL);
 	REGISTER_CURL_CONSTANT(CURLOPT_FTP_RESPONSE_TIMEOUT);
 	REGISTER_CURL_CONSTANT(CURLOPT_IPRESOLVE);
 	REGISTER_CURL_CONSTANT(CURLOPT_MAXFILESIZE);
@@ -874,7 +877,17 @@
 	REGISTER_CURL_CONSTANT(CURLOPT_TCP_NODELAY);
 #endif

+#if LIBCURL_VERSION_NUM = 0x070c02 /* Available since 7.12.2 */
+	REGISTER_CURL_CONSTANT(CURLINFO_OS_ERRNO);
+#endif
+
+#if LIBCURL_VERSION_NUM = 0x070c03 /* Available since 7.12.3 */
+	REGISTER_CURL_CONSTANT(CURLINFO_NUM_CONNECTS);
+	REGISTER_CURL_CONSTANT(CURLINFO_SSL_ENGINES);
+#endif
+
 #if LIBCURL_VERSION_NUM = 0x070e01 /* Available since 7.14.1 */
+	REGISTER_CURL_CONSTANT(CURLINFO_COOKIELIST);
 	REGISTER_CURL_CONSTANT(CURLOPT_COOKIELIST);
 	REGISTER_CURL_CONSTANT(CURLOPT_IGNORE_CONTENT_LENGTH);
 #endif
@@ -899,6 +912,10 @@
 	REGISTER_CURL_CONSTANT(CURLFTPMETHOD_SINGLECWD);
 #endif

+#if LIBCURL_VERSION_NUM - 0x070f04 /* Available since 7.15.4 */
+	REGISTER_CURL_CONSTANT(CURLINFO_FTP_ENTRY_PATH);
+#endif
+
 #if LIBCURL_VERSION_NUM = 0x070f05 /* Available since 7.15.5 */
 	REGISTER_CURL_CONSTANT(CURLOPT_FTP_ALTERNATIVE_TO_USER);
 	REGISTER_CURL_CONSTANT(CURLOPT_MAX_RECV_SPEED_LARGE);
@@ -950,15 +967,18 @@

 #if LIBCURL_VERSION_NUM = 0x071300 /* Available since 7.19.0 */
 	REGISTER_CURL_CONSTANT(CURLE_SSH);
+	REGISTER_CURL_CONSTANT(CURLINFO_APPCONNECT_TIME);
+	REGISTER_CURL_CONSTANT(CURLINFO_PRIMARY_IP);
+
 	REGISTER_CURL_CONSTANT(CURLOPT_ADDRESS_SCOPE);
 	REGISTER_CURL_CONSTANT(CURLOPT_CRLFILE);
 	REGISTER_CURL_CONSTANT(CURLOPT_ISSUERCERT);
 	REGISTER_CURL_CONSTANT(CURLOPT_KEYPASSWD);
+	REGISTER_CURL_CONSTANT(CURLOPT_SSH_AUTH_TYPES);
 	REGISTER_CURL_CONSTANT(CURLOPT_SSH_HOST_PUBLIC_KEY_MD5);
 	REGISTER_CURL_CONSTANT(CURLOPT_SSH_PRIVATE_KEYFILE);
 	REGISTER_CURL_CONSTANT(CURLOPT_SSH_PUBLIC_KEYFILE);

-	REGISTER_CURL_CONSTANT(CURLOPT_SSH_AUTH_TYPES);
 	REGISTER_CURL_CONSTANT(CURLSSH_AUTH_ANY);
 	REGISTER_CURL_CONSTANT(CURLSSH_AUTH_DEFAULT);
 	REGISTER_CURL_CONSTANT(CURLSSH_AUTH_HOST);
@@ -983,12 +1003,15 @@
 #endif

 #if LIBCURL_VERSION_NUM = 0x071304 /* Available since 7.19.4 */
+	REGISTER_CURL_CONSTANT(CURLINFO_CONDITION_UNMET);
+
 	REGISTER_CURL_CONSTANT(CURLOPT_NOPROXY);
 	REGISTER_CURL_CONSTANT(CURLOPT_PROTOCOLS);
 	REGISTER_CURL_CONSTANT(CURLOPT_REDIR_PROTOCOLS);
 	REGISTER_CURL_CONSTANT(CURLOPT_SOCKS5_GSSAPI_NEC);
 	REGISTER_CURL_CONSTANT(CURLOPT_SOCKS5_GSSAPI_SERVICE);
 	REGISTER_CURL_CONSTANT(CURLOPT_TFTP_BLKSIZE);
+
 	REGISTER_CURL_CONSTANT(CURLPROTO_ALL);
 	REGISTER_CURL_CONSTANT(CURLPROTO_DICT);
 	REGISTER_CURL_CONSTANT(CURLPROTO_FILE);
@@ -1009,6 +1032,10 @@
 #endif

 #if LIBCURL_VERSION_NUM = 0x071400 /* Available since 7.20.0 */
+	REGISTER_CURL_CONSTANT(CURLINFO_RTSP_CLIENT_CSEQ);
+	REGISTER_CURL_CONSTANT(CURLINFO_RTSP_CSEQ_RECV);
+	REGISTER_CURL_CONSTANT(CURLINFO_RTSP_SERVER_CSEQ);
+	REGISTER_CURL_CONSTANT(CURLINFO_RTSP_SESSION_ID);
 	REGISTER_CURL_CONSTANT(CURLOPT_FTP_USE_PRET);
 	REGISTER_CURL_CONSTANT(CURLOPT_MAIL_FROM);
 	REGISTER_CURL_CONSTANT(CURLOPT_MAIL_RCPT);
@@ -1039,6 +1066,9 @@
 #endif

 #if LIBCURL_VERSION_NUM = 0x071500 /* Available since 7.21.0 */
+	REGISTER_CURL_CONSTANT(CURLINFO_LOCAL_IP);
+	REGISTER_CURL_CONSTANT(CURLINFO_LOCAL_PORT);
+	REGISTER_CURL_CONSTANT(CURLINFO_PRIMARY_PORT);
 	REGISTER_CURL_CONSTANT(CURLPROTO_RTMP);
 	REGISTER_CURL_CONSTANT(CURLPROTO_RTMPE);
 	REGISTER_CURL_CONSTANT(CURLPROTO_RTMPS);
@@ -2786,18 +2816,25 @@
 		if (curl_easy_getinfo(ch-cp, CURLINFO_REDIRECT_TIME, d_code) == CURLE_OK) {
 			CAAD(redirect_time, d_code);
 		}
-#if LIBCURL_VERSION_NUM  0x071301
+#if LIBCURL_VERSION_NUM = 0x071202 /* Available since 7.18.2 */
+		if (curl_easy_getinfo(ch-cp, CURLINFO_REDIRECT_URL, s_code) == CURLE_OK) {
+			CAAS(redirect_url, s_code);
+		}
+#endif
+#if LIBCURL_VERSION_NUM = 0x071300 /* Available 

[PHP-CVS] svn: /php/php-src/trunk/ext/curl/tests/ curl_basic_022.phpt

2011-12-03 Thread Pierrick Charron
pierrick Sat, 03 Dec 2011 20:19:53 +

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

Log:
Test curl_getinfo() function with CURLINFO_EFFECTIVE_URL parameter

Changed paths:
A   php/php-src/trunk/ext/curl/tests/curl_basic_022.phpt

Added: php/php-src/trunk/ext/curl/tests/curl_basic_022.phpt
===
--- php/php-src/trunk/ext/curl/tests/curl_basic_022.phpt
(rev 0)
+++ php/php-src/trunk/ext/curl/tests/curl_basic_022.phpt2011-12-03 
20:19:53 UTC (rev 320316)
@@ -0,0 +1,25 @@
+--TEST--
+Test curl_getinfo() function with CURLINFO_COOKIELIST parameter
+--SKIPIF--
+?php if (!extension_loaded(curl)) print skip;
+$curl_version = curl_version();
+if ($curl_version['version_number']  0x070e01) {
+   exit(skip: test works only with curl = 7.14.1);
+}
+?
+--FILE--
+?php
+
+$ch = curl_init();
+curl_setopt($ch, CURLOPT_COOKIELIST, 'Set-Cookie: C1=v1; expires=Sun, 
17-Jan-2038 19:14:07 GMT; path=/; domain=.php.net');
+curl_setopt($ch, CURLOPT_COOKIELIST, 'Set-Cookie: C2=v2; expires=Sun, 
17-Jan-2038 19:14:07 GMT; path=/; domain=.php.net');
+var_dump(curl_getinfo($ch, CURLINFO_COOKIELIST));
+
+?
+--EXPECT--
+array(2) {
+  [0]=
+  string(38) .php.net TRUE/   FALSE   2147368447  C1  v1
+  [1]=
+  string(38) .php.net TRUE/   FALSE   2147368447  C2  v2
+}

-- 
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/curl/ interface.c

2011-12-03 Thread Pierrick Charron
pierrick Sat, 03 Dec 2011 23:21:43 +

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

Log:
useless variable

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

Modified: php/php-src/trunk/ext/curl/interface.c
===
--- php/php-src/trunk/ext/curl/interface.c  2011-12-03 23:08:55 UTC (rev 
320328)
+++ php/php-src/trunk/ext/curl/interface.c  2011-12-03 23:21:43 UTC (rev 
320329)
@@ -1281,7 +1281,6 @@
 {
php_curl   *ch = (php_curl *) clientp;
php_curl_progress  *t  = ch-handlers-progress;
-   int length = -1;
size_t  rval = 0;

 #if PHP_CURL_DEBUG
@@ -1331,7 +1330,6 @@
ch-in_callback = 0;
if (error == FAILURE) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, 
Cannot call the CURLOPT_PROGRESSFUNCTION);
-   length = -1;
} else if (retval_ptr) {
if (Z_TYPE_P(retval_ptr) != IS_LONG) {
convert_to_long_ex(retval_ptr);

-- 
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/curl/ interface.c

2011-12-03 Thread Pierrick Charron
pierrick Sat, 03 Dec 2011 23:43:44 +

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

Log:
The progress handle don't need to be allocated unless
curl_setopt with CURLOPT_PROGRESSFUNCTION is called

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

Modified: php/php-src/trunk/ext/curl/interface.c
===
--- php/php-src/trunk/ext/curl/interface.c  2011-12-03 23:40:38 UTC (rev 
320331)
+++ php/php-src/trunk/ext/curl/interface.c  2011-12-03 23:43:44 UTC (rev 
320332)
@@ -1643,7 +1643,7 @@
(*ch)-handlers-write= ecalloc(1, sizeof(php_curl_write));
(*ch)-handlers-write_header = ecalloc(1, sizeof(php_curl_write));
(*ch)-handlers-read = ecalloc(1, sizeof(php_curl_read));
-   (*ch)-handlers-progress = ecalloc(1, sizeof(php_curl_progress));
+   (*ch)-handlers-progress = NULL;

(*ch)-in_callback = 0;
(*ch)-header.str_len = 0;
@@ -2447,7 +2447,9 @@
case CURLOPT_PROGRESSFUNCTION:
curl_easy_setopt(ch-cp, CURLOPT_PROGRESSFUNCTION,  
curl_progress);
curl_easy_setopt(ch-cp, CURLOPT_PROGRESSDATA, ch);
-   if (ch-handlers-progress-func_name) {
+   if (NULL == ch-handlers-progress) {
+   ch-handlers-progress = ecalloc(1, 
sizeof(php_curl_progress));
+   } else if (ch-handlers-progress-func_name) {

zval_ptr_dtor(ch-handlers-progress-func_name);
ch-handlers-progress-fci_cache = 
empty_fcall_info_cache;
}
@@ -3020,9 +3022,6 @@
if (ch-handlers-write_header-func_name) {
zval_ptr_dtor(ch-handlers-write_header-func_name);
}
-   if (ch-handlers-progress-func_name) {
-   zval_ptr_dtor(ch-handlers-progress-func_name);
-   }
if (ch-handlers-passwd) {
zval_ptr_dtor(ch-handlers-passwd);
}
@@ -3046,7 +3045,14 @@
efree(ch-handlers-write);
efree(ch-handlers-write_header);
efree(ch-handlers-read);
-   efree(ch-handlers-progress);
+
+   if (ch-handlers-progress) {
+   if (ch-handlers-progress-func_name) {
+   zval_ptr_dtor(ch-handlers-progress-func_name);
+   }
+   efree(ch-handlers-progress);
+   }
+
efree(ch-handlers);
efree(ch);
 }
@@ -3093,12 +3099,13 @@
ch-handlers-std_err = NULL;
}

-   if (ch-handlers-progress-func_name) {
-   zval_ptr_dtor(ch-handlers-progress-func_name);
-   ch-handlers-progress-fci_cache = empty_fcall_info_cache;
-   ch-handlers-progress-func_name = NULL;
+   if (ch-handlers-progress) {
+   if (ch-handlers-progress-func_name) {
+   zval_ptr_dtor(ch-handlers-progress-func_name);
+   }
+   efree(ch-handlers-progress);
+   ch-handlers-progress = NULL;
}
-   ch-handlers-progress-method = 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/curl/ interface.c

2011-12-03 Thread Pierrick Charron
pierrick Sat, 03 Dec 2011 23:53:27 +

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

Log:
Add the curl handle to the progress callback function

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

Modified: php/php-src/trunk/ext/curl/interface.c
===
--- php/php-src/trunk/ext/curl/interface.c  2011-12-03 23:53:05 UTC (rev 
320334)
+++ php/php-src/trunk/ext/curl/interface.c  2011-12-03 23:53:27 UTC (rev 
320335)
@@ -1290,7 +1290,8 @@

switch (t-method) {
case PHP_CURL_USER: {
-   zval **argv[4];
+   zval **argv[5];
+   zval  *handle = NULL;
zval  *zdltotal = NULL;
zval  *zdlnow = NULL;
zval  *zultotal = NULL;
@@ -1300,27 +1301,31 @@
zend_fcall_info fci;
TSRMLS_FETCH_FROM_CTX(ch-thread_ctx);

+   MAKE_STD_ZVAL(handle);
MAKE_STD_ZVAL(zdltotal);
MAKE_STD_ZVAL(zdlnow);
MAKE_STD_ZVAL(zultotal);
MAKE_STD_ZVAL(zulnow);

+   ZVAL_RESOURCE(handle, ch-id);
+   zend_list_addref(ch-id);
ZVAL_LONG(zdltotal, (long) dltotal);
ZVAL_LONG(zdlnow, (long) dlnow);
ZVAL_LONG(zultotal, (long) ultotal);
ZVAL_LONG(zulnow, (long) ulnow);

-   argv[0] = zdltotal;
-   argv[1] = zdlnow;
-   argv[2] = zultotal;
-   argv[3] = zulnow;
+   argv[0] = handle;
+   argv[1] = zdltotal;
+   argv[2] = zdlnow;
+   argv[3] = zultotal;
+   argv[4] = zulnow;

fci.size = sizeof(fci);
fci.function_table = EG(function_table);
fci.function_name = t-func_name;
fci.object_ptr = NULL;
fci.retval_ptr_ptr = retval_ptr;
-   fci.param_count = 4;
+   fci.param_count = 5;
fci.params = argv;
fci.no_separation = 0;
fci.symbol_table = NULL;
@@ -1343,6 +1348,7 @@
zval_ptr_dtor(argv[1]);
zval_ptr_dtor(argv[2]);
zval_ptr_dtor(argv[3]);
+   zval_ptr_dtor(argv[4]);
break;
}
}

-- 
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/curl/ interface.c php_curl.h

2011-12-03 Thread Pierrick Charron
pierrick Sun, 04 Dec 2011 00:19:12 +

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

Log:
add CURLOPT_WILDCARDMATCH and CURLOPT_FNMATCH_FUNCTION

Changed paths:
U   php/php-src/trunk/ext/curl/interface.c
U   php/php-src/trunk/ext/curl/php_curl.h

Modified: php/php-src/trunk/ext/curl/interface.c
===
--- php/php-src/trunk/ext/curl/interface.c  2011-12-04 00:03:56 UTC (rev 
320338)
+++ php/php-src/trunk/ext/curl/interface.c  2011-12-04 00:19:12 UTC (rev 
320339)
@@ -1067,12 +1067,17 @@
REGISTER_CURL_CONSTANT(CURLINFO_LOCAL_IP);
REGISTER_CURL_CONSTANT(CURLINFO_LOCAL_PORT);
REGISTER_CURL_CONSTANT(CURLINFO_PRIMARY_PORT);
+   REGISTER_CURL_CONSTANT(CURLOPT_FNMATCH_FUNCTION);
+   REGISTER_CURL_CONSTANT(CURLOPT_WILDCARDMATCH);
REGISTER_CURL_CONSTANT(CURLPROTO_RTMP);
REGISTER_CURL_CONSTANT(CURLPROTO_RTMPE);
REGISTER_CURL_CONSTANT(CURLPROTO_RTMPS);
REGISTER_CURL_CONSTANT(CURLPROTO_RTMPT);
REGISTER_CURL_CONSTANT(CURLPROTO_RTMPTE);
-   REGISTER_CURL_CONSTANT(CURLPROTO_RTMPTS);
+   REGISTER_CURL_CONSTANT(CURLPROTO_RTMPTS);
+   REGISTER_CURL_CONSTANT(CURL_FNMATCHFUNC_FAIL);
+   REGISTER_CURL_CONSTANT(CURL_FNMATCHFUNC_MATCH);
+   REGISTER_CURL_CONSTANT(CURL_FNMATCHFUNC_NOMATCH);
 #endif

 #if LIBCURL_VERSION_NUM = 0x071502 /* Available since 7.21.2 */
@@ -1275,6 +1280,71 @@
 }
 /* }}} */

+#if LIBCURL_VERSION_NUM = 0x071500 /* Available since 7.21.0 */
+/* {{{ curl_fnmatch
+ */
+static int curl_fnmatch(void *ctx, const char *pattern, const char *string)
+{
+   php_curl   *ch = (php_curl *) ctx;
+   php_curl_fnmatch *t = ch-handlers-fnmatch;
+   int rval = CURL_FNMATCHFUNC_FAIL;
+   switch (t-method) {
+   case PHP_CURL_USER: {
+   zval **argv[3];
+   zval  *zhandle = NULL;
+   zval  *zpattern = NULL;
+   zval  *zstring = NULL;
+   zval  *retval_ptr;
+   int   error;
+   zend_fcall_info fci;
+   TSRMLS_FETCH_FROM_CTX(ch-thread_ctx);
+
+   MAKE_STD_ZVAL(zhandle);
+   MAKE_STD_ZVAL(zpattern);
+   MAKE_STD_ZVAL(zstring);
+
+   ZVAL_RESOURCE(zhandle, ch-id);
+   zend_list_addref(ch-id);
+   ZVAL_STRING(zpattern, pattern, 1);
+   ZVAL_STRING(zstring, string, 1);
+
+   argv[0] = zhandle;
+   argv[1] = zpattern;
+   argv[2] = zstring;
+
+   fci.size = sizeof(fci);
+   fci.function_table = EG(function_table);
+   fci.function_name = t-func_name;
+   fci.object_ptr = NULL;
+   fci.retval_ptr_ptr = retval_ptr;
+   fci.param_count = 3;
+   fci.params = argv;
+   fci.no_separation = 0;
+   fci.symbol_table = NULL;
+
+   ch-in_callback = 1;
+   error = zend_call_function(fci, t-fci_cache 
TSRMLS_CC);
+   ch-in_callback = 0;
+   if (error == FAILURE) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
Cannot call the CURLOPT_FNMATCH_FUNCTION);
+   } else if (retval_ptr) {
+   if (Z_TYPE_P(retval_ptr) != IS_LONG) {
+   convert_to_long_ex(retval_ptr);
+   }
+   rval = Z_LVAL_P(retval_ptr);
+   zval_ptr_dtor(retval_ptr);
+   }
+   zval_ptr_dtor(argv[0]);
+   zval_ptr_dtor(argv[1]);
+   zval_ptr_dtor(argv[2]);
+   break;
+   }
+   }
+   return rval;
+}
+/* }}} */
+#endif
+
 /* {{{ curl_progress
  */
 static size_t curl_progress(void *clientp, double dltotal, double dlnow, 
double ultotal, double ulnow)
@@ -1650,6 +1720,9 @@
(*ch)-handlers-write_header = ecalloc(1, sizeof(php_curl_write));
(*ch)-handlers-read = ecalloc(1, sizeof(php_curl_read));
(*ch)-handlers-progress = NULL;
+#if LIBCURL_VERSION_NUM = 0x071500 /* Available since 7.21.0 */
+   (*ch)-handlers-fnmatch  = NULL;
+#endif

(*ch)-in_callback = 0;
(*ch)-header.str_len = 0;
@@ -2034,6 +2107,9 @@
case CURLOPT_RTSP_REQUEST:
case CURLOPT_RTSP_SERVER_CSEQ:
 #endif
+#if LIBCURL_VERSION_NUM = 0x071500 /* Available since 7.21.0 */
+   case CURLOPT_WILDCARDMATCH:
+#endif
 #if LIBCURL_VERSION_NUM = 0x071504 /* 

[PHP-CVS] svn: /php/php-src/trunk/ext/curl/ interface.c tests/curl_copy_handle_basic_008.phpt

2011-12-03 Thread Pierrick Charron
pierrick Sun, 04 Dec 2011 01:16:17 +

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

Log:
Fix segfault when using curl_copy_handle with CURLOPT_PROGRESSFUNCTION

Changed paths:
U   php/php-src/trunk/ext/curl/interface.c
A   php/php-src/trunk/ext/curl/tests/curl_copy_handle_basic_008.phpt

Modified: php/php-src/trunk/ext/curl/interface.c
===
--- php/php-src/trunk/ext/curl/interface.c  2011-12-04 00:19:12 UTC (rev 
320339)
+++ php/php-src/trunk/ext/curl/interface.c  2011-12-04 01:16:17 UTC (rev 
320340)
@@ -1965,6 +1965,26 @@
curl_easy_setopt(dupch-cp, CURLOPT_INFILE,(void *) dupch);
curl_easy_setopt(dupch-cp, CURLOPT_WRITEHEADER,   (void *) dupch);

+   if (ch-handlers-progress) {
+   dupch-handlers-progress = ecalloc(1, 
sizeof(php_curl_progress));
+   if (ch-handlers-progress-func_name) {
+   zval_add_ref(ch-handlers-progress-func_name);
+   dupch-handlers-progress-func_name = 
ch-handlers-progress-func_name;
+   }
+   dupch-handlers-progress-method = 
ch-handlers-progress-method;
+   curl_easy_setopt(dupch-cp, CURLOPT_PROGRESSDATA, (void *) 
dupch);
+   }
+
+   if (ch-handlers-fnmatch) {
+   dupch-handlers-fnmatch = ecalloc(1, sizeof(php_curl_fnmatch));
+   if (ch-handlers-fnmatch-func_name) {
+   zval_add_ref(ch-handlers-fnmatch-func_name);
+   dupch-handlers-fnmatch-func_name = 
ch-handlers-fnmatch-func_name;
+   }
+   dupch-handlers-fnmatch-method = 
ch-handlers-fnmatch-method;
+   curl_easy_setopt(dupch-cp, CURLOPT_FNMATCH_DATA, (void *) 
dupch);
+   }
+
efree(dupch-to_free);
dupch-to_free = ch-to_free;


Added: php/php-src/trunk/ext/curl/tests/curl_copy_handle_basic_008.phpt
===
--- php/php-src/trunk/ext/curl/tests/curl_copy_handle_basic_008.phpt
(rev 0)
+++ php/php-src/trunk/ext/curl/tests/curl_copy_handle_basic_008.phpt
2011-12-04 01:16:17 UTC (rev 320340)
@@ -0,0 +1,25 @@
+--TEST--
+Test curl_copy_handle() with CURLOPT_PROGRESSFUNCTION
+--SKIPIF--
+?php if (!extension_loaded(curl) || false === 
getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print skip need 
PHP_CURL_HTTP_REMOTE_SERVER environment variable; ?
+--FILE--
+?php
+  $host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
+
+  $url = {$host}/get.php;
+  $ch = curl_init($url);
+
+  curl_setopt($ch, CURLOPT_NOPROGRESS, 0);
+  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+  curl_setopt($ch, CURLOPT_PROGRESSFUNCTION, function() { });
+  $ch2 = curl_copy_handle($ch);
+  echo curl_exec($ch), PHP_EOL;
+  unset($ch);
+  echo curl_exec($ch2);
+
+?
+--EXPECTF--
+Hello World!
+Hello World!
+Hello World!
+Hello World!

-- 
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/curl/ interface.c

2011-12-03 Thread Pierrick Charron
pierrick Sat, 03 Dec 2011 21:24:19 +

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

Log:
Update curl MINFO

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

Modified: php/php-src/trunk/ext/curl/interface.c
===
--- php/php-src/trunk/ext/curl/interface.c  2011-12-03 21:24:03 UTC (rev 
320320)
+++ php/php-src/trunk/ext/curl/interface.c  2011-12-03 21:24:19 UTC (rev 
320321)
@@ -469,43 +469,41 @@
unsigned int i;

static const struct feat feats[] = {
-#if LIBCURL_VERSION_NUM  0x070a06 /* 7.10.7 */
+#if LIBCURL_VERSION_NUM = 0x070a07 /* 7.10.7 */
{AsynchDNS, CURL_VERSION_ASYNCHDNS},
 #endif
-#if LIBCURL_VERSION_NUM  0x070a05 /* 7.10.6 */
+#if LIBCURL_VERSION_NUM = 0x070f04 /* 7.15.4 */
+   {CharConv, CURL_VERSION_CONV},
+#endif
+#if LIBCURL_VERSION_NUM = 0x070a06 /* 7.10.6 */
{Debug, CURL_VERSION_DEBUG},
{GSS-Negotiate, CURL_VERSION_GSSNEGOTIATE},
 #endif
-#if LIBCURL_VERSION_NUM  0x070b02 /* 7.12.0 */
+#if LIBCURL_VERSION_NUM = 0x070c00 /* 7.12.0 */
{IDN, CURL_VERSION_IDN},
 #endif
-#ifdef CURL_VERSION_IPV6
{IPv6, CURL_VERSION_IPV6},
-#endif
-#if LIBCURL_VERSION_NUM  0x070b00 /* 7.11.1 */
+   {krb4, CURL_VERSION_KERBEROS4},
+#if LIBCURL_VERSION_NUM = 0x070b01 /* 7.11.1 */
{Largefile, CURL_VERSION_LARGEFILE},
 #endif
-#if LIBCURL_VERSION_NUM  0x070a05 /* 7.10.6 */
+   {libz, CURL_VERSION_LIBZ},
+#if LIBCURL_VERSION_NUM = 0x070a06 /* 7.10.6 */
{NTLM, CURL_VERSION_NTLM},
 #endif
-#if LIBCURL_VERSION_NUM  0x070a07 /* 7.10.8 */
+#if LIBCURL_VERSION_NUM = 0x071600 /* 7.22.0 */
+   {NTLMWB, CURL_VERSION_NTLM_WB},
+#endif
+#if LIBCURL_VERSION_NUM = 0x070a08 /* 7.10.8 */
{SPNEGO, CURL_VERSION_SPNEGO},
 #endif
-#ifdef CURL_VERSION_SSL
{SSL,  CURL_VERSION_SSL},
-#endif
-#if LIBCURL_VERSION_NUM  0x070d01 /* 7.13.2 */
+#if LIBCURL_VERSION_NUM = 0x070d02 /* 7.13.2 */
{SSPI,  CURL_VERSION_SSPI},
 #endif
-#ifdef CURL_VERSION_KERBEROS4
-   {krb4, CURL_VERSION_KERBEROS4},
+#if LIBCURL_VERSION_NUM = 0x071504 /* 7.21.4 */
+   {TLS-SRP, CURL_VERSION_TLSAUTH_SRP},
 #endif
-#ifdef CURL_VERSION_LIBZ
-   {libz, CURL_VERSION_LIBZ},
-#endif
-#if LIBCURL_VERSION_NUM  0x070f03 /* 7.15.4 */
-   {CharConv, CURL_VERSION_CONV},
-#endif
{NULL, 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/tests/array/ array_change_key_case_variation8.phpt arsort_variation5.phpt asort_variation5.phpt krsort_variation5.phpt ksort_variation5.phpt natcasesort_

2011-12-01 Thread Felipe Pena
felipe   Thu, 01 Dec 2011 14:14:30 +

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

Log:
- Fixed tests

Changed paths:
U   
php/php-src/trunk/ext/standard/tests/array/array_change_key_case_variation8.phpt
U   php/php-src/trunk/ext/standard/tests/array/arsort_variation5.phpt
U   php/php-src/trunk/ext/standard/tests/array/asort_variation5.phpt
U   php/php-src/trunk/ext/standard/tests/array/krsort_variation5.phpt
U   php/php-src/trunk/ext/standard/tests/array/ksort_variation5.phpt
U   php/php-src/trunk/ext/standard/tests/array/natcasesort_variation4.phpt
U   php/php-src/trunk/ext/standard/tests/array/rsort_variation5.phpt
U   php/php-src/trunk/ext/standard/tests/array/sort_variation5.phpt

Modified: 
php/php-src/trunk/ext/standard/tests/array/array_change_key_case_variation8.phpt
===
--- 
php/php-src/trunk/ext/standard/tests/array/array_change_key_case_variation8.phpt
2011-12-01 13:58:29 UTC (rev 320245)
+++ 
php/php-src/trunk/ext/standard/tests/array/array_change_key_case_variation8.phpt
2011-12-01 14:14:30 UTC (rev 320246)
@@ -42,7 +42,7 @@
   int(3)
   [\cx]=
   int(4)
-  [\e]=
+  []=
   int(5)
   []=
   int(6)
@@ -66,7 +66,7 @@
   int(3)
   [\CX]=
   int(4)
-  [\E]=
+  []=
   int(5)
   []=
   int(6)
@@ -125,4 +125,4 @@
   [X]=
   int(10)
 }
-Done
\ No newline at end of file
+Done

Modified: php/php-src/trunk/ext/standard/tests/array/arsort_variation5.phpt
===
--- php/php-src/trunk/ext/standard/tests/array/arsort_variation5.phpt   
2011-12-01 13:58:29 UTC (rev 320245)
+++ php/php-src/trunk/ext/standard/tests/array/arsort_variation5.phpt   
2011-12-01 14:14:30 UTC (rev 320246)
@@ -68,14 +68,14 @@
 array(12) {
   [\xhh]=
   string(4) \xhh
-  [\e]=
-  string(2) \e
   [\ddd]=
   string(4) \ddd
   [\cx]=
   string(3) \cx
   [\a]=
   string(2) \a
+  []=
+  string(1) 
   [
 ]=
   string(1) 
@@ -100,14 +100,14 @@
 array(12) {
   [\xhh]=
   string(4) \xhh
-  [\e]=
-  string(2) \e
   [\ddd]=
   string(4) \ddd
   [\cx]=
   string(3) \cx
   [\a]=
   string(2) \a
+  []=
+  string(1) 
   [
 ]=
   string(1) 
@@ -132,14 +132,14 @@
 array(12) {
   [\xhh]=
   string(4) \xhh
-  [\e]=
-  string(2) \e
   [\ddd]=
   string(4) \ddd
   [\cx]=
   string(3) \cx
   [\a]=
   string(2) \a
+  []=
+  string(1) 
   [
 ]=
   string(1) 
@@ -245,4 +245,4 @@
   [B]=
   string(6) BANANA
 }
-Done
\ No newline at end of file
+Done

Modified: php/php-src/trunk/ext/standard/tests/array/asort_variation5.phpt
===
--- php/php-src/trunk/ext/standard/tests/array/asort_variation5.phpt
2011-12-01 13:58:29 UTC (rev 320245)
+++ php/php-src/trunk/ext/standard/tests/array/asort_variation5.phpt
2011-12-01 14:14:30 UTC (rev 320246)
@@ -84,14 +84,14 @@
 ]=
   string(1) 
 
+  []=
+  string(1) 
   [\a]=
   string(2) \a
   [\cx]=
   string(3) \cx
   [\ddd]=
   string(4) \ddd
-  [\e]=
-  string(2) \e
   [\xhh]=
   string(4) \xhh
 }
@@ -116,14 +116,14 @@
 ]=
   string(1) 
 
+  []=
+  string(1) 
   [\a]=
   string(2) \a
   [\cx]=
   string(3) \cx
   [\ddd]=
   string(4) \ddd
-  [\e]=
-  string(2) \e
   [\xhh]=
   string(4) \xhh
 }
@@ -148,14 +148,14 @@
 ]=
   string(1) 
 
+  []=
+  string(1) 
   [\a]=
   string(2) \a
   [\cx]=
   string(3) \cx
   [\ddd]=
   string(4) \ddd
-  [\e]=
-  string(2) \e
   [\xhh]=
   string(4) \xhh
 }

Modified: php/php-src/trunk/ext/standard/tests/array/krsort_variation5.phpt
===
--- php/php-src/trunk/ext/standard/tests/array/krsort_variation5.phpt   
2011-12-01 13:58:29 UTC (rev 320245)
+++ php/php-src/trunk/ext/standard/tests/array/krsort_variation5.phpt   
2011-12-01 14:14:30 UTC (rev 320246)
@@ -68,14 +68,14 @@
 array(11) {
   [\xhh]=
   string(4) \xhh
-  [\e]=
-  string(2) \e
   [\ddd]=
   string(4) \ddd
   [\cx]=
   string(3) \cx
   [\a]=
   string(2) \a
+  []=
+  string(1) 
   [
 ]=
   string(1) 
@@ -98,14 +98,14 @@
 array(11) {
   [\xhh]=
   string(4) \xhh
-  [\e]=
-  string(2) \e
   [\ddd]=
   string(4) \ddd
   [\cx]=
   string(3) \cx
   [\a]=
   string(2) \a
+  []=
+  string(1) 
   [
 ]=
   string(1) 
@@ -128,14 +128,14 @@
 array(11) {
   [\xhh]=
   string(4) \xhh
-  [\e]=
-  string(2) \e
   [\ddd]=
   string(4) \ddd
   [\cx]=
   string(3) \cx
   [\a]=
   string(2) \a
+  []=
+  string(1) 
   [
 ]=
   string(1) 
Modified: php/php-src/trunk/ext/standard/tests/array/ksort_variation5.phpt
===
--- php/php-src/trunk/ext/standard/tests/array/ksort_variation5.phpt
2011-12-01 13:58:29 UTC (rev 320245)
+++ php/php-src/trunk/ext/standard/tests/array/ksort_variation5.phpt
2011-12-01 14:14:30 UTC (rev 320246)
@@ -82,14 +82,14 @@
 ]=
   string(1) 
 
+  []=
+  string(1) 
   [\a]=
   string(2) \a

[PHP-CVS] svn: /php/php-src/trunk/ NEWS ext/curl/config.m4 ext/curl/config.w32 ext/curl/curl.dsp ext/curl/interface.c ext/curl/package.xml ext/curl/php_curl.h ext/curl/share.c

2011-11-24 Thread Pierrick Charron
pierrick Thu, 24 Nov 2011 12:49:11 +

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

Log:
Revert commit r319729 until I have a clean version for non-ZTS

Changed paths:
U   php/php-src/trunk/NEWS
U   php/php-src/trunk/ext/curl/config.m4
U   php/php-src/trunk/ext/curl/config.w32
U   php/php-src/trunk/ext/curl/curl.dsp
U   php/php-src/trunk/ext/curl/interface.c
U   php/php-src/trunk/ext/curl/package.xml
U   php/php-src/trunk/ext/curl/php_curl.h
D   php/php-src/trunk/ext/curl/share.c

Modified: php/php-src/trunk/NEWS
===
--- php/php-src/trunk/NEWS	2011-11-24 12:46:45 UTC (rev 319750)
+++ php/php-src/trunk/NEWS	2011-11-24 12:49:11 UTC (rev 319751)
@@ -6,8 +6,6 @@
   . World domination

 - cURL:
-  . Implemented FR #55540, added functions curl_share_init(),
-curl_share_setopt() and curl_share_close(). (Pierrick)
   . Added support for CURLOPT_FTP_RESPONSE_TIMEOUT, CURLOPT_APPEND,
 CURLOPT_DIRLISTONLY, CURLOPT_NEW_DIRECTORY_PERMS, CURLOPT_NEW_FILE_PERMS,
 CURLOPT_NETRC_FILE, CURLOPT_PREQUOTE, CURLOPT_KRBLEVEL, CURLOPT_MAXFILESIZE,
@@ -27,7 +25,7 @@
 CURLOPT_TRANSFER_ENCODING, CURLOPT_DNS_SERVERS and CURLOPT_USE_SSL.
 (Pierrick)
   . Fixed bug #55635 (CURLOPT_BINARYTRANSFER no longer used. The constant
-still exists for backward compatibility but is doing nothing). (Pierrick)
+	still exists for backward compatibility but is doing nothing). (Pierrick)
   . Fixed bug #54995 (Missing CURLINFO_RESPONSE_CODE support). (Pierrick)

  NOTE: Insert NEWS from last stable release here prior to actual release! 

Modified: php/php-src/trunk/ext/curl/config.m4
===
--- php/php-src/trunk/ext/curl/config.m4	2011-11-24 12:46:45 UTC (rev 319750)
+++ php/php-src/trunk/ext/curl/config.m4	2011-11-24 12:49:11 UTC (rev 319751)
@@ -156,6 +156,6 @@
 AC_DEFINE(PHP_CURL_URL_WRAPPERS,1,[ ])
   fi

-  PHP_NEW_EXTENSION(curl, interface.c multi.c share.c streams.c, $ext_shared)
+  PHP_NEW_EXTENSION(curl, interface.c multi.c streams.c, $ext_shared)
   PHP_SUBST(CURL_SHARED_LIBADD)
 fi

Modified: php/php-src/trunk/ext/curl/config.w32
===
--- php/php-src/trunk/ext/curl/config.w32	2011-11-24 12:46:45 UTC (rev 319750)
+++ php/php-src/trunk/ext/curl/config.w32	2011-11-24 12:49:11 UTC (rev 319751)
@@ -13,7 +13,7 @@
 		 (((PHP_ZLIB==no)  (CHECK_LIB(zlib_a.lib;zlib.lib, curl, PHP_CURL))) ||
 			(PHP_ZLIB_SHARED  CHECK_LIB(zlib.lib, curl, PHP_CURL)) || (PHP_ZLIB == yes  (!PHP_ZLIB_SHARED)))
 		) {
-		EXTENSION(curl, interface.c multi.c share.c streams.c, true);
+		EXTENSION(curl, interface.c multi.c streams.c, true);
 		AC_DEFINE('HAVE_CURL', 1, 'Have cURL library');
 		AC_DEFINE('HAVE_CURL_SSL', 1, 'Have SSL suppurt in cURL');
 		AC_DEFINE('HAVE_CURL_EASY_STRERROR', 1, 'Have curl_easy_strerror in cURL');

Modified: php/php-src/trunk/ext/curl/curl.dsp
===
(Binary files differ)

Modified: php/php-src/trunk/ext/curl/interface.c
===
--- php/php-src/trunk/ext/curl/interface.c	2011-11-24 12:46:45 UTC (rev 319750)
+++ php/php-src/trunk/ext/curl/interface.c	2011-11-24 12:49:11 UTC (rev 319751)
@@ -90,7 +90,6 @@

 int  le_curl;
 int  le_curl_multi_handle;
-int  le_curl_share_handle;

 #ifdef PHP_CURL_NEED_OPENSSL_TSL /* {{{ */
 static MUTEX_T *php_curl_openssl_tsl = NULL;
@@ -349,19 +348,6 @@
 ZEND_BEGIN_ARG_INFO(arginfo_curl_multi_close, 0)
 	ZEND_ARG_INFO(0, mh)
 ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_curl_share_init, 0)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_curl_share_close, 0)
-	ZEND_ARG_INFO(0, sh)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_curl_share_setopt, 0)
-	ZEND_ARG_INFO(0, sh)
-	ZEND_ARG_INFO(0, option)
-	ZEND_ARG_INFO(0, value)
-ZEND_END_ARG_INFO()
 /* }}} */

 /* {{{ curl_functions[]
@@ -385,9 +371,6 @@
 	PHP_FE(curl_multi_getcontent,arginfo_curl_multi_getcontent)
 	PHP_FE(curl_multi_info_read, arginfo_curl_multi_info_read)
 	PHP_FE(curl_multi_close, arginfo_curl_multi_close)
-	PHP_FE(curl_share_init,  arginfo_curl_share_init)
-	PHP_FE(curl_share_close, arginfo_curl_share_close)
-	PHP_FE(curl_share_setopt,arginfo_curl_share_setopt)
 	PHP_FE_END
 };
 /* }}} */
@@ -544,7 +527,6 @@
 {
 	le_curl = zend_register_list_destructors_ex(_php_curl_close, NULL, curl, module_number);
 	le_curl_multi_handle = zend_register_list_destructors_ex(_php_curl_multi_close, NULL, curl_multi, module_number);
-	le_curl_share_handle = zend_register_list_destructors_ex(_php_curl_share_close, NULL, curl_share, module_number);

 	REGISTER_INI_ENTRIES();

@@ -1007,14 +989,6 @@
 	REGISTER_CURL_CONSTANT(CURLFTPMETHOD_SINGLECWD);
 #endif

-	/* Constant for curl_share_setopt */
-	

Re: [PHP-CVS] svn: /php/php-src/trunk/ NEWS ext/curl/config.m4 ext/curl/config.w32 ext/curl/curl.dsp ext/curl/interface.c ext/curl/package.xml ext/curl/php_curl.h ext/curl/share.c

2011-11-24 Thread Pierrick Charron
Doh ! For once it's not the ZTS which broke :p

I reverted the commit until I come up with a clean solution for both
ZTS and non-ZTS

Thanks

On 24 November 2011 01:45, Antony Dovgal t...@daylessday.org wrote:
 On 11/24/2011 02:20 AM, Pierrick Charron wrote:

 pierrick                                 Wed, 23 Nov 2011 22:20:28 +

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

 Log:
 Implemented FR #55540, added functions curl_share_init(),
 curl_share_setopt() and curl_share_close().

 This patch breaks non-ZTS build of trunk:

 /local/qa/HEAD_non-ZTS/ext/curl/php_curl.h:157:2: error: expected
 specifier-qualifier-list before ‘MUTEX_T’
 /local/qa/HEAD_non-ZTS/ext/curl/interface.c: In function ‘_php_curl_setopt’:
 /local/qa/HEAD_non-ZTS/ext/curl/interface.c:2449:8: warning: ‘return’ with
 no value, in function returning non-void
 make: *** [ext/curl/interface.lo] Error 1

 --
 Wbr,
 Antony Dovgal
 ---
 http://pinba.org - realtime profiling for 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/trunk/ext/pgsql/ config.m4 pgsql.c php_pgsql.h tests/08escape.phpt

2011-11-24 Thread Yasuo Ohgaki
yohgaki  Fri, 25 Nov 2011 02:21:01 +

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

Log:
add pg_escape_identifier/pg_escape_literal

Changed paths:
U   php/php-src/trunk/ext/pgsql/config.m4
U   php/php-src/trunk/ext/pgsql/pgsql.c
U   php/php-src/trunk/ext/pgsql/php_pgsql.h
U   php/php-src/trunk/ext/pgsql/tests/08escape.phpt

Modified: php/php-src/trunk/ext/pgsql/config.m4
===
--- php/php-src/trunk/ext/pgsql/config.m4   2011-11-25 02:17:33 UTC (rev 
319787)
+++ php/php-src/trunk/ext/pgsql/config.m4   2011-11-25 02:21:01 UTC (rev 
319788)
@@ -94,6 +94,7 @@
   AC_CHECK_LIB(pq, 
pg_encoding_to_char,AC_DEFINE(HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT,1,[Whether 
libpq is compiled with --enable-multibyte]))
   AC_CHECK_LIB(pq, lo_create, AC_DEFINE(HAVE_PG_LO_CREATE,1,[PostgreSQL 8.1 or 
later]))
   AC_CHECK_LIB(pq, lo_import_with_oid, 
AC_DEFINE(HAVE_PG_LO_IMPORT_WITH_OID,1,[PostgreSQL 8.4 or later]))
+  AC_CHECK_LIB(pq, PQescapeLiteral, 
AC_DEFINE(HAVE_PQESCAPELITERAL,1,[PostgreSQL 9.0 or later]))
   LIBS=$old_LIBS
   LDFLAGS=$old_LDFLAGS


Modified: php/php-src/trunk/ext/pgsql/pgsql.c
===
--- php/php-src/trunk/ext/pgsql/pgsql.c 2011-11-25 02:17:33 UTC (rev 319787)
+++ php/php-src/trunk/ext/pgsql/pgsql.c 2011-11-25 02:21:01 UTC (rev 319788)
@@ -422,6 +422,17 @@
 ZEND_END_ARG_INFO()
 #endif

+#if HAVE_PQESCAPE
+ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_escape_literal, 0, 0, 0)
+   ZEND_ARG_INFO(0, connection)
+   ZEND_ARG_INFO(0, data)
+ZEND_END_ARG_INFO()
+ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_escape_identifier, 0, 0, 0)
+   ZEND_ARG_INFO(0, connection)
+   ZEND_ARG_INFO(0, data)
+ZEND_END_ARG_INFO()
+#endif
+
 ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_result_error, 0, 0, 1)
ZEND_ARG_INFO(0, result)
 ZEND_END_ARG_INFO()
@@ -652,6 +663,8 @@
PHP_FE(pg_escape_string,arginfo_pg_escape_string)
PHP_FE(pg_escape_bytea, arginfo_pg_escape_bytea)
PHP_FE(pg_unescape_bytea,   arginfo_pg_unescape_bytea)
+   PHP_FE(pg_escape_literal,   arginfo_pg_escape_literal)
+   PHP_FE(pg_escape_identifier,arginfo_pg_escape_identifier)
 #endif
 #if HAVE_PQSETERRORVERBOSITY
PHP_FE(pg_set_error_verbosity,  arginfo_pg_set_error_verbosity)
@@ -815,7 +828,7 @@
TSRMLS_FETCH();
if (! PGG(ignore_notices)) {
notice = (php_pgsql_notice *)emalloc(sizeof(php_pgsql_notice));
-   notice-message = _php_pgsql_trim_message(message, 
notice-len);
+   notice-message = _php_pgsql_trim_message(message, (int 
*)notice-len);
if (PGG(log_notices)) {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, %s, 
notice-message);
}
@@ -4200,6 +4213,130 @@
 /* }}} */
 #endif

+#ifdef HAVE_PQESCAPE
+#if !HAVE_PQESCAPELITERAL
+/* emulate libpq's PQescapeInternal() 9.0 or later */
+static char* php_pgsql_PQescapeInternal(PGconn *conn, const char *str, size_t 
len, int escape_literal) {
+   char *result, *rp;
+   const char *s;
+   size_t tmp_len;
+   int input_len = len;
+   char quote_char = escape_literal ? '\'' : '';
+
+   if (!conn) {
+   return NULL;
+   }
+
+   /*
+* NOTE: multibyte strings that could cointain slashes should be 
considered.
+* (e.g. SJIS, BIG5) However, it cannot be done without valid PGconn 
and mbstring.
+* Therefore, this function does not support such encodings currently.
+* FIXME: add encoding check and skip multibyte char bytes if there is 
vaild PGconn.
+*/
+
+   /* allocate enough memory */
+   rp = result = (char *)emalloc(len*2 + 5); /* leading  E needs extra 2 
bytes + quote_chars on both end for 2 bytes + NULL */
+
+   if (escape_literal) {
+   /* check backslashes */
+   tmp_len = strspn(str, \\);
+   if (tmp_len != len) {
+   /* add  E for escaping slashes */
+   *rp++ = ' ';
+   *rp++ = 'E';
+   }
+   }
+   /* open quote */
+   *rp++ = quote_char;
+   for (s = str; s - str  input_len; ++s) {
+   if (*s == quote_char || (escape_literal  *s == '\\')) {
+   *rp++ = *s;
+   *rp++ = *s;
+   } else {
+   *rp++ = *s;
+   }
+   }
+   *rp++ = quote_char;
+   *rp = '\0';
+
+   return result;
+}
+#endif
+
+static void php_pgsql_escape_internal(INTERNAL_FUNCTION_PARAMETERS, int 
escape_literal) {
+   char *from = NULL, *to = NULL, *tmp = NULL;
+   zval *pgsql_link = NULL;
+   PGconn *pgsql;
+   int to_len;
+   int from_len;
+   int id = -1;
+
+   switch (ZEND_NUM_ARGS()) {
+   case 1:
+   if 

[PHP-CVS] svn: /php/php-src/trunk/ NEWS

2011-11-24 Thread Yasuo Ohgaki
yohgaki  Fri, 25 Nov 2011 02:24:37 +

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

Log:
add pgsql new functions

Changed paths:
U   php/php-src/trunk/NEWS

Modified: php/php-src/trunk/NEWS
===
--- php/php-src/trunk/NEWS  2011-11-25 02:21:01 UTC (rev 319788)
+++ php/php-src/trunk/NEWS  2011-11-25 02:24:37 UTC (rev 319789)
@@ -28,4 +28,7 @@
still exists for backward compatibility but is doing nothing). 
(Pierrick)
   . Fixed bug #54995 (Missing CURLINFO_RESPONSE_CODE support). (Pierrick)

+- pgsql
+  . Added pg_escape_literal() and pg_escape_identifier() (Yasuo)
+
  NOTE: Insert NEWS from last stable release here prior to actual release! 


-- 
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/curl/ interface.c

2011-11-23 Thread Pierrick Charron
pierrick Wed, 23 Nov 2011 19:36:52 +

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

Log:
Fix build for libcurl  7.20.0

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

Modified: php/php-src/trunk/ext/curl/interface.c
===
--- php/php-src/trunk/ext/curl/interface.c  2011-11-23 18:46:03 UTC (rev 
319723)
+++ php/php-src/trunk/ext/curl/interface.c  2011-11-23 19:36:52 UTC (rev 
319724)
@@ -2328,9 +2328,11 @@
case CURLOPT_PREQUOTE:
name = CURLOPT_PREQUOTE;
break;
+#if LIBCURL_VERSION_NUM = 0x071400 /* Available since 7.20.0 */
case CURLOPT_MAIL_RCPT:
name = CURLOPT_MAIL_RCPT;
break;
+#endif
 #if LIBCURL_VERSION_NUM = 0x071503 /* Available since 7.21.3 */
case CURLOPT_RESOLVE:
name = CURLOPT_RESOLVE;

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

[PHP-CVS] svn: /php/php-src/trunk/ NEWS ext/curl/config.m4 ext/curl/config.w32 ext/curl/curl.dsp ext/curl/interface.c ext/curl/package.xml ext/curl/php_curl.h ext/curl/share.c

2011-11-23 Thread Pierrick Charron
pierrick Wed, 23 Nov 2011 22:20:28 +

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

Log:
Implemented FR #55540, added functions curl_share_init(), curl_share_setopt() 
and curl_share_close().

Bug: https://bugs.php.net/55540 (Assigned) no curl_share? nice...
  
Changed paths:
U   php/php-src/trunk/NEWS
U   php/php-src/trunk/ext/curl/config.m4
U   php/php-src/trunk/ext/curl/config.w32
U   php/php-src/trunk/ext/curl/curl.dsp
U   php/php-src/trunk/ext/curl/interface.c
U   php/php-src/trunk/ext/curl/package.xml
U   php/php-src/trunk/ext/curl/php_curl.h
A   php/php-src/trunk/ext/curl/share.c

Modified: php/php-src/trunk/NEWS
===
--- php/php-src/trunk/NEWS	2011-11-23 21:58:16 UTC (rev 319728)
+++ php/php-src/trunk/NEWS	2011-11-23 22:20:28 UTC (rev 319729)
@@ -6,6 +6,8 @@
   . World domination

 - cURL:
+  . Implemented FR #55540, added functions curl_share_init(),
+curl_share_setopt() and curl_share_close(). (Pierrick)
   . Added support for CURLOPT_FTP_RESPONSE_TIMEOUT, CURLOPT_APPEND,
 CURLOPT_DIRLISTONLY, CURLOPT_NEW_DIRECTORY_PERMS, CURLOPT_NEW_FILE_PERMS,
 CURLOPT_NETRC_FILE, CURLOPT_PREQUOTE, CURLOPT_KRBLEVEL, CURLOPT_MAXFILESIZE,
@@ -25,7 +27,7 @@
 CURLOPT_TRANSFER_ENCODING, CURLOPT_DNS_SERVERS and CURLOPT_USE_SSL.
 (Pierrick)
   . Fixed bug #55635 (CURLOPT_BINARYTRANSFER no longer used. The constant
-	still exists for backward compatibility but is doing nothing). (Pierrick)
+still exists for backward compatibility but is doing nothing). (Pierrick)
   . Fixed bug #54995 (Missing CURLINFO_RESPONSE_CODE support). (Pierrick)

  NOTE: Insert NEWS from last stable release here prior to actual release! 

Modified: php/php-src/trunk/ext/curl/config.m4
===
--- php/php-src/trunk/ext/curl/config.m4	2011-11-23 21:58:16 UTC (rev 319728)
+++ php/php-src/trunk/ext/curl/config.m4	2011-11-23 22:20:28 UTC (rev 319729)
@@ -156,6 +156,6 @@
 AC_DEFINE(PHP_CURL_URL_WRAPPERS,1,[ ])
   fi

-  PHP_NEW_EXTENSION(curl, interface.c multi.c streams.c, $ext_shared)
+  PHP_NEW_EXTENSION(curl, interface.c multi.c share.c streams.c, $ext_shared)
   PHP_SUBST(CURL_SHARED_LIBADD)
 fi

Modified: php/php-src/trunk/ext/curl/config.w32
===
--- php/php-src/trunk/ext/curl/config.w32	2011-11-23 21:58:16 UTC (rev 319728)
+++ php/php-src/trunk/ext/curl/config.w32	2011-11-23 22:20:28 UTC (rev 319729)
@@ -13,7 +13,7 @@
 		 (((PHP_ZLIB==no)  (CHECK_LIB(zlib_a.lib;zlib.lib, curl, PHP_CURL))) ||
 			(PHP_ZLIB_SHARED  CHECK_LIB(zlib.lib, curl, PHP_CURL)) || (PHP_ZLIB == yes  (!PHP_ZLIB_SHARED)))
 		) {
-		EXTENSION(curl, interface.c multi.c streams.c, true);
+		EXTENSION(curl, interface.c multi.c share.c streams.c, true);
 		AC_DEFINE('HAVE_CURL', 1, 'Have cURL library');
 		AC_DEFINE('HAVE_CURL_SSL', 1, 'Have SSL suppurt in cURL');
 		AC_DEFINE('HAVE_CURL_EASY_STRERROR', 1, 'Have curl_easy_strerror in cURL');

Modified: php/php-src/trunk/ext/curl/curl.dsp
===
(Binary files differ)

Modified: php/php-src/trunk/ext/curl/interface.c
===
--- php/php-src/trunk/ext/curl/interface.c	2011-11-23 21:58:16 UTC (rev 319728)
+++ php/php-src/trunk/ext/curl/interface.c	2011-11-23 22:20:28 UTC (rev 319729)
@@ -90,6 +90,7 @@

 int  le_curl;
 int  le_curl_multi_handle;
+int  le_curl_share_handle;

 #ifdef PHP_CURL_NEED_OPENSSL_TSL /* {{{ */
 static MUTEX_T *php_curl_openssl_tsl = NULL;
@@ -348,6 +349,19 @@
 ZEND_BEGIN_ARG_INFO(arginfo_curl_multi_close, 0)
 	ZEND_ARG_INFO(0, mh)
 ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO(arginfo_curl_share_init, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO(arginfo_curl_share_close, 0)
+	ZEND_ARG_INFO(0, sh)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO(arginfo_curl_share_setopt, 0)
+	ZEND_ARG_INFO(0, sh)
+	ZEND_ARG_INFO(0, option)
+	ZEND_ARG_INFO(0, value)
+ZEND_END_ARG_INFO()
 /* }}} */

 /* {{{ curl_functions[]
@@ -371,6 +385,9 @@
 	PHP_FE(curl_multi_getcontent,arginfo_curl_multi_getcontent)
 	PHP_FE(curl_multi_info_read, arginfo_curl_multi_info_read)
 	PHP_FE(curl_multi_close, arginfo_curl_multi_close)
+	PHP_FE(curl_share_init,  arginfo_curl_share_init)
+	PHP_FE(curl_share_close, arginfo_curl_share_close)
+	PHP_FE(curl_share_setopt,arginfo_curl_share_setopt)
 	PHP_FE_END
 };
 /* }}} */
@@ -527,6 +544,7 @@
 {
 	le_curl = zend_register_list_destructors_ex(_php_curl_close, NULL, curl, module_number);
 	le_curl_multi_handle = zend_register_list_destructors_ex(_php_curl_multi_close, NULL, curl_multi, module_number);
+	le_curl_share_handle = zend_register_list_destructors_ex(_php_curl_share_close, NULL, curl_share, module_number);

 	REGISTER_INI_ENTRIES();

@@ -989,6 

Re: [PHP-CVS] svn: /php/php-src/trunk/ NEWS ext/curl/config.m4 ext/curl/config.w32 ext/curl/curl.dsp ext/curl/interface.c ext/curl/package.xml ext/curl/php_curl.h ext/curl/share.c

2011-11-23 Thread Pierre Joye
hi Pierrick!

Don't forget the UPGRADING guide :)

Cheers,

On Wed, Nov 23, 2011 at 11:20 PM, Pierrick Charron pierr...@php.net wrote:
 pierrick                                 Wed, 23 Nov 2011 22:20:28 +

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

 Log:
 Implemented FR #55540, added functions curl_share_init(), curl_share_setopt() 
 and curl_share_close().

 Bug: https://bugs.php.net/55540 (Assigned) no curl_share? nice...

 Changed paths:
    U   php/php-src/trunk/NEWS
    U   php/php-src/trunk/ext/curl/config.m4
    U   php/php-src/trunk/ext/curl/config.w32
    U   php/php-src/trunk/ext/curl/curl.dsp
    U   php/php-src/trunk/ext/curl/interface.c
    U   php/php-src/trunk/ext/curl/package.xml
    U   php/php-src/trunk/ext/curl/php_curl.h
    A   php/php-src/trunk/ext/curl/share.c


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




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



Re: [PHP-CVS] svn: /php/php-src/trunk/ NEWS ext/curl/config.m4 ext/curl/config.w32 ext/curl/curl.dsp ext/curl/interface.c ext/curl/package.xml ext/curl/php_curl.h ext/curl/share.c

2011-11-23 Thread Pierrick Charron
I will. I'm still working on few things on the curl ext and once it
will be done i'll take some time to document everything :)

Pierrick

On 23 November 2011 18:30, Pierre Joye pierre@gmail.com wrote:
 hi Pierrick!

 Don't forget the UPGRADING guide :)

 Cheers,

 On Wed, Nov 23, 2011 at 11:20 PM, Pierrick Charron pierr...@php.net wrote:
 pierrick                                 Wed, 23 Nov 2011 22:20:28 +

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

 Log:
 Implemented FR #55540, added functions curl_share_init(), 
 curl_share_setopt() and curl_share_close().

 Bug: https://bugs.php.net/55540 (Assigned) no curl_share? nice...

 Changed paths:
    U   php/php-src/trunk/NEWS
    U   php/php-src/trunk/ext/curl/config.m4
    U   php/php-src/trunk/ext/curl/config.w32
    U   php/php-src/trunk/ext/curl/curl.dsp
    U   php/php-src/trunk/ext/curl/interface.c
    U   php/php-src/trunk/ext/curl/package.xml
    U   php/php-src/trunk/ext/curl/php_curl.h
    A   php/php-src/trunk/ext/curl/share.c


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




 --
 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/ NEWS ext/curl/config.m4 ext/curl/config.w32 ext/curl/curl.dsp ext/curl/interface.c ext/curl/package.xml ext/curl/php_curl.h ext/curl/share.c

2011-11-23 Thread Antony Dovgal

On 11/24/2011 02:20 AM, Pierrick Charron wrote:

pierrick Wed, 23 Nov 2011 22:20:28 +

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

Log:
Implemented FR #55540, added functions curl_share_init(), curl_share_setopt() 
and curl_share_close().


This patch breaks non-ZTS build of trunk:

/local/qa/HEAD_non-ZTS/ext/curl/php_curl.h:157:2: error: expected 
specifier-qualifier-list before ‘MUTEX_T’
/local/qa/HEAD_non-ZTS/ext/curl/interface.c: In function ‘_php_curl_setopt’:
/local/qa/HEAD_non-ZTS/ext/curl/interface.c:2449:8: warning: ‘return’ with no 
value, in function returning non-void
make: *** [ext/curl/interface.lo] Error 1

--
Wbr,
Antony Dovgal
---
http://pinba.org - realtime profiling 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/ NEWS ext/curl/interface.c ext/curl/php_curl.h

2011-11-22 Thread Pierrick Charron
pierrick Tue, 22 Nov 2011 17:13:26 +

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

Log:
Fixed bug #55635

Bug: https://bugs.php.net/55635 (Assigned) CURLOPT_BINARYTRANSFER no longer 
used?
  
Changed paths:
U   php/php-src/trunk/NEWS
U   php/php-src/trunk/ext/curl/interface.c
U   php/php-src/trunk/ext/curl/php_curl.h

Modified: php/php-src/trunk/NEWS
===
--- php/php-src/trunk/NEWS  2011-11-22 16:52:42 UTC (rev 319691)
+++ php/php-src/trunk/NEWS  2011-11-22 17:13:26 UTC (rev 319692)
@@ -5,4 +5,8 @@
 - General improvements:
   . World domination

+- Curl:
+  . Fixed bug #55635 (CURLOPT_BINARYTRANSFER no longer used. The constant
+   still exists for backward compatibility but is doing nothing). 
(Pierrick)
+
  NOTE: Insert NEWS from last stable release here prior to actual release! 


Modified: php/php-src/trunk/ext/curl/interface.c
===
--- php/php-src/trunk/ext/curl/interface.c  2011-11-22 16:52:42 UTC (rev 
319691)
+++ php/php-src/trunk/ext/curl/interface.c  2011-11-22 17:13:26 UTC (rev 
319692)
@@ -261,7 +261,6 @@
ch-handlers-write-stream = NULL;

ch-handlers-write-method = PHP_CURL_STDOUT;
-   ch-handlers-write-type   = PHP_CURL_ASCII;
curl_easy_setopt(ch-cp, CURLOPT_FILE, (void *) ch);
}
}
@@ -1536,7 +1535,6 @@
ch-cp = cp;

ch-handlers-write-method = PHP_CURL_STDOUT;
-   ch-handlers-write-type   = PHP_CURL_ASCII;
ch-handlers-read-method  = PHP_CURL_DIRECT;
ch-handlers-write_header-method = PHP_CURL_IGNORE;

@@ -1610,7 +1608,6 @@
dupch-handlers-write-stream = ch-handlers-write-stream;
}
dupch-handlers-write-method = ch-handlers-write-method;
-   dupch-handlers-write-type   = ch-handlers-write-type;
if (ch-handlers-read-stream) {
Z_ADDREF_P(ch-handlers-read-stream);
}
@@ -1953,13 +1950,7 @@
}
break;
case CURLOPT_BINARYTRANSFER:
-   convert_to_long_ex(zvalue);
-
-   if (Z_LVAL_PP(zvalue)) {
-   ch-handlers-write-type = PHP_CURL_BINARY;
-   } else {
-   ch-handlers-write-type = PHP_CURL_ASCII;
-   }
+   /* Do nothing, just backward compatibility */
break;
case CURLOPT_WRITEFUNCTION:
if (ch-handlers-write-func_name) {

Modified: php/php-src/trunk/ext/curl/php_curl.h
===
--- php/php-src/trunk/ext/curl/php_curl.h   2011-11-22 16:52:42 UTC (rev 
319691)
+++ php/php-src/trunk/ext/curl/php_curl.h   2011-11-22 17:13:26 UTC (rev 
319692)
@@ -41,14 +41,12 @@
 #define curl_module_ptr curl_module_entry

 #define CURLOPT_RETURNTRANSFER 19913
-#define CURLOPT_BINARYTRANSFER 19914
+#define CURLOPT_BINARYTRANSFER 19914 /* For Backward compatibility */
 #define PHP_CURL_STDOUT 0
 #define PHP_CURL_FILE   1
 #define PHP_CURL_USER   2
 #define PHP_CURL_DIRECT 3
 #define PHP_CURL_RETURN 4
-#define PHP_CURL_ASCII  5
-#define PHP_CURL_BINARY 6
 #define PHP_CURL_IGNORE 7

 extern int  le_curl;
@@ -85,7 +83,6 @@
FILE*fp;
smart_str   buf;
int method;
-   int type;
zval*stream;
 } php_curl_write;


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

[PHP-CVS] svn: /php/php-src/trunk/ NEWS ext/curl/interface.c ext/curl/tests/curl_setopt_basic003.phpt

2011-11-22 Thread Pierrick Charron
pierrick Tue, 22 Nov 2011 17:33:48 +

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

Log:
Add new cURL CURLOPT_* options

Changed paths:
U   php/php-src/trunk/NEWS
U   php/php-src/trunk/ext/curl/interface.c
U   php/php-src/trunk/ext/curl/tests/curl_setopt_basic003.phpt

Modified: php/php-src/trunk/NEWS
===
--- php/php-src/trunk/NEWS	2011-11-22 17:13:26 UTC (rev 319692)
+++ php/php-src/trunk/NEWS	2011-11-22 17:33:48 UTC (rev 319693)
@@ -5,7 +5,25 @@
 - General improvements:
   . World domination

-- Curl:
+- cURL:
+  . Added support for CURLOPT_FTP_RESPONSE_TIMEOUT, CURLOPT_APPEND,
+CURLOPT_DIRLISTONLY, CURLOPT_NEW_DIRECTORY_PERMS, CURLOPT_NEW_FILE_PERMS,
+CURLOPT_NETRC_FILE, CURLOPT_PREQUOTE, CURLOPT_KRBLEVEL, CURLOPT_MAXFILESIZE,
+CURLOPT_FTP_ACCOUNT, CURLOPT_COOKIELIST, CURLOPT_IGNORE_CONTENT_LENGTH,
+CURLOPT_CONNECT_ONLY, CURLOPT_LOCALPORT, CURLOPT_LOCALPORTRANGE,
+CURLOPT_FTP_ALTERNATIVE_TO_USER, CURLOPT_SSL_SESSIONID_CACHE,
+CURLOPT_FTP_SSL_CCC, CURLOPT_HTTP_CONTENT_DECODING,
+CURLOPT_HTTP_TRANSFER_DECODING, CURLOPT_PROXY_TRANSFER_MODE,
+CURLOPT_ADDRESS_SCOPE, CURLOPT_CRLFILE, CURLOPT_ISSUERCERT,
+CURLOPT_USERNAME, CURLOPT_PASSWORD, CURLOPT_PROXYUSERNAME,
+CURLOPT_PROXYPASSWORD, CURLOPT_NOPROXY, CURLOPT_SOCKS5_GSSAPI_NEC,
+CURLOPT_SOCKS5_GSSAPI_SERVICE, CURLOPT_TFTP_BLKSIZE,
+CURLOPT_SSH_KNOWNHOSTS, CURLOPT_FTP_USE_PRET, CURLOPT_MAIL_FROM,
+CURLOPT_MAIL_RCPT, CURLOPT_RTSP_CLIENT_CSEQ, CURLOPT_RTSP_SERVER_CSEQ,
+CURLOPT_RTSP_SESSION_ID, CURLOPT_RTSP_STREAM_URI, CURLOPT_RTSP_TRANSPORT,
+CURLOPT_RTSP_REQUEST, CURLOPT_RESOLVE, CURLOPT_ACCEPT_ENCODING,
+CURLOPT_TRANSFER_ENCODING, CURLOPT_DNS_SERVERS and CURLOPT_USE_SSL.
+(Pierrick)
   . Fixed bug #55635 (CURLOPT_BINARYTRANSFER no longer used. The constant
 	still exists for backward compatibility but is doing nothing). (Pierrick)


Modified: php/php-src/trunk/ext/curl/interface.c
===
--- php/php-src/trunk/ext/curl/interface.c	2011-11-22 17:13:26 UTC (rev 319692)
+++ php/php-src/trunk/ext/curl/interface.c	2011-11-22 17:33:48 UTC (rev 319693)
@@ -535,11 +535,12 @@
 	   of options and which version they were introduced */

 	/* Constants for curl_setopt() */
-#if LIBCURL_VERSION_NUM  0x070a07 /* CURLOPT_IPRESOLVE is available since curl 7.10.8 */
+#if LIBCURL_VERSION_NUM  0x070a07 /* CURLOPT_IPRESOLVE and CURLOPT_FTP_RESPONSE_TIMEOUT are available since curl 7.10.8 */
 	REGISTER_CURL_CONSTANT(CURLOPT_IPRESOLVE);
 	REGISTER_CURL_CONSTANT(CURL_IPRESOLVE_WHATEVER);
 	REGISTER_CURL_CONSTANT(CURL_IPRESOLVE_V4);
 	REGISTER_CURL_CONSTANT(CURL_IPRESOLVE_V6);
+	REGISTER_CURL_CONSTANT(CURLOPT_FTP_RESPONSE_TIMEOUT);
 #endif
 	REGISTER_CURL_CONSTANT(CURLOPT_DNS_USE_GLOBAL_CACHE);
 	REGISTER_CURL_CONSTANT(CURLOPT_DNS_CACHE_TIMEOUT);
@@ -561,7 +562,16 @@
 	REGISTER_CURL_CONSTANT(CURLOPT_POST);
 	REGISTER_CURL_CONSTANT(CURLOPT_FTPLISTONLY);
 	REGISTER_CURL_CONSTANT(CURLOPT_FTPAPPEND);
+#if LIBCURL_VERSION_NUM = 0x071100 /* Available since 7.17.0 */
+	REGISTER_CURL_CONSTANT(CURLOPT_APPEND);
+	REGISTER_CURL_CONSTANT(CURLOPT_DIRLISTONLY);
+	REGISTER_CURL_CONSTANT(CURLOPT_NEW_DIRECTORY_PERMS);
+	REGISTER_CURL_CONSTANT(CURLOPT_NEW_FILE_PERMS);
+#endif
 	REGISTER_CURL_CONSTANT(CURLOPT_NETRC);
+#if LIBCURL_VERSION_NUM = 0x070b00 /* Option available since 7.11.0 */
+	REGISTER_CURL_CONSTANT(CURLOPT_NETRC_FILE);
+#endif
 	REGISTER_CURL_CONSTANT(CURLOPT_FOLLOWLOCATION);
 #if CURLOPT_FTPASCII != 0
 	REGISTER_CURL_CONSTANT(CURLOPT_FTPASCII);
@@ -602,8 +612,14 @@
 	REGISTER_CURL_CONSTANT(CURLOPT_RETURNTRANSFER);
 	REGISTER_CURL_CONSTANT(CURLOPT_QUOTE);
 	REGISTER_CURL_CONSTANT(CURLOPT_POSTQUOTE);
+#if LIBCURL_VERSION_NUM = 0x070905 /* Available since 7.9.5 */
+	REGISTER_CURL_CONSTANT(CURLOPT_PREQUOTE);
+#endif
 	REGISTER_CURL_CONSTANT(CURLOPT_INTERFACE);
 	REGISTER_CURL_CONSTANT(CURLOPT_KRB4LEVEL);
+#if LIBCURL_VERSION_NUM = 0x071004 /* Available since 7.16.4 */
+	REGISTER_CURL_CONSTANT(CURLOPT_KRBLEVEL);
+#endif
 	REGISTER_CURL_CONSTANT(CURLOPT_HTTPPROXYTUNNEL);
 	REGISTER_CURL_CONSTANT(CURLOPT_FILETIME);
 	REGISTER_CURL_CONSTANT(CURLOPT_WRITEFUNCTION);
@@ -675,7 +691,93 @@
 #endif

 	REGISTER_CURL_CONSTANT(CURLOPT_PRIVATE);
-
+#if LIBCURL_VERSION_NUM = 0x070a08 /* Available since 7.10.8 */
+	REGISTER_CURL_CONSTANT(CURLOPT_MAXFILESIZE);
+#endif
+#if LIBCURL_VERSION_NUM = 0x070d00 /* Available since 7.13.0 */
+	REGISTER_CURL_CONSTANT(CURLOPT_FTP_ACCOUNT);
+#endif
+#if LIBCURL_VERSION_NUM = 0x070e01 /* Available since 7.14.1 */
+	REGISTER_CURL_CONSTANT(CURLOPT_COOKIELIST);
+	REGISTER_CURL_CONSTANT(CURLOPT_IGNORE_CONTENT_LENGTH);
+#endif
+#if LIBCURL_VERSION_NUM = 0x070f02 /* Available since 7.15.2 */
+	REGISTER_CURL_CONSTANT(CURLOPT_CONNECT_ONLY);
+	REGISTER_CURL_CONSTANT(CURLOPT_LOCALPORT);
+	

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

2011-11-22 Thread Felipe Pena
felipe   Tue, 22 Nov 2011 21:10:24 +

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

Log:
- Fix build (using libcurl 7.21.0)

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

Modified: php/php-src/trunk/ext/curl/interface.c
===
--- php/php-src/trunk/ext/curl/interface.c  2011-11-22 20:01:32 UTC (rev 
319701)
+++ php/php-src/trunk/ext/curl/interface.c  2011-11-22 21:10:24 UTC (rev 
319702)
@@ -767,10 +767,10 @@
REGISTER_CURL_CONSTANT(CURL_RTSPREQ_RECORD);
REGISTER_CURL_CONSTANT(CURL_RTSPREQ_RECEIVE);
 #endif
-#if LIBCURL_VERSION_NUM = 0x071403 /* Available since 7.21.3 */
+#if LIBCURL_VERSION_NUM = 0x071503 /* Available since 7.21.3 */
REGISTER_CURL_CONSTANT(CURLOPT_RESOLVE);
 #endif
-#if LIBCURL_VERSION_NUM = 0x071406 /* Available since 7.21.6 */
+#if LIBCURL_VERSION_NUM = 0x071506 /* Available since 7.21.6 */
REGISTER_CURL_CONSTANT(CURLOPT_ACCEPT_ENCODING);
REGISTER_CURL_CONSTANT(CURLOPT_TRANSFER_ENCODING);
 #endif
@@ -1970,7 +1970,7 @@
case CURLOPT_SSLENGINE:
case CURLOPT_SSLENGINE_DEFAULT:
case CURLOPT_SSLCERTTYPE:
-#if LIBCURL_VERSION_NUM = 0x071406 /* Available since 7.21.6 */
+#if LIBCURL_VERSION_NUM = 0x071506 /* Available since 7.21.6 */
case CURLOPT_ACCEPT_ENCODING:
case CURLOPT_TRANSFER_ENCODING:
 #else
@@ -2300,7 +2300,7 @@
 #if LIBCURL_VERSION_NUM = 0x071400 /* Available since 7.20.0 */
case CURLOPT_MAIL_RCPT:
 #endif
-#if LIBCURL_VERSION_NUM = 0x071403 /* Available since 7.21.3 */
+#if LIBCURL_VERSION_NUM = 0x071503 /* Available since 7.21.3 */
case CURLOPT_RESOLVE:
 #endif
{
@@ -2330,9 +2330,11 @@
case CURLOPT_MAIL_RCPT:
name = CURLOPT_MAIL_RCPT;
break;
+#if LIBCURL_VERSION_NUM = 0x071503 /* Available since 7.21.3 */
case CURLOPT_RESOLVE:
name = CURLOPT_RESOLVE;
break;
+#endif
}
php_error_docref(NULL TSRMLS_CC, E_WARNING, 
You must pass either an object or an array with the %s argument, name);
RETVAL_FALSE;

-- 
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/curl/ interface.c

2011-11-22 Thread Pierrick Charron
Thanks :)

On 22 November 2011 16:10, Felipe Pena fel...@php.net wrote:
 felipe                                   Tue, 22 Nov 2011 21:10:24 +

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

 Log:
 - Fix build (using libcurl 7.21.0)

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

 Modified: php/php-src/trunk/ext/curl/interface.c
 ===
 --- php/php-src/trunk/ext/curl/interface.c      2011-11-22 20:01:32 UTC (rev 
 319701)
 +++ php/php-src/trunk/ext/curl/interface.c      2011-11-22 21:10:24 UTC (rev 
 319702)
 @@ -767,10 +767,10 @@
        REGISTER_CURL_CONSTANT(CURL_RTSPREQ_RECORD);
        REGISTER_CURL_CONSTANT(CURL_RTSPREQ_RECEIVE);
  #endif
 -#if LIBCURL_VERSION_NUM = 0x071403 /* Available since 7.21.3 */
 +#if LIBCURL_VERSION_NUM = 0x071503 /* Available since 7.21.3 */
        REGISTER_CURL_CONSTANT(CURLOPT_RESOLVE);
  #endif
 -#if LIBCURL_VERSION_NUM = 0x071406 /* Available since 7.21.6 */
 +#if LIBCURL_VERSION_NUM = 0x071506 /* Available since 7.21.6 */
        REGISTER_CURL_CONSTANT(CURLOPT_ACCEPT_ENCODING);
        REGISTER_CURL_CONSTANT(CURLOPT_TRANSFER_ENCODING);
  #endif
 @@ -1970,7 +1970,7 @@
                case CURLOPT_SSLENGINE:
                case CURLOPT_SSLENGINE_DEFAULT:
                case CURLOPT_SSLCERTTYPE:
 -#if LIBCURL_VERSION_NUM = 0x071406 /* Available since 7.21.6 */
 +#if LIBCURL_VERSION_NUM = 0x071506 /* Available since 7.21.6 */
                case CURLOPT_ACCEPT_ENCODING:
                case CURLOPT_TRANSFER_ENCODING:
  #else
 @@ -2300,7 +2300,7 @@
  #if LIBCURL_VERSION_NUM = 0x071400 /* Available since 7.20.0 */
                case CURLOPT_MAIL_RCPT:
  #endif
 -#if LIBCURL_VERSION_NUM = 0x071403 /* Available since 7.21.3 */
 +#if LIBCURL_VERSION_NUM = 0x071503 /* Available since 7.21.3 */
                case CURLOPT_RESOLVE:
  #endif
                {
 @@ -2330,9 +2330,11 @@
                                        case CURLOPT_MAIL_RCPT:
                                                name = CURLOPT_MAIL_RCPT;
                                                break;
 +#if LIBCURL_VERSION_NUM = 0x071503 /* Available since 7.21.3 */
                                        case CURLOPT_RESOLVE:
                                                name = CURLOPT_RESOLVE;
                                                break;
 +#endif
                                }
                                php_error_docref(NULL TSRMLS_CC, E_WARNING, 
 You must pass either an object or an array with the %s argument, name);
                                RETVAL_FALSE;


 --
 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/trunk/ NEWS ext/curl/interface.c ext/curl/tests/bug54995.phpt

2011-11-22 Thread Pierrick Charron
pierrick Wed, 23 Nov 2011 05:45:27 +

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

Log:
Fixed bug #54995

Bug: https://bugs.php.net/54995 (Assigned) Missing CURLINFO_RESPONSE_CODE 
support
  
Changed paths:
U   php/php-src/trunk/NEWS
U   php/php-src/trunk/ext/curl/interface.c
A   php/php-src/trunk/ext/curl/tests/bug54995.phpt

Modified: php/php-src/trunk/NEWS
===
--- php/php-src/trunk/NEWS  2011-11-23 01:20:49 UTC (rev 319705)
+++ php/php-src/trunk/NEWS  2011-11-23 05:45:27 UTC (rev 319706)
@@ -26,5 +26,6 @@
 (Pierrick)
   . Fixed bug #55635 (CURLOPT_BINARYTRANSFER no longer used. The constant
still exists for backward compatibility but is doing nothing). 
(Pierrick)
+  . Fixed bug #54995 (Missing CURLINFO_RESPONSE_CODE support). (Pierrick)

  NOTE: Insert NEWS from last stable release here prior to actual release! 


Modified: php/php-src/trunk/ext/curl/interface.c
===
--- php/php-src/trunk/ext/curl/interface.c  2011-11-23 01:20:49 UTC (rev 
319705)
+++ php/php-src/trunk/ext/curl/interface.c  2011-11-23 05:45:27 UTC (rev 
319706)
@@ -788,6 +788,7 @@
/* Info constants */
REGISTER_CURL_CONSTANT(CURLINFO_EFFECTIVE_URL);
REGISTER_CURL_CONSTANT(CURLINFO_HTTP_CODE);
+   REGISTER_CURL_CONSTANT(CURLINFO_RESPONSE_CODE);
REGISTER_CURL_CONSTANT(CURLINFO_HEADER_SIZE);
REGISTER_CURL_CONSTANT(CURLINFO_REQUEST_SIZE);
REGISTER_CURL_CONSTANT(CURLINFO_TOTAL_TIME);

Added: php/php-src/trunk/ext/curl/tests/bug54995.phpt
===
--- php/php-src/trunk/ext/curl/tests/bug54995.phpt  
(rev 0)
+++ php/php-src/trunk/ext/curl/tests/bug54995.phpt  2011-11-23 05:45:27 UTC 
(rev 319706)
@@ -0,0 +1,30 @@
+--TEST--
+Bug #54995 (Missing CURLINFO_RESPONSE_CODE support)
+--SKIPIF--
+?php
+if (!extension_loaded(curl)) {
+   exit(skip curl extension not loaded);
+}
+if ($curl_version['version_number']  0x070a08) {
+   exit(skip: tests works a versions of curl = 7.10.8);
+}
+if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER'))  {
+   exit(skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined);
+}
+?
+--FILE--
+?php
+
+$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
+$ch = curl_init();
+curl_setopt($ch, CURLOPT_URL, {$host}/get.php);
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+
+var_dump(curl_getinfo($ch, CURLINFO_HTTP_CODE) == curl_getinfo($ch, 
CURLINFO_RESPONSE_CODE));
+
+curl_exec($ch);
+curl_close($ch);
+
+?
+--EXPECTF--
+bool(true)

-- 
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/ basic_functions.c exec.c exec.h tests/general_functions/bug60116.phpt

2011-11-11 Thread Rui Hirokawa
hirokawa Fri, 11 Nov 2011 14:58:32 +

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

Log:
revert changes to fix bug #60116.

Bug: https://bugs.php.net/60116 (error getting bug information)
  
Changed paths:
U   php/php-src/trunk/ext/standard/basic_functions.c
U   php/php-src/trunk/ext/standard/exec.c
U   php/php-src/trunk/ext/standard/exec.h
D   php/php-src/trunk/ext/standard/tests/general_functions/bug60116.phpt

Modified: php/php-src/trunk/ext/standard/basic_functions.c
===
--- php/php-src/trunk/ext/standard/basic_functions.c2011-11-11 14:52:56 UTC 
(rev 319057)
+++ php/php-src/trunk/ext/standard/basic_functions.c2011-11-11 14:58:32 UTC 
(rev 319058)
@@ -3615,7 +3615,6 @@
 #endif

register_phpinfo_constants(INIT_FUNC_ARGS_PASSTHRU);
-   register_exec_constants(INIT_FUNC_ARGS_PASSTHRU);
register_html_constants(INIT_FUNC_ARGS_PASSTHRU);
register_string_constants(INIT_FUNC_ARGS_PASSTHRU);


Modified: php/php-src/trunk/ext/standard/exec.c
===
--- php/php-src/trunk/ext/standard/exec.c   2011-11-11 14:52:56 UTC (rev 
319057)
+++ php/php-src/trunk/ext/standard/exec.c   2011-11-11 14:58:32 UTC (rev 
319058)
@@ -50,16 +50,6 @@
 #include unistd.h
 #endif

-/* {{{ register_exec_constants
- *  */
-void register_exec_constants(INIT_FUNC_ARGS)
-{
-REGISTER_LONG_CONSTANT(ESCAPE_CMD_PAIR, ESCAPE_CMD_PAIR, 
CONST_PERSISTENT|CONST_CS);
-REGISTER_LONG_CONSTANT(ESCAPE_CMD_END, ESCAPE_CMD_END, 
CONST_PERSISTENT|CONST_CS);
-REGISTER_LONG_CONSTANT(ESCAPE_CMD_ALL, ESCAPE_CMD_ALL, 
CONST_PERSISTENT|CONST_CS);
-}
-/* }}} */
-
 /* {{{ php_exec
  * If type==0, only last line of output is returned (exec)
  * If type==1, all lines will be printed and last lined returned (system)
@@ -248,7 +238,7 @@

*NOT* safe for binary strings
 */
-PHPAPI char *php_escape_shell_cmd_ex(char *str, int flag)
+PHPAPI char *php_escape_shell_cmd(char *str)
 {
register int x, y, l = strlen(str);
char *cmd;
@@ -276,25 +266,13 @@
 #ifndef PHP_WIN32
case '':
case '\'':
-   if (flag == ESCAPE_CMD_ALL) {
+   if (!p  (p = memchr(str + x + 1, str[x], l - 
x - 1))) {
+   /* noop */
+   } else if (p  *p == str[x]) {
+   p = NULL;
+   } else {
cmd[y++] = '\\';
cmd[y++] = str[x];
-   } else if (flag == ESCAPE_CMD_END) {
-   if ((x == 0 || x == l - 1)  (str[0] 
== str[l-1])) {
-   cmd[y++] = str[x];
-} else {
-cmd[y++] = '\\';
-cmd[y++] = str[x];
-}
-   } else { /* ESCAPE_CMD_PAIR */
-   if (!p  (p = memchr(str + x + 1, 
str[x], l - x - 1))) {
-   /* noop */
-   } else if (p  *p == str[x]) {
-   p = NULL;
-   } else {
-   cmd[y++] = '\\';
-   }
-   cmd[y++] = str[x];
}
break;
 #else
@@ -349,14 +327,6 @@
 }
 /* }}} */

-/* {{{ php_escape_shell_cmd
- */
-PHPAPI char *php_escape_shell_cmd(char *str)
-{
-return php_escape_shell_cmd_ex(str, ESCAPE_CMD_PAIR);
-}
-/* }}} */
-
 /* {{{ php_escape_shell_arg
  */
 PHPAPI char *php_escape_shell_arg(char *str)
@@ -427,15 +397,14 @@
 {
char *command;
int command_len;
-   long flag = ESCAPE_CMD_PAIR;
char *cmd = NULL;

-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|l, command, 
command_len, flag) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, command, 
command_len) == FAILURE) {
return;
}

if (command_len) {
-   cmd = php_escape_shell_cmd_ex(command, flag);
+   cmd = php_escape_shell_cmd(command);
RETVAL_STRING(cmd, 0);
} else {
RETVAL_EMPTY_STRING();

Modified: php/php-src/trunk/ext/standard/exec.h
===
--- php/php-src/trunk/ext/standard/exec.h   2011-11-11 14:52:56 UTC (rev 
319057)
+++ php/php-src/trunk/ext/standard/exec.h   2011-11-11 14:58:32 UTC (rev 
319058)
@@ -21,10 +21,6 @@
 #ifndef EXEC_H
 #define EXEC_H


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

2011-11-10 Thread Mateusz Kocielski
shm  Thu, 10 Nov 2011 10:33:07 +

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

Log:
Fixed NULL pointer dereference in stream_socket_enable_crypto, case when
ssl_handle of session_stream is not initialized.

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

Modified: php/php-src/trunk/ext/openssl/xp_ssl.c
===
--- php/php-src/trunk/ext/openssl/xp_ssl.c  2011-11-10 09:43:25 UTC (rev 
318986)
+++ php/php-src/trunk/ext/openssl/xp_ssl.c  2011-11-10 10:33:07 UTC (rev 
318987)
@@ -406,6 +406,8 @@
if (cparam-inputs.session) {
if (cparam-inputs.session-ops != php_openssl_socket_ops) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, supplied 
session stream must be an SSL enabled stream);
+   } else if 
(((php_openssl_netstream_data_t*)cparam-inputs.session-abstract)-ssl_handle 
== NULL) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, supplied 
SSL session stream is not initialized);
} else {
SSL_copy_session_id(sslsock-ssl_handle, 
((php_openssl_netstream_data_t*)cparam-inputs.session-abstract)-ssl_handle);
}

-- 
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/openssl/ xp_ssl.c

2011-11-10 Thread Pierre Joye
hi Mateusz,

Not necessary in 5.3 and 5.4?

Cheers,

On Thu, Nov 10, 2011 at 11:33 AM, Mateusz Kocielski s...@php.net wrote:
 shm                                      Thu, 10 Nov 2011 10:33:07 +

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

 Log:
 Fixed NULL pointer dereference in stream_socket_enable_crypto, case when
 ssl_handle of session_stream is not initialized.

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

 Modified: php/php-src/trunk/ext/openssl/xp_ssl.c
 ===
 --- php/php-src/trunk/ext/openssl/xp_ssl.c      2011-11-10 09:43:25 UTC (rev 
 318986)
 +++ php/php-src/trunk/ext/openssl/xp_ssl.c      2011-11-10 10:33:07 UTC (rev 
 318987)
 @@ -406,6 +406,8 @@
        if (cparam-inputs.session) {
                if (cparam-inputs.session-ops != php_openssl_socket_ops) {
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, supplied 
 session stream must be an SSL enabled stream);
 +               } else if 
 (((php_openssl_netstream_data_t*)cparam-inputs.session-abstract)-ssl_handle
  == NULL) {
 +                       php_error_docref(NULL TSRMLS_CC, E_WARNING, supplied 
 SSL session stream is not initialized);
                } else {
                        SSL_copy_session_id(sslsock-ssl_handle, 
 ((php_openssl_netstream_data_t*)cparam-inputs.session-abstract)-ssl_handle);
                }


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




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

2011-11-08 Thread Antony Dovgal
tony2001 Tue, 08 Nov 2011 13:30:58 +

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

Log:
bail out if reading HTTP headers failed

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

Modified: php/php-src/trunk/ext/standard/http_fopen_wrapper.c
===
--- php/php-src/trunk/ext/standard/http_fopen_wrapper.c 2011-11-08 12:34:37 UTC 
(rev 318910)
+++ php/php-src/trunk/ext/standard/http_fopen_wrapper.c 2011-11-08 13:30:58 UTC 
(rev 318911)
@@ -716,7 +716,10 @@
char *e = http_header_line + http_header_line_length - 
1;
if (*e != '\n') {
do { /* partial header */
-   php_stream_get_line(stream, 
http_header_line, HTTP_HEADER_BLOCK_SIZE, http_header_line_length);
+   if (php_stream_get_line(stream, 
http_header_line, HTTP_HEADER_BLOCK_SIZE, http_header_line_length) == NULL) {
+   
php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, Failed to read HTTP 
headers);
+   goto out;
+   }
e = http_header_line + 
http_header_line_length - 1;
} while (*e != '\n');
continue;

-- 
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/tests/general_functions/bug60227.phpt main/SAPI.c

2011-11-06 Thread Rui Hirokawa
hirokawa Sun, 06 Nov 2011 11:07:14 +

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

Log:
fixed bug #60227: header() cannot detect the multi-line header with CR.

Bug: https://bugs.php.net/60227 (Open) header() cannot detect the multi-line 
header with CR(0x0D).
  
Changed paths:
A   php/php-src/trunk/ext/standard/tests/general_functions/bug60227.phpt
U   php/php-src/trunk/main/SAPI.c

Added: php/php-src/trunk/ext/standard/tests/general_functions/bug60227.phpt
===
--- php/php-src/trunk/ext/standard/tests/general_functions/bug60227.phpt
(rev 0)
+++ php/php-src/trunk/ext/standard/tests/general_functions/bug60227.phpt
2011-11-06 11:07:14 UTC (rev 318820)
@@ -0,0 +1,20 @@
+--TEST--
+Bug #60227 (header() cannot detect the multi-line header with CR)
+--FILE--
+?php
+header(X-Foo1: a);
+header(X-Foo2: b\n );
+header(X-Foo3: c\r\n );
+header(X-Foo4: d\r );
+header(X-Foo5: e\rSet-Cookie: ID=123);
+echo 'foo';
+?
+--EXPECTF--
+Warning: Header may not contain more than a single header, new line detected. 
in %s on line %d
+foo
+--EXPECTHEADERS--
+X-Foo1: a
+X-Foo2: b
+X-Foo3: c
+X-Foo4: d
+


Property changes on: 
php/php-src/trunk/ext/standard/tests/general_functions/bug60227.phpt
___
Added: svn:keywords
   + Id Rev Revision
Added: svn:eol-style
   + native

Modified: php/php-src/trunk/main/SAPI.c
===
--- php/php-src/trunk/main/SAPI.c   2011-11-06 07:41:04 UTC (rev 318819)
+++ php/php-src/trunk/main/SAPI.c   2011-11-06 11:07:14 UTC (rev 318820)
@@ -712,7 +712,7 @@
} else {
/* new line safety check */
char *s = header_line, *e = header_line + header_line_len, *p;
-   while (s  e  (p = memchr(s, '\n', (e - s {
+   while (s  e  ((p = memchr(s, '\n', (e - s))) || (p = 
memchr(s, '\r', (e - s) {
if (*(p + 1) == ' ' || *(p + 1) == '\t') {
s = p + 1;
continue;

-- 
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_tables.h

2011-11-04 Thread Rui Hirokawa
hirokawa Sat, 05 Nov 2011 04:43:35 +

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

Log:
added japanese encoding to maintain compatibility with PHP 5.3.

Changed paths:
U   php/php-src/trunk/ext/standard/html_tables.h

Modified: php/php-src/trunk/ext/standard/html_tables.h
===
--- php/php-src/trunk/ext/standard/html_tables.h2011-11-05 04:33:02 UTC 
(rev 318801)
+++ php/php-src/trunk/ext/standard/html_tables.h2011-11-05 04:43:35 UTC 
(rev 318802)
@@ -57,8 +57,11 @@
{ Shift_JIS,  cs_sjis },
{ SJIS,   cs_sjis },
{ 932,cs_sjis },
+   { SJIS-win,   cs_sjis },
+   { CP932,  cs_sjis },
{ EUCJP,  cs_eucjp },
{ EUC-JP, cs_eucjp },
+   { eucJP-win,  cs_eucjp },
{ KOI8-R, cs_koi8r },
{ koi8-ru,cs_koi8r },
{ koi8r,  cs_koi8r },

-- 
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/mbstring/libmbfl/filters/ mbfilter_sjis_mobile.c mbfilter_sjis_mobile.h mbfilter_utf8_mobile.c

2011-11-02 Thread Rui Hirokawa
hirokawa Wed, 02 Nov 2011 14:51:39 +

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

Log:
fixed alias and encoding mapping for emoji logo.

Changed paths:
U   php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c
U   php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.h
U   php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c

Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c
===
--- php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c   
2011-11-02 14:49:41 UTC (rev 318689)
+++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c   
2011-11-02 14:51:39 UTC (rev 318690)
@@ -52,7 +52,7 @@
mbfl_no_encoding_sjis_docomo,
SJIS-Mobile#DOCOMO,
Shift_JIS,
-   mbfl_encoding_sjis_docomo_aliases,
+   (const char *(*)[])mbfl_encoding_sjis_docomo_aliases,
mblen_table_sjis,
MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE
 };
@@ -61,7 +61,7 @@
mbfl_no_encoding_sjis_kddi,
SJIS-Mobile#KDDI,
Shift_JIS,
-   mbfl_encoding_sjis_kddi_aliases,
+   (const char *(*)[])mbfl_encoding_sjis_kddi_aliases,
mblen_table_sjis,
MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE
 };
@@ -70,7 +70,7 @@
mbfl_no_encoding_sjis_sb,
SJIS-Mobile#SOFTBANK,
Shift_JIS,
-   mbfl_encoding_sjis_sb_aliases,
+   (const char *(*)[])mbfl_encoding_sjis_sb_aliases,
mblen_table_sjis,
MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE
 };
@@ -155,35 +155,36 @@
 static const int nflags_code_sb[10] = {0x2b0a, 0x2b05, 0x2b08, 0x2b04, 0x2b07, 
0x2b06, 0x2b02, 0x2b0b, 0x2b09, 0x2b03};

 const unsigned short mbfl_docomo2uni_pua[4][3] = {
-   {0x28c2, 0x2929, 0xe63e},
-   {0x2930, 0x2932, 0xe6ac},
-   {0x2935, 0x293e, 0xe6b1},
+   {0x28c2, 0x292f, 0xe63e},
+   {0x2930, 0x2934, 0xe6ac},
+   {0x2935, 0x2951, 0xe6b1},
{0x2952, 0x29db, 0xe6ce},
 };

-const unsigned short mbfl_kddi2uni_pua[6][3] = {
+const unsigned short mbfl_kddi2uni_pua[7][3] = {
{0x26ec, 0x2838, 0xe468},
{0x284c, 0x2863, 0xe5b5},
{0x24b8, 0x24ca, 0xe5cd},
{0x24cb, 0x2545, 0xea80},
{0x2839, 0x284b, 0xeafb},
{0x2546, 0x25c0, 0xeb0e},
+   {0x25c1, 0x25c6, 0xeb89},
 };

 const unsigned short mbfl_sb2uni_pua[6][3] = {
{0x27a9, 0x2802, 0xe101},
-   {0x2808, 0x285a, 0xe201},
+   {0x2808, 0x2861, 0xe201},
{0x2921, 0x297a, 0xe001},
{0x2980, 0x29cc, 0xe301},
{0x2a99, 0x2ae4, 0xe401},
-   {0x2af8, 0x2b2f, 0xe501},
+   {0x2af8, 0x2b35, 0xe501},
 };

 const unsigned short mbfl_kddi2uni_pua_b[8][3] = {
{0x24b8, 0x24f6, 0xec40},
{0x24f7, 0x2573, 0xec80},
{0x2574, 0x25b2, 0xed40},
-   {0x25b3, 0x25c0, 0xed80},
+   {0x25b3, 0x25c6, 0xed80},
{0x26ec, 0x272a, 0xef40},
{0x272b, 0x27a7, 0xef80},
{0x27a8, 0x27e6, 0xf040},

Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.h
===
--- php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.h   
2011-11-02 14:49:41 UTC (rev 318689)
+++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.h   
2011-11-02 14:51:39 UTC (rev 318690)
@@ -48,7 +48,7 @@
 extern const struct mbfl_convert_vtbl vtbl_wchar_sjis_sb;

 extern const unsigned short mbfl_docomo2uni_pua[4][3];
-extern const unsigned short mbfl_kddi2uni_pua[6][3];
+extern const unsigned short mbfl_kddi2uni_pua[7][3];
 extern const unsigned short mbfl_sb2uni_pua[6][3];
 extern const unsigned short mbfl_kddi2uni_pua_b[8][3];


Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c
===
--- php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c   
2011-11-02 14:49:41 UTC (rev 318689)
+++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c   
2011-11-02 14:51:39 UTC (rev 318690)
@@ -213,7 +213,7 @@
mbfilter_conv_r_map_tbl(s, s1, 
mbfl_docomo2uni_pua, 4)  0) {
s = 
mbfilter_sjis_emoji_docomo2unicode(s1, snd);
} else if (filter-from-no_encoding == 
mbfl_no_encoding_utf8_kddi_a 
-  mbfilter_conv_r_map_tbl(s, 
s1, mbfl_kddi2uni_pua, 6)  0) {
+  mbfilter_conv_r_map_tbl(s, 
s1, mbfl_kddi2uni_pua, 7)  0) {
s = 
mbfilter_sjis_emoji_kddi2unicode(s1, snd);
} else if (filter-from-no_encoding == 
mbfl_no_encoding_utf8_kddi_b 

[PHP-CVS] svn: /php/php-src/trunk/ext/pdo_sqlite/tests/ bug60104.phpt

2011-11-02 Thread Xinchen Hui
laruence Thu, 03 Nov 2011 05:16:47 +

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

Log:
xfail, not fix yet

Changed paths:
U   php/php-src/trunk/ext/pdo_sqlite/tests/bug60104.phpt

Modified: php/php-src/trunk/ext/pdo_sqlite/tests/bug60104.phpt
===
--- php/php-src/trunk/ext/pdo_sqlite/tests/bug60104.phpt2011-11-03 
03:59:41 UTC (rev 318716)
+++ php/php-src/trunk/ext/pdo_sqlite/tests/bug60104.phpt2011-11-03 
05:16:47 UTC (rev 318717)
@@ -1,5 +1,7 @@
 --TEST--
 Bug #60104 (Segmentation Fault in pdo_sqlite when using sqliteCreateFunction())
+--XFAIL--
+see bug #60104, not fix yet
 --SKIPIF--
 ?php
 if (!extension_loaded('pdo_sqlite')) print 'skip not loaded';

-- 
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/mbstring/libmbfl/filters/ mbfilter_utf8_mobile.c

2011-10-30 Thread Rui Hirokawa
hirokawa Sun, 30 Oct 2011 08:40:22 +

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

Log:
fixed alias of encoding.

Changed paths:
U   php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c

Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c
===
--- php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c   
2011-10-30 08:36:18 UTC (rev 318574)
+++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c   
2011-10-30 08:40:22 UTC (rev 318575)
@@ -41,7 +41,7 @@
 extern const unsigned char mblen_table_utf8[];

 static const char *mbfl_encoding_utf8_docomo_aliases[] = {UTF-8-DOCOMO, 
UTF8-DOCOMO, NULL};
-static const char *mbfl_encoding_utf8_kddi_a_aliases[] = {UTF-8-KDDI, 
UTF8-KDDI, NULL};
+static const char *mbfl_encoding_utf8_kddi_a_aliases[] = {NULL};
 static const char *mbfl_encoding_utf8_kddi_b_aliases[] = {UTF-8-Mobile#KDDI, 
UTF-8-KDDI, UTF8-KDDI, NULL};
 static const char *mbfl_encoding_utf8_sb_aliases[] = {UTF-8-SOFTBANK, 
UTF8-SOFTBANK, NULL};


-- 
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/ exec.c tests/general_functions/bug60116.phpt

2011-10-29 Thread Rui Hirokawa
hirokawa Sun, 30 Oct 2011 05:57:26 +

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

Log:
added a test script for bug60116 and fixed behabior of ESCAPE_CMD_END.

Bug: https://bugs.php.net/60116 (To be documented) escapeshellcmd() cannot 
escape the chars which causes shell injection.
  
Changed paths:
U   php/php-src/trunk/ext/standard/exec.c
A   php/php-src/trunk/ext/standard/tests/general_functions/bug60116.phpt

Modified: php/php-src/trunk/ext/standard/exec.c
===
--- php/php-src/trunk/ext/standard/exec.c   2011-10-30 01:45:29 UTC (rev 
318567)
+++ php/php-src/trunk/ext/standard/exec.c   2011-10-30 05:57:26 UTC (rev 
318568)
@@ -280,7 +280,7 @@
cmd[y++] = '\\';
cmd[y++] = str[x];
} else if (flag == ESCAPE_CMD_END) {
-   if (x == 0 || x == l - 1) {
+   if ((x == 0 || x == l - 1)  (str[0] 
== str[l-1])) {
cmd[y++] = str[x];
 } else {
 cmd[y++] = '\\';

Added: php/php-src/trunk/ext/standard/tests/general_functions/bug60116.phpt
===
--- php/php-src/trunk/ext/standard/tests/general_functions/bug60116.phpt
(rev 0)
+++ php/php-src/trunk/ext/standard/tests/general_functions/bug60116.phpt
2011-10-30 05:57:26 UTC (rev 318568)
@@ -0,0 +1,160 @@
+--TEST--
+Test escapeshellcmd() to escape the quotation
+--SKIPIF--
+?php
+if( substr(PHP_OS, 0, 3) == 'WIN' ) {
+   die('skip...Invalid for Windows');
+}
+?
+--FILE--
+?php
+echo *** Testing escapeshellcmd() escape the quotation ***\n;
+$data = array(
+   'abc',
+   'abc,
+   '?',
+   '()[]{}$',
+   '%^',
+   '#;`|*?',
+   '~\\',
+   '%NOENV%',
+   abc' 'def,
+   'abc def',
+   'abc def',
+   'abc def',
+);
+
+echo case: default\n;
+
+$count = 1;
+foreach ($data AS $value) {
+   echo -- Test  . $count++ .  --\n;
+   var_dump(escapeshellcmd($value));
+}
+
+echo case: ESCAPE_CMD_PAIR\n;
+$count = 1;
+foreach ($data AS $value) {
+   echo -- Test  . $count++ .  --\n;
+   var_dump(escapeshellcmd($value, ESCAPE_CMD_PAIR));
+}
+
+echo case: ESCAPE_CMD_END\n;
+$count = 1;
+foreach ($data AS $value) {
+   echo -- Test  . $count++ .  --\n;
+   var_dump(escapeshellcmd($value, ESCAPE_CMD_END));
+}
+
+echo case: ESCAPE_CMD_ALL\n;
+$count = 1;
+foreach ($data AS $value) {
+   echo -- Test  . $count++ .  --\n;
+   var_dump(escapeshellcmd($value, ESCAPE_CMD_ALL));
+}
+
+echo Done\n;
+?
+--EXPECTF--
+*** Testing escapeshellcmd() escape the quotation ***
+case: default
+-- Test 1 --
+string(5) \abc
+-- Test 2 --
+string(5) \'abc
+-- Test 3 --
+string(6) \?\\
+-- Test 4 --
+string(14) \(\)\[\]\{\}\$
+-- Test 5 --
+string(3) %\^
+-- Test 6 --
+string(14) \#\\;\`\|\*\?
+-- Test 7 --
+string(8) \~
+-- Test 8 --
+string(7) %NOENV%
+-- Test 9 --
+string(9) abc' 'def
+-- Test 10 --
+string(9) abc def
+-- Test 11 --
+string(9) 'abc def'
+-- Test 12 --
+string(9) abc def
+case: ESCAPE_CMD_PAIR
+-- Test 1 --
+string(5) \abc
+-- Test 2 --
+string(5) \'abc
+-- Test 3 --
+string(6) \?\\
+-- Test 4 --
+string(14) \(\)\[\]\{\}\$
+-- Test 5 --
+string(3) %\^
+-- Test 6 --
+string(14) \#\\;\`\|\*\?
+-- Test 7 --
+string(8) \~
+-- Test 8 --
+string(7) %NOENV%
+-- Test 9 --
+string(9) abc' 'def
+-- Test 10 --
+string(9) abc def
+-- Test 11 --
+string(9) 'abc def'
+-- Test 12 --
+string(9) abc def
+case: ESCAPE_CMD_END
+-- Test 1 --
+string(5) \abc
+-- Test 2 --
+string(5) \'abc
+-- Test 3 --
+string(6) \?\\
+-- Test 4 --
+string(14) \(\)\[\]\{\}\$
+-- Test 5 --
+string(3) %\^
+-- Test 6 --
+string(14) \#\\;\`\|\*\?
+-- Test 7 --
+string(8) \~
+-- Test 8 --
+string(7) %NOENV%
+-- Test 9 --
+string(11) abc\' \'def
+-- Test 10 --
+string(11) abc\ \def
+-- Test 11 --
+string(9) 'abc def'
+-- Test 12 --
+string(9) abc def
+case: ESCAPE_CMD_ALL
+-- Test 1 --
+string(5) \abc
+-- Test 2 --
+string(5) \'abc
+-- Test 3 --
+string(6) \?\\
+-- Test 4 --
+string(14) \(\)\[\]\{\}\$
+-- Test 5 --
+string(3) %\^
+-- Test 6 --
+string(14) \#\\;\`\|\*\?
+-- Test 7 --
+string(8) \~
+-- Test 8 --
+string(7) %NOENV%
+-- Test 9 --
+string(11) abc\' \'def
+-- Test 10 --
+string(11) abc\ \def
+-- Test 11 --
+string(11) \'abc def\'
+-- Test 12 --
+string(11) \abc def\
+Done


Property changes on: 
php/php-src/trunk/ext/standard/tests/general_functions/bug60116.phpt
___
Added: svn:keywords
   + Id Rev Revision
Added: svn:eol-style
   + native

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

2011-10-26 Thread Patrick Allaert
patrickallaert   Wed, 26 Oct 2011 09:32:37 +

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

Log:
Added test for #60104

Bug: https://bugs.php.net/60104 (Feedback) Segmentation Fault in pdo_sqlite 
when using sqliteCreateFunction()
  
Changed paths:
A   php/php-src/trunk/ext/pdo_sqlite/tests/bug60104.phpt

Added: php/php-src/trunk/ext/pdo_sqlite/tests/bug60104.phpt
===
--- php/php-src/trunk/ext/pdo_sqlite/tests/bug60104.phpt
(rev 0)
+++ php/php-src/trunk/ext/pdo_sqlite/tests/bug60104.phpt2011-10-26 
09:32:37 UTC (rev 318424)
@@ -0,0 +1,21 @@
+--TEST--
+Bug #60104 (Segmentation Fault in pdo_sqlite when using sqliteCreateFunction())
+--SKIPIF--
+?php
+if (!extension_loaded('pdo_sqlite')) print 'skip not loaded';
+?
+--FILE--
+?php
+function setUp()
+{
+$handler = new PDO( sqlite::memory: );
+$handler-sqliteCreateFunction( md5, md5, 1 );
+unset( $handler );
+}
+
+setUp();
+setUp();
+echo done;
+?
+--EXPECTF--
+done

-- 
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/ basic_functions.c exec.c exec.h

2011-10-24 Thread Pierre Joye
hi Rui,

Did you test it that on other platforms than linux?

It will also be nice to add tests case for this as this function
(actually both escape args and cmds) has suffered from lack of testing
on all platforms in the last php releases.

Btw, update the upgrading guide too :)

On Sun, Oct 23, 2011 at 3:49 PM, Rui Hirokawa hirok...@php.net wrote:
 hirokawa                                 Sun, 23 Oct 2011 13:49:54 +

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

 Log:
 fixed bug #60116 escapeshellcmd() cannot escape the dangerous quotes.

 Bug: https://bugs.php.net/60116 (Open) escapeshellcmd() cannot escape the 
 chars which causes shell injection.

 Changed paths:
    U   php/php-src/trunk/ext/standard/basic_functions.c
    U   php/php-src/trunk/ext/standard/exec.c
    U   php/php-src/trunk/ext/standard/exec.h

 Modified: php/php-src/trunk/ext/standard/basic_functions.c
 ===
 --- php/php-src/trunk/ext/standard/basic_functions.c    2011-10-23 11:54:34 
 UTC (rev 318341)
 +++ php/php-src/trunk/ext/standard/basic_functions.c    2011-10-23 13:49:54 
 UTC (rev 318342)
 @@ -3614,6 +3614,7 @@
  #endif

        register_phpinfo_constants(INIT_FUNC_ARGS_PASSTHRU);
 +       register_exec_constants(INIT_FUNC_ARGS_PASSTHRU);
        register_html_constants(INIT_FUNC_ARGS_PASSTHRU);
        register_string_constants(INIT_FUNC_ARGS_PASSTHRU);


 Modified: php/php-src/trunk/ext/standard/exec.c
 ===
 --- php/php-src/trunk/ext/standard/exec.c       2011-10-23 11:54:34 UTC (rev 
 318341)
 +++ php/php-src/trunk/ext/standard/exec.c       2011-10-23 13:49:54 UTC (rev 
 318342)
 @@ -50,6 +50,16 @@
  #include unistd.h
  #endif

 +/* {{{ register_exec_constants
 + *  */
 +void register_exec_constants(INIT_FUNC_ARGS)
 +{
 +    REGISTER_LONG_CONSTANT(ESCAPE_CMD_PAIR, ESCAPE_CMD_PAIR, 
 CONST_PERSISTENT|CONST_CS);
 +    REGISTER_LONG_CONSTANT(ESCAPE_CMD_END, ESCAPE_CMD_END, 
 CONST_PERSISTENT|CONST_CS);
 +    REGISTER_LONG_CONSTANT(ESCAPE_CMD_ALL, ESCAPE_CMD_ALL, 
 CONST_PERSISTENT|CONST_CS);
 +}
 +/* }}} */
 +
  /* {{{ php_exec
  * If type==0, only last line of output is returned (exec)
  * If type==1, all lines will be printed and last lined returned (system)
 @@ -238,7 +248,7 @@

    *NOT* safe for binary strings
  */
 -PHPAPI char *php_escape_shell_cmd(char *str)
 +PHPAPI char *php_escape_shell_cmd_ex(char *str, int flag)
  {
        register int x, y, l = strlen(str);
        char *cmd;
 @@ -266,14 +276,26 @@
  #ifndef PHP_WIN32
                        case '':
                        case '\'':
 -                               if (!p  (p = memchr(str + x + 1, str[x], l 
 - x - 1))) {
 -                                       /* noop */
 -                               } else if (p  *p == str[x]) {
 -                                       p = NULL;
 -                               } else {
 +                               if (flag == ESCAPE_CMD_ALL) {
                                        cmd[y++] = '\\';
 +                                       cmd[y++] = str[x];
 +                               } else if (flag == ESCAPE_CMD_END) {
 +                                       if (x == 0 || x == l - 1) {
 +                                               cmd[y++] = str[x];
 +                    } else {
 +                        cmd[y++] = '\\';
 +                        cmd[y++] = str[x];
 +                    }
 +                               } else { /* ESCAPE_CMD_PAIR */
 +                                       if (!p  (p = memchr(str + x + 1, 
 str[x], l - x - 1))) {
 +                                               /* noop */
 +                                       } else if (p  *p == str[x]) {
 +                                               p = NULL;
 +                                       } else {
 +                                               cmd[y++] = '\\';
 +                                       }
 +                                       cmd[y++] = str[x];
                                }
 -                               cmd[y++] = str[x];
                                break;
  #else
                        /* % is Windows specific for enviromental variables, 
 ^%PATH% will
 @@ -327,6 +349,14 @@
  }
  /* }}} */

 +/* {{{ php_escape_shell_cmd
 + */
 +PHPAPI char *php_escape_shell_cmd(char *str)
 +{
 +    return php_escape_shell_cmd_ex(str, ESCAPE_CMD_PAIR);
 +}
 +/* }}} */
 +
  /* {{{ php_escape_shell_arg
  */
  PHPAPI char *php_escape_shell_arg(char *str)
 @@ -397,14 +427,15 @@
  {
        char *command;
        int command_len;
 +       long flag = ESCAPE_CMD_PAIR;
        char *cmd = NULL;

 -       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, command, 
 command_len) == FAILURE) {
 +       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|l, command, 
 command_len, flag) == FAILURE) {
                return;
        }

        if 

  1   2   3   4   5   6   7   8   9   10   >