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

2010-12-03 Thread Adam Harvey
aharvey  Fri, 03 Dec 2010 09:34:35 +

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

Log:
Implemented FR #53447 (Cannot disable SessionTicket extension for servers that
do not support it).

I haven't written a test due to the need for such a test to have a HTTPS server
available which mishandles SessionTicket requests; it's likely that server
administrators will gradually fix this either intentionally or through OpenSSL
upgrades. That said, if there's a great clamoring for a test, I'll work one up.

Bug: http://bugs.php.net/53447 (Assigned) Cannot disable SessionTicket 
extension for servers that do not support it
  
Changed paths:
U   php/php-src/trunk/NEWS
U   php/php-src/trunk/ext/openssl/xp_ssl.c

Modified: php/php-src/trunk/NEWS
===
--- php/php-src/trunk/NEWS  2010-12-03 09:11:31 UTC (rev 305935)
+++ php/php-src/trunk/NEWS  2010-12-03 09:34:35 UTC (rev 305936)
@@ -152,6 +152,8 @@

 - Improved OpenSSL extension:
   . Added AES support. FR #48632. (yonas dot y at gmail dot com, Pierre)
+  . Added a no_ticket SSL context option to disable the SessionTicket TLS
+extension. FR #53447. (Adam)

 - Improved PDO DB-LIB: (Stanley)
   . Added nextRowset support.

Modified: php/php-src/trunk/ext/openssl/xp_ssl.c
===
--- php/php-src/trunk/ext/openssl/xp_ssl.c  2010-12-03 09:11:31 UTC (rev 
305935)
+++ php/php-src/trunk/ext/openssl/xp_ssl.c  2010-12-03 09:34:35 UTC (rev 
305936)
@@ -369,6 +369,18 @@

SSL_CTX_set_options(sslsock-ctx, SSL_OP_ALL);

+#if OPENSSL_VERSION_NUMBER = 0x0090806fL
+   {
+   zval **val;
+
+   if (SUCCESS == php_stream_context_get_option(
+   stream-context, ssl, no_ticket, 
val) 
+   zval_is_true(*val)) {
+   SSL_CTX_set_options(sslsock-ctx, SSL_OP_NO_TICKET);
+   }
+   }
+#endif
+
sslsock-ssl_handle = php_SSL_new_from_context(sslsock-ctx, stream 
TSRMLS_CC);
if (sslsock-ssl_handle == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, failed to create 
an SSL handle);

-- 
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 ext/standard/math.c ext/standard/php_math.h ext/standard/tests/math/number_format_multichar.phpt

2010-12-03 Thread Adam Harvey
aharvey  Fri, 03 Dec 2010 10:10:08 +

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

Log:
Implement FR #53457 (number_format must support more than one character for
thousands separator).

Bug: http://bugs.php.net/53457 (Assigned) number_format must support more than 
one character for thousands separator
  
Changed paths:
U   php/php-src/trunk/NEWS
U   php/php-src/trunk/UPGRADING
U   php/php-src/trunk/ext/standard/math.c
U   php/php-src/trunk/ext/standard/php_math.h
A   php/php-src/trunk/ext/standard/tests/math/number_format_multichar.phpt

Modified: php/php-src/trunk/NEWS
===
--- php/php-src/trunk/NEWS  2010-12-03 09:34:35 UTC (rev 305936)
+++ php/php-src/trunk/NEWS  2010-12-03 10:10:08 UTC (rev 305937)
@@ -112,6 +112,10 @@
 getallheaders(), apache_request_headers() and apache_response_headers()
   . Improved performance of FastCGI request parsing.

+- Improved core functions:
+  . number_format() no longer truncates multibyte decimal points and thousand
+separators to the first byte. FR #53457. (Adam)
+
 - Improved CURL extension:
   . Added support for CURLOPT_MAX_RECV_SPEED_LARGE and
 CURLOPT_MAX_SEND_SPEED_LARGE. FR #51815. (Pierrick)

Modified: php/php-src/trunk/UPGRADING
===
--- php/php-src/trunk/UPGRADING 2010-12-03 09:34:35 UTC (rev 305936)
+++ php/php-src/trunk/UPGRADING 2010-12-03 10:10:08 UTC (rev 305937)
@@ -133,6 +133,8 @@
   behavior follows the recommendations of Unicode Technical Report #36.
 - htmlspecialchars_decode/html_entity_decode now decode apos; if the document
   type is ENT_XML1, ENT_XHTML, or ENT_HTML5.
+- number_format() no longer truncates multibyte decimal points and thousand
+  separators to the first byte.
 - The third parameter ($matches) to preg_match_all() is now optional. If
   omitted, the function will simply return the number of times the pattern was
   matched in the subject and will have no other side effects.

Modified: php/php-src/trunk/ext/standard/math.c
===
--- php/php-src/trunk/ext/standard/math.c   2010-12-03 09:34:35 UTC (rev 
305936)
+++ php/php-src/trunk/ext/standard/math.c   2010-12-03 10:10:08 UTC (rev 
305937)
@@ -1082,6 +1082,11 @@
 */
 PHPAPI char *_php_math_number_format(double d, int dec, char dec_point, char 
thousand_sep)
 {
+   return _php_math_number_format_ex(d, dec, dec_point, 1, thousand_sep, 
1);
+}
+
+PHPAPI char *_php_math_number_format_ex(double d, int dec, char *dec_point, 
size_t dec_point_len, char *thousand_sep, size_t thousand_sep_len)
+{
char *tmpbuf = NULL, *resbuf;
char *s, *t;  /* source, target */
char *dp;
@@ -1121,7 +1126,7 @@

/* allow for thousand separators */
if (thousand_sep) {
-   integral += (integral-1) / 3;
+   integral += thousand_sep_len * ((integral-1) / 3);
}

reslen = integral;
@@ -1130,7 +1135,7 @@
reslen += dec;

if (dec_point) {
-   reslen++;
+   reslen += dec_point_len;
}
}

@@ -1166,7 +1171,8 @@

/* add decimal point */
if (dec_point) {
-   *t-- = dec_point;
+   t -= dec_point_len;
+   memcpy(t + 1, dec_point, dec_point_len);
}
}

@@ -1175,7 +1181,8 @@
while(s = tmpbuf) {
*t-- = *s--;
if (thousand_sep  (++count%3)==0  s=tmpbuf) {
-   *t-- = thousand_sep;
+   t -= thousand_sep_len;
+   memcpy(t + 1, thousand_sep, thousand_sep_len);
}
}

@@ -1212,21 +1219,17 @@
RETURN_STRING(_php_math_number_format(num, dec, dec_point_chr, 
thousand_sep_chr), 0);
break;
case 4:
-   if (dec_point != NULL) {
-   if (dec_point_len) {
-   dec_point_chr = dec_point[0];
-   } else {
-   dec_point_chr = 0;
-   }
+   if (dec_point == NULL) {
+   dec_point = dec_point_chr;
+   dec_point_len = 1;
}
-   if (thousand_sep != NULL) {
-   if (thousand_sep_len) {
-   thousand_sep_chr = thousand_sep[0];
-   } else {
-   thousand_sep_chr = 0;
-   }
+
+   if (thousand_sep == NULL) {
+   thousand_sep = thousand_sep_chr;
+   thousand_sep_len = 1;
}
-   RETURN_STRING(_php_math_number_format(num, dec, 

[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/main/ output.c

2010-12-03 Thread Jani Taskinen
jani Fri, 03 Dec 2010 13:20:13 +

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

Log:
- Fix leaks and crash bug when passing the callback as variable

Changed paths:
U   php/php-src/branches/PHP_5_3/main/output.c

Modified: php/php-src/branches/PHP_5_3/main/output.c
===
--- php/php-src/branches/PHP_5_3/main/output.c  2010-12-03 10:15:06 UTC (rev 
305938)
+++ php/php-src/branches/PHP_5_3/main/output.c  2010-12-03 13:20:13 UTC (rev 
305939)
@@ -745,7 +745,7 @@
long chunk_size=0;
zend_bool erase=1;

-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |zlb, 
output_handler, chunk_size, erase) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |z/lb, 
output_handler, chunk_size, erase) == FAILURE) {
return;
}


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

Re: [PHP-CVS] svn: /php/php-src/branches/PHP_5_3/main/ output.c

2010-12-03 Thread Johannes Schlüter
Test? :-)

And thanks for the fix.

On Fri, 2010-12-03 at 13:20 +, Jani Taskinen wrote:
 jani Fri, 03 Dec 2010 13:20:13 +
 
 Revision: http://svn.php.net/viewvc?view=revisionrevision=305939
 
 Log:
 - Fix leaks and crash bug when passing the callback as variable
 
 Changed paths:
 U   php/php-src/branches/PHP_5_3/main/output.c
 
 Modified: php/php-src/branches/PHP_5_3/main/output.c
 ===
 --- php/php-src/branches/PHP_5_3/main/output.c2010-12-03 10:15:06 UTC 
 (rev 305938)
 +++ php/php-src/branches/PHP_5_3/main/output.c2010-12-03 13:20:13 UTC 
 (rev 305939)
 @@ -745,7 +745,7 @@
   long chunk_size=0;
   zend_bool erase=1;
 
 - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |zlb, 
 output_handler, chunk_size, erase) == FAILURE) {
 + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |z/lb, 
 output_handler, chunk_size, erase) == FAILURE) {
   return;
   }
 
 
 -- 
 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/tests/output/ ob_start_callbacks.phpt

2010-12-03 Thread Jani Taskinen
jani Fri, 03 Dec 2010 15:29:53 +

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

Log:
- Add test for the ob_start($foo); leak/crash bug

Changed paths:
A   php/php-src/trunk/tests/output/ob_start_callbacks.phpt

Added: php/php-src/trunk/tests/output/ob_start_callbacks.phpt
===
--- php/php-src/trunk/tests/output/ob_start_callbacks.phpt  
(rev 0)
+++ php/php-src/trunk/tests/output/ob_start_callbacks.phpt  2010-12-03 
15:29:53 UTC (rev 305944)
@@ -0,0 +1,39 @@
+--TEST--
+Test ob_start() with callbacks in variables
+--FILE--
+?php
+
+// Closure in variable
+$a = function ($s) { return strtoupper($s); };
+ob_start($a);
+echo 'closure in variable', \n;
+ob_end_flush();
+
+// Object (array) in variable
+class foo {
+   static function out($foo) {
+   return strtoupper($foo);
+   }
+}
+$a = array('foo', 'out');
+ob_start($a);
+echo 'object in variable', \n;
+ob_end_flush();
+
+// Object with static array
+ob_start(array('foo', 'out'));
+echo 'object via static array', \n;
+ob_end_flush();
+
+function my_strtoupper($foo, $bar) {
+   return strtoupper($foo);
+}
+$a = 'my_strtoupper';
+ob_start($a);
+echo 'function via variable', \n;
+ob_end_flush();
+--EXPECT--
+CLOSURE IN VARIABLE
+OBJECT IN VARIABLE
+OBJECT VIA STATIC ARRAY
+FUNCTION VIA VARIABLE

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

[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/tests/output/ ob_start_callbacks.phpt

2010-12-03 Thread Jani Taskinen
jani Fri, 03 Dec 2010 15:30:21 +

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

Log:
- Add test for the ob_start($foo); leak/crash bug

Changed paths:
A   php/php-src/branches/PHP_5_3/tests/output/ob_start_callbacks.phpt

Added: php/php-src/branches/PHP_5_3/tests/output/ob_start_callbacks.phpt
===
--- php/php-src/branches/PHP_5_3/tests/output/ob_start_callbacks.phpt   
(rev 0)
+++ php/php-src/branches/PHP_5_3/tests/output/ob_start_callbacks.phpt   
2010-12-03 15:30:21 UTC (rev 305945)
@@ -0,0 +1,39 @@
+--TEST--
+Test ob_start() with callbacks in variables
+--FILE--
+?php
+
+// Closure in variable
+$a = function ($s) { return strtoupper($s); };
+ob_start($a);
+echo 'closure in variable', \n;
+ob_end_flush();
+
+// Object (array) in variable
+class foo {
+   static function out($foo) {
+   return strtoupper($foo);
+   }
+}
+$a = array('foo', 'out');
+ob_start($a);
+echo 'object in variable', \n;
+ob_end_flush();
+
+// Object with static array
+ob_start(array('foo', 'out'));
+echo 'object via static array', \n;
+ob_end_flush();
+
+function my_strtoupper($foo, $bar) {
+   return strtoupper($foo);
+}
+$a = 'my_strtoupper';
+ob_start($a);
+echo 'function via variable', \n;
+ob_end_flush();
+--EXPECT--
+CLOSURE IN VARIABLE
+OBJECT IN VARIABLE
+OBJECT VIA STATIC ARRAY
+FUNCTION VIA VARIABLE

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

[PHP-CVS] svn: /php/php-src/trunk/tests/output/ ob_start_basic_005.phpt

2010-12-03 Thread Jani Taskinen
jani Fri, 03 Dec 2010 15:30:54 +

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

Log:
- Fix test

Changed paths:
U   php/php-src/trunk/tests/output/ob_start_basic_005.phpt

Modified: php/php-src/trunk/tests/output/ob_start_basic_005.phpt
===
--- php/php-src/trunk/tests/output/ob_start_basic_005.phpt  2010-12-03 
15:30:21 UTC (rev 305945)
+++ php/php-src/trunk/tests/output/ob_start_basic_005.phpt  2010-12-03 
15:30:54 UTC (rev 305946)
@@ -25,9 +25,9 @@

 ?
 --EXPECTF--
-Strict Standards: Non-static method C::h() should not be called statically in 
%s on line 20
+Warning: ob_start(): non-static method C::h() should not be called statically 
in %s on line 20
 bool(true)
 Array
 (
 [0] = C::h
-)
\ No newline at end of file
+)

-- 
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/output.c tests/output/ob_start_basic_006.phpt tests/output/ob_start_error_001.phpt

2010-12-03 Thread Jani Taskinen
jani Fri, 03 Dec 2010 15:34:24 +

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

Log:
- CS and de-facto style of returning NULL for failing parse-params, sync 
partially with PHP_5_3 too (reordering part :)

Changed paths:
U   php/php-src/trunk/main/output.c
U   php/php-src/trunk/tests/output/ob_start_basic_006.phpt
U   php/php-src/trunk/tests/output/ob_start_error_001.phpt

Modified: php/php-src/trunk/main/output.c
===
--- php/php-src/trunk/main/output.c	2010-12-03 15:30:54 UTC (rev 305946)
+++ php/php-src/trunk/main/output.c	2010-12-03 15:34:24 UTC (rev 305947)
@@ -78,7 +78,7 @@
 /* }}} */

 /* {{{ static void php_output_init_globals(zend_output_globals *G)
-	Initialize the module globals on MINIT */
+ * Initialize the module globals on MINIT */
 static inline void php_output_init_globals(zend_output_globals *G)
 {
 	memset(G, 0, sizeof(*G));
@@ -86,7 +86,7 @@
 /* }}} */

 /* {{{ void php_output_startup(void)
-	Set up module globals and initalize the conflict and reverse conflict hash tables */
+ * Set up module globals and initalize the conflict and reverse conflict hash tables */
 PHPAPI void php_output_startup(void)
 {
 	ZEND_INIT_MODULE_GLOBALS(output, php_output_init_globals, NULL);
@@ -97,7 +97,7 @@
 /* }}} */

 /* {{{ void php_output_shutdown(void)
-	Destroy module globals and the conflict and reverse conflict hash tables */
+ * Destroy module globals and the conflict and reverse conflict hash tables */
 PHPAPI void php_output_shutdown(void)
 {
 	zend_hash_destroy(php_output_handler_aliases);
@@ -107,7 +107,7 @@
 /* }}} */

 /* {{{ SUCCESS|FAILURE php_output_activate(TSRMLS_D)
-	Reset output globals and setup the output handler stack */
+ * Reset output globals and setup the output handler stack */
 PHPAPI int php_output_activate(TSRMLS_D)
 {
 #ifdef ZTS
@@ -115,22 +115,22 @@
 #else
 	memset(output_globals, 0, sizeof(zend_output_globals));
 #endif
-
+
 	zend_stack_init(OG(handlers));
-
+
 	return SUCCESS;
 }
 /* }}} */

 /* {{{ void php_output_deactivate(TSRMLS_D)
-	Destroy the output handler stack */
+ * Destroy the output handler stack */
 PHPAPI void php_output_deactivate(TSRMLS_D)
 {
 	php_output_handler **handler = NULL;
-
+
 	OG(active) = NULL;
 	OG(running) = NULL;
-
+
 	/* release all output handlers */
 	if (OG(handlers).elements) {
 		while (SUCCESS == zend_stack_top(OG(handlers), (void *) handler)) {
@@ -163,7 +163,7 @@
 /* }}} */

 /* {{{ void php_output_set_status(int status TSRMLS_DC)
-	Used by SAPIs to disable output */
+ * Used by SAPIs to disable output */
 PHPAPI void php_output_set_status(int status TSRMLS_DC)
 {
 	OG(flags) = status  0xf;
@@ -171,7 +171,7 @@
 /* }}} */

 /* {{{ int php_output_get_status(TSRMLS_C)
-	Get output control status */
+ * Get output control status */
 PHPAPI int php_output_get_status(TSRMLS_D)
 {
 	return OG(flags)
@@ -181,7 +181,7 @@
 /* }}} */

 /* {{{ int php_output_write_unbuffered(const char *str, size_t len TSRMLS_DC)
-	Unbuffered write */
+ * Unbuffered write */
 PHPAPI int php_output_write_unbuffered(const char *str, size_t len TSRMLS_DC)
 {
 	if (OG(flags)  PHP_OUTPUT_DISABLED) {
@@ -192,7 +192,7 @@
 /* }}} */

 /* {{{ int php_output_write(const char *str, size_t len TSRMLS_DC)
-	Buffered write */
+ * Buffered write */
 PHPAPI int php_output_write(const char *str, size_t len TSRMLS_DC)
 {
 	if (OG(flags)  PHP_OUTPUT_DISABLED) {
@@ -204,11 +204,11 @@
 /* }}} */

 /* {{{ SUCCESS|FAILURE php_output_flush(TSRMLS_D)
-	Flush the most recent output handlers buffer */
+ * Flush the most recent output handlers buffer */
 PHPAPI int php_output_flush(TSRMLS_D)
 {
 	php_output_context context;
-
+
 	if (OG(active)  (OG(active)-flags  PHP_OUTPUT_HANDLER_FLUSHABLE)) {
 		php_output_context_init(context, PHP_OUTPUT_HANDLER_FLUSH TSRMLS_CC);
 		php_output_handler_op(OG(active), context);
@@ -225,7 +225,7 @@
 /* }}} */

 /* {{{ void php_output_flush_all(TSRMLS_C)
-	Flush all output buffers subsequently */
+ * Flush all output buffers subsequently */
 PHPAPI void php_output_flush_all(TSRMLS_D)
 {
 	if (OG(active)) {
@@ -235,11 +235,11 @@
 /* }}} */

 /* {{{ SUCCESS|FAILURE php_output_clean(TSRMLS_D)
-	Cleans the most recent output handlers buffer if the handler is cleanable */
+ * Cleans the most recent output handlers buffer if the handler is cleanable */
 PHPAPI int php_output_clean(TSRMLS_D)
 {
 	php_output_context context;
-
+
 	if (OG(active)  (OG(active)-flags  PHP_OUTPUT_HANDLER_CLEANABLE)) {
 		OG(active)-buffer.used = 0;
 		php_output_context_init(context, PHP_OUTPUT_HANDLER_CLEAN TSRMLS_CC);
@@ -252,11 +252,11 @@
 /* }}} */

 /* {{{ void php_output_clean_all(TSRMLS_D)
-	Cleans all output handler buffers, without regard whether the handler is cleanable */
+ * Cleans all output handler buffers, without regard whether the handler is cleanable */
 PHPAPI void php_output_clean_all(TSRMLS_D)
 {
 	php_output_context context;

Re: [PHP-CVS] svn: /php/php-src/branches/PHP_5_3/main/ output.c

2010-12-03 Thread Jani Taskinen
Done.

--Jani

On Dec 3, 2010, at 3:39 PM, Johannes Schlüter wrote:

 Test? :-)
 
 And thanks for the fix.
 
 On Fri, 2010-12-03 at 13:20 +, Jani Taskinen wrote:
 jani Fri, 03 Dec 2010 13:20:13 +
 
 Revision: http://svn.php.net/viewvc?view=revisionrevision=305939
 
 Log:
 - Fix leaks and crash bug when passing the callback as variable
 
 Changed paths:
U   php/php-src/branches/PHP_5_3/main/output.c
 
 Modified: php/php-src/branches/PHP_5_3/main/output.c
 ===
 --- php/php-src/branches/PHP_5_3/main/output.c   2010-12-03 10:15:06 UTC 
 (rev 305938)
 +++ php/php-src/branches/PHP_5_3/main/output.c   2010-12-03 13:20:13 UTC 
 (rev 305939)
 @@ -745,7 +745,7 @@
  long chunk_size=0;
  zend_bool erase=1;
 
 -if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |zlb, 
 output_handler, chunk_size, erase) == FAILURE) {
 +if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |z/lb, 
 output_handler, chunk_size, erase) == FAILURE) {
  return;
  }
 
 
 -- 
 PHP CVS Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


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



[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/standard/tests/general_functions/bug44394_2.phpt trunk/ext/standard/tests/general_functions/bug44394_2.phpt

2010-12-03 Thread Jani Taskinen
jani Fri, 03 Dec 2010 16:02:47 +

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

Log:
- Fix test

Changed paths:
U   
php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/bug44394_2.phpt
U   php/php-src/trunk/ext/standard/tests/general_functions/bug44394_2.phpt

Modified: 
php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/bug44394_2.phpt
===
--- 
php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/bug44394_2.phpt
   2010-12-03 16:00:26 UTC (rev 305948)
+++ 
php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/bug44394_2.phpt
   2010-12-03 16:02:47 UTC (rev 305949)
@@ -4,6 +4,7 @@
 ?php if (!extension_loaded(session)) print skip; ?
 --INI--
 session.name=PHPSESSID
+session.use_only_cookies=0
 --FILE--
 ?php


Modified: php/php-src/trunk/ext/standard/tests/general_functions/bug44394_2.phpt
===
--- php/php-src/trunk/ext/standard/tests/general_functions/bug44394_2.phpt  
2010-12-03 16:00:26 UTC (rev 305948)
+++ php/php-src/trunk/ext/standard/tests/general_functions/bug44394_2.phpt  
2010-12-03 16:02:47 UTC (rev 305949)
@@ -4,6 +4,7 @@
 ?php if (!extension_loaded(session)) print skip; ?
 --INI--
 session.name=PHPSESSID
+session.use_only_cookies=0
 --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/branches/PHP_5_3/ main/output.c tests/output/bug46897.phpt tests/output/ob_clean_basic_001.phpt tests/output/ob_end_clean_basic_001.phpt tests/output/ob_end_flush_basic_001

2010-12-03 Thread Jani Taskinen
jani Fri, 03 Dec 2010 16:04:24 +

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

Log:
- CS + reorder to match trunk better, removed trailing dots from error messages

Changed paths:
U   php/php-src/branches/PHP_5_3/main/output.c
U   php/php-src/branches/PHP_5_3/tests/output/bug46897.phpt
U   php/php-src/branches/PHP_5_3/tests/output/ob_clean_basic_001.phpt
U   php/php-src/branches/PHP_5_3/tests/output/ob_end_clean_basic_001.phpt
U   php/php-src/branches/PHP_5_3/tests/output/ob_end_flush_basic_001.phpt
U   php/php-src/branches/PHP_5_3/tests/output/ob_flush_basic_001.phpt
U   php/php-src/branches/PHP_5_3/tests/output/ob_get_level_basic_001.phpt
U   
php/php-src/branches/PHP_5_3/tests/output/ob_start_basic_unerasable_002.phpt
U   
php/php-src/branches/PHP_5_3/tests/output/ob_start_basic_unerasable_003.phpt
U   
php/php-src/branches/PHP_5_3/tests/output/ob_start_basic_unerasable_004.phpt
U   
php/php-src/branches/PHP_5_3/tests/output/ob_start_basic_unerasable_005.phpt

Modified: php/php-src/branches/PHP_5_3/main/output.c
===
--- php/php-src/branches/PHP_5_3/main/output.c	2010-12-03 16:02:47 UTC (rev 305949)
+++ php/php-src/branches/PHP_5_3/main/output.c	2010-12-03 16:04:24 UTC (rev 305950)
@@ -1,4 +1,4 @@
-/*
+/*
+--+
| PHP Version 5|
+--+
@@ -61,7 +61,7 @@
 /* {{{ php_output_init_globals */
 static void php_output_init_globals(php_output_globals *output_globals_p TSRMLS_DC)
 {
- 	OG(php_body_write) = php_default_output_func;
+	OG(php_body_write) = php_default_output_func;
 	OG(php_header_write) = php_default_output_func;
 	OG(implicit_flush) = 0;
 	OG(output_start_filename) = NULL;
@@ -69,22 +69,20 @@
 }
 /* }}} */

-
 /* {{{ php_output_startup
-   Start output layer */
+ * Start output layer */
 PHPAPI void php_output_startup(void)
 {
 #ifdef ZTS
 	ts_allocate_id(output_globals_id, sizeof(php_output_globals), (ts_allocate_ctor) php_output_init_globals, NULL);
-#else
+#else
 	php_output_init_globals(output_globals TSRMLS_CC);
 #endif
 }
 /* }}} */

-
 /* {{{ php_output_activate
-   Initilize output global for activation */
+ * Initilize output global for activation */
 PHPAPI void php_output_activate(TSRMLS_D)
 {
 	OG(php_body_write) = php_ub_body_write;
@@ -97,15 +95,6 @@
 }
 /* }}} */

-
-/* {{{ php_output_set_status
-   Toggle output status.  Do NOT use in application code, only in SAPIs where appropriate. */
-PHPAPI void php_output_set_status(zend_bool status TSRMLS_DC)
-{
-	OG(disable_output) = !status;
-}
-/* }}} */
-
 /* {{{ php_output_register_constants */
 void php_output_register_constants(TSRMLS_D)
 {
@@ -115,12 +104,19 @@
 }
 /* }}} */

+/* {{{ php_output_set_status
+ * Toggle output status.  Do NOT use in application code, only in SAPIs where appropriate. */
+PHPAPI void php_output_set_status(zend_bool status TSRMLS_DC)
+{
+	OG(disable_output) = !status;
+}
+/* }}} */

 /* {{{ php_body_write
  * Write body part */
 PHPAPI int php_body_write(const char *str, uint str_length TSRMLS_DC)
 {
-	return OG(php_body_write)(str, str_length TSRMLS_CC);
+	return OG(php_body_write)(str, str_length TSRMLS_CC);
 }
 /* }}} */

@@ -219,7 +215,7 @@
 	 fclose(fp);
  }
 #endif
-
+
 	if (OG(active_ob_buffer).internal_output_handler) {
 		final_buffer = OG(active_ob_buffer).internal_output_handler_buffer;
 		final_buffer_length = OG(active_ob_buffer).internal_output_handler_buffer_size;
@@ -343,7 +339,7 @@
  */
 PHPAPI void php_start_implicit_flush(TSRMLS_D)
 {
-	OG(implicit_flush)=1;
+	OG(implicit_flush) = 1;
 }
 /* }}} */

@@ -351,15 +347,31 @@
  */
 PHPAPI void php_end_implicit_flush(TSRMLS_D)
 {
-	OG(implicit_flush)=0;
+	OG(implicit_flush) = 0;
 }
 /* }}} */

+/* {{{ char *php_get_output_start_filename(TSRMLS_D)
+ *  Return filename start output something */
+PHPAPI char *php_get_output_start_filename(TSRMLS_D)
+{
+	return OG(output_start_filename);
+}
+/* }}} */
+
+/* {{{ char *php_get_output_start_lineno(TSRMLS_D)
+ * Return line number start output something */
+PHPAPI int php_get_output_start_lineno(TSRMLS_D)
+{
+	return OG(output_start_lineno);
+}
+/* }}} */
+
 /* {{{ php_ob_set_internal_handler
  */
 PHPAPI void php_ob_set_internal_handler(php_output_handler_func_t internal_output_handler, uint buffer_size, char *handler_name, zend_bool erase TSRMLS_DC)
 {
-	if (OG(ob_nesting_level)==0 || OG(active_ob_buffer).internal_output_handler || strcmp(OG(active_ob_buffer).handler_name, OB_DEFAULT_HANDLER_NAME)) {
+	if (OG(ob_nesting_level) == 0 || OG(active_ob_buffer).internal_output_handler || strcmp(OG(active_ob_buffer).handler_name, OB_DEFAULT_HANDLER_NAME)) {
 		php_start_ob_buffer(NULL, buffer_size, erase TSRMLS_CC);
 	}

@@ -398,8 +410,7 @@
 /* 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/sqlite3/sqlite3.c branches/PHP_5_3/ext/sqlite3/tests/bug53463.phpt trunk/ext/sqlite3/sqlite3.c trunk/ext/sqlite3/tests/bug53463.

2010-12-03 Thread Felipe Pena
felipe   Fri, 03 Dec 2010 21:05:44 +

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

Log:
- Fixed bug #53463 (sqlite3 columnName() segfaults on bad column_number)

Bug: http://bugs.php.net/53463 (Open) sqlite3 columnName() segfaults on bad 
column_number
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/sqlite3/sqlite3.c
A   php/php-src/branches/PHP_5_3/ext/sqlite3/tests/bug53463.phpt
U   php/php-src/trunk/ext/sqlite3/sqlite3.c
A   php/php-src/trunk/ext/sqlite3/tests/bug53463.phpt

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2010-12-03 16:38:03 UTC (rev 305953)
+++ php/php-src/branches/PHP_5_3/NEWS   2010-12-03 21:05:44 UTC (rev 305954)
@@ -1,6 +1,9 @@
 PHP
NEWS
 |||
 ?? Dec 2010, PHP 5.3.4
+- SQLite3 extension:
+  . Fixed bug #53463 (sqlite3 columnName() segfaults on bad column_number).
+(Felipe)

 02 Dec 2010, PHP 5.3.4RC2
 - Core:

Modified: php/php-src/branches/PHP_5_3/ext/sqlite3/sqlite3.c
===
--- php/php-src/branches/PHP_5_3/ext/sqlite3/sqlite3.c  2010-12-03 16:38:03 UTC 
(rev 305953)
+++ php/php-src/branches/PHP_5_3/ext/sqlite3/sqlite3.c  2010-12-03 21:05:44 UTC 
(rev 305954)
@@ -1532,6 +1532,7 @@
php_sqlite3_result *result_obj;
zval *object = getThis();
long column = 0;
+   char *column_name;
result_obj = (php_sqlite3_result *)zend_object_store_get_object(object 
TSRMLS_CC);

SQLITE3_CHECK_INITIALIZED(result_obj-db_obj, 
result_obj-stmt_obj-initialised, SQLite3Result)
@@ -1539,8 +1540,13 @@
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, l, column) == 
FAILURE) {
return;
}
+   column_name = (char*) sqlite3_column_name(result_obj-stmt_obj-stmt, 
column);

-   RETVAL_STRING((char*)sqlite3_column_name(result_obj-stmt_obj-stmt, 
column), 1);
+   if (column_name == NULL) {
+   RETURN_FALSE;
+   }
+
+   RETVAL_STRING(column_name, 1);
 }
 /* }}} */


Added: php/php-src/branches/PHP_5_3/ext/sqlite3/tests/bug53463.phpt
===
--- php/php-src/branches/PHP_5_3/ext/sqlite3/tests/bug53463.phpt
(rev 0)
+++ php/php-src/branches/PHP_5_3/ext/sqlite3/tests/bug53463.phpt
2010-12-03 21:05:44 UTC (rev 305954)
@@ -0,0 +1,28 @@
+--TEST--
+Bug #53463 (sqlite3 columnName() segfaults on bad column_number)
+--FILE--
+?php
+
+$db = new SQLite3(':memory:');
+
+$db-exec('CREATE TABLE test (whatever INTEGER)');
+$db-exec('INSERT INTO test (whatever) VALUES (1)');
+
+$result = $db-query('SELECT * FROM test');
+while ($row = $result-fetchArray(SQLITE3_NUM)) {
+var_dump($result-columnName(0));  // string(8) whatever
+
+// Seems returning false will be most appropriate.
+var_dump($result-columnName(3));  // Segmentation fault
+}
+
+$result-finalize();
+$db-close();
+
+echo Done\n;
+
+?
+--EXPECT--
+string(8) whatever
+bool(false)
+Done
\ No newline at end of file


Property changes on: 
php/php-src/branches/PHP_5_3/ext/sqlite3/tests/bug53463.phpt
___
Added: svn:keywords
   + Id Rev Revision
Added: svn:eol-style
   + native

Modified: php/php-src/trunk/ext/sqlite3/sqlite3.c
===
--- php/php-src/trunk/ext/sqlite3/sqlite3.c 2010-12-03 16:38:03 UTC (rev 
305953)
+++ php/php-src/trunk/ext/sqlite3/sqlite3.c 2010-12-03 21:05:44 UTC (rev 
305954)
@@ -1529,6 +1529,7 @@
php_sqlite3_result *result_obj;
zval *object = getThis();
long column = 0;
+   char *column_name;
result_obj = (php_sqlite3_result *)zend_object_store_get_object(object 
TSRMLS_CC);

SQLITE3_CHECK_INITIALIZED(result_obj-db_obj, 
result_obj-stmt_obj-initialised, SQLite3Result)
@@ -1536,8 +1537,13 @@
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, l, column) == 
FAILURE) {
return;
}
+   column_name = (char*) sqlite3_column_name(result_obj-stmt_obj-stmt, 
column);

-   RETVAL_STRING((char*)sqlite3_column_name(result_obj-stmt_obj-stmt, 
column), 1);
+   if (column_name == NULL) {
+   RETURN_FALSE;
+   }
+
+   RETVAL_STRING(column_name, 1);
 }
 /* }}} */


Added: php/php-src/trunk/ext/sqlite3/tests/bug53463.phpt
===
--- php/php-src/trunk/ext/sqlite3/tests/bug53463.phpt   
(rev 0)
+++ php/php-src/trunk/ext/sqlite3/tests/bug53463.phpt   2010-12-03 21:05:44 UTC 
(rev 305954)
@@ -0,0 +1,28 @@

[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ NEWS

2010-12-03 Thread Felipe Pena
felipe   Fri, 03 Dec 2010 21:09:47 +

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

Log:
- Order

Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2010-12-03 21:05:44 UTC (rev 305954)
+++ php/php-src/branches/PHP_5_3/NEWS   2010-12-03 21:09:47 UTC (rev 305955)
@@ -9,10 +9,10 @@
 - Core:
   . Fixed extract() to do not overwrite $GLOBALS and $this when using
 EXTR_OVERWRITE. (jorto at redhat dot com)
+  . Fixed bug #53304 (quot_print_decode does not handle lower-case hex digits).
+(Ilia, daniel dot mueller at inexio dot net)
   . Fixed bug #52327 (base64_decode() improper handling of leading padding in
 strict mode). (Ilia)
-  . Fixed bug #53304 (quot_print_decode does not handle lower-case hex digits).
-(Ilia, daniel dot mueller at inexio dot net)
   . Fixed bug #47168 (printf of floating point variable prints maximum of 40
 decimal places). (Ilia)
   . Fixed bug #46587 (mt_rand() does not check that max is greater than min).

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/pdo/tests/bug_43139.phpt trunk/ext/pdo/tests/bug_43139.phpt

2010-12-03 Thread Felipe Pena
felipe   Fri, 03 Dec 2010 22:58:21 +

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

Log:
- Fixed test

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/pdo/tests/bug_43139.phpt
U   php/php-src/trunk/ext/pdo/tests/bug_43139.phpt

Modified: php/php-src/branches/PHP_5_3/ext/pdo/tests/bug_43139.phpt
===
--- php/php-src/branches/PHP_5_3/ext/pdo/tests/bug_43139.phpt   2010-12-03 
22:10:47 UTC (rev 305957)
+++ php/php-src/branches/PHP_5_3/ext/pdo/tests/bug_43139.phpt   2010-12-03 
22:58:21 UTC (rev 305958)
@@ -17,7 +17,12 @@
 $db-setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
 $db-setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);

-var_dump($db-query('select 0 as abc, 1 as xyz, 2 as 
def')-fetchAll(PDO::FETCH_GROUP));
+$from = '';
+if ($db-getAttribute(PDO::ATTR_DRIVER_NAME) == 'oci') {
+   $from = 'from dual';
+}
+
+var_dump($db-query(select 0 as abc, 1 as xyz, 2 as def 
$from)-fetchAll(PDO::FETCH_GROUP));
 ?
 --EXPECT--
 array(1) {

Modified: php/php-src/trunk/ext/pdo/tests/bug_43139.phpt
===
--- php/php-src/trunk/ext/pdo/tests/bug_43139.phpt  2010-12-03 22:10:47 UTC 
(rev 305957)
+++ php/php-src/trunk/ext/pdo/tests/bug_43139.phpt  2010-12-03 22:58:21 UTC 
(rev 305958)
@@ -17,7 +17,12 @@
 $db-setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
 $db-setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);

-var_dump($db-query('select 0 as abc, 1 as xyz, 2 as 
def')-fetchAll(PDO::FETCH_GROUP));
+$from = '';
+if ($db-getAttribute(PDO::ATTR_DRIVER_NAME) == 'oci') {
+   $from = 'from dual';
+}
+
+var_dump($db-query(select 0 as abc, 1 as xyz, 2 as def 
$from)-fetchAll(PDO::FETCH_GROUP));
 ?
 --EXPECT--
 array(1) {

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/pdo/tests/pdo_021.phpt trunk/ext/pdo/tests/pdo_021.phpt

2010-12-03 Thread Felipe Pena
felipe   Fri, 03 Dec 2010 23:25:27 +

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

Log:
- Fixed test

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/pdo/tests/pdo_021.phpt
U   php/php-src/trunk/ext/pdo/tests/pdo_021.phpt

Modified: php/php-src/branches/PHP_5_3/ext/pdo/tests/pdo_021.phpt
===
--- php/php-src/branches/PHP_5_3/ext/pdo/tests/pdo_021.phpt 2010-12-03 
22:58:21 UTC (rev 305958)
+++ php/php-src/branches/PHP_5_3/ext/pdo/tests/pdo_021.phpt 2010-12-03 
23:25:27 UTC (rev 305959)
@@ -41,8 +41,6 @@
 $num = $select-fetchColumn();
 echo 'There are ' . $num .  rows in the table.\n;

-$select-closeCursor();
-
 // Insert using named parameters
 $stmt2 = $db-prepare(INSERT INTO test VALUES(:first, :second, :third));
 foreach ($data as $row) {

Modified: php/php-src/trunk/ext/pdo/tests/pdo_021.phpt
===
--- php/php-src/trunk/ext/pdo/tests/pdo_021.phpt2010-12-03 22:58:21 UTC 
(rev 305958)
+++ php/php-src/trunk/ext/pdo/tests/pdo_021.phpt2010-12-03 23:25:27 UTC 
(rev 305959)
@@ -41,8 +41,6 @@
 $num = $select-fetchColumn();
 echo 'There are ' . $num .  rows in the table.\n;

-$select-closeCursor();
-
 // Insert using named parameters
 $stmt2 = $db-prepare(INSERT INTO test VALUES(:first, :second, :third));
 foreach ($data as $row) {

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