Re: [PHP-CVS] [git] karma.git branch master updated. 002a63c

2012-03-05 Thread Hannes Magnusson
On Sat, Mar 3, 2012 at 22:21,   wrote:
> The branch, master on karma.git has been updated
>       via  002a63c12dc1eadb3885d9fc5c6b97cf3863913a (commit)
>       via  f3d11575dc77ab1cc7eda290a4366122b923b1c1 (commit)
>       via  51ca66d43a28b1c50cfd4e994712bc577e440e52 (commit)
>       via  c358027fd70d57b60f12b620dc78f6fe7c384aec (commit)
>      from  8d595325d65b7de86651483a1705a0ee2a4b4bd5 (commit)
>
> http://git.php.net/?p=karma.git;a=log;h=002a63c12dc1eadb3885d9fc5c6b97cf3863913a;hp=8d595325d65b7de86651483a1705a0ee2a4b4bd5
>
> Summary of changes:
>  hooks/pre-receive           |   29 +-
>  lib/Git.php                 |   25 
>  lib/Git/PushInformation.php |   86 
> +++
>  lib/Git/ReceiveHook.php     |   43 +
>  4 files changed, 148 insertions(+), 35 deletions(-)
>  create mode 100644 lib/Git.php
>  create mode 100644 lib/Git/PushInformation.php
>
> -- Log 
> commit 002a63c12dc1eadb3885d9fc5c6b97cf3863913a
> Author: David Soria Parra 
> Date:   Fri Mar 2 03:06:30 2012 +0100
>
>    Require access to all the repository in case we do a forced push
>
>    A forced push can happen when you delete a tag or rewrite commits. We allow
>    this, but only if you have access to the root of the repository.
>
> diff --git a/hooks/pre-receive b/hooks/pre-receive
> index 46195a4..48da31b 100755
> --- a/hooks/pre-receive
> +++ b/hooks/pre-receive
> @@ -11,11 +11,15 @@ namespace Karma;
>
>  const KARMA_FILE = '/git/checkout/SVNROOT/global_avail';
>  const REPOSITORY_PATH = '/git/repositories';
> +const LIB_PATH = '/git/checkout/karma/lib';
>
> -set_include_path('/git/checkout/karma/lib' .
> +set_include_path(
> +    getenv('KARMA_LIB_PATH') ?: LIB_PATH .
>     PATH_SEPARATOR .
>     get_include_path());
>
> +include 'Git.php';
> +include 'Git/PushInformation.php';
>  include 'Git/ReceiveHook.php';
>
>  function deny($reason)
> @@ -107,16 +111,19 @@ if ($hook->isKarmaIgnored()) {
>     accept("No karma check necessary. Thank you for your contribution.\n");
>  }
>
> -$requested_paths = $hook->getReceivedPaths();
> +$repo_name = $hook->getRepositoryName();
> +$pi        = new \Git\PushInformation($hook);
> +$req_paths = ($pi->isForced()) ? [''] : $hook->getReceivedPaths();
> +var_dump($pi->isForced());


Are you debugging this script, or is this just a typo?

-Hannes

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



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

2012-03-05 Thread Xinchen Hui
laruence Tue, 06 Mar 2012 06:24:50 +

Revision: http://svn.php.net/viewvc?view=revision&revision=323936

Log:
Add test for bug #61292, bug was fixed in -r323935

Bug: https://bugs.php.net/61292 (Closed) Segfault while calling a method on an 
overloaded PDO object.
  
Changed paths:
A   php/php-src/branches/PHP_5_4/ext/pdo/tests/bug61292.phpt
A   php/php-src/trunk/ext/pdo/tests/bug61292.phpt

Added: php/php-src/branches/PHP_5_4/ext/pdo/tests/bug61292.phpt
===
--- php/php-src/branches/PHP_5_4/ext/pdo/tests/bug61292.phpt
(rev 0)
+++ php/php-src/branches/PHP_5_4/ext/pdo/tests/bug61292.phpt2012-03-06 
06:24:50 UTC (rev 323936)
@@ -0,0 +1,36 @@
+--TEST--
+Bug #61292 (Segfault while calling a method on an overloaded PDO object)
+--SKIPIF--
+
+--FILE--
+ TRUE);
+   parent::__construct(getenv("PDOTEST_DSN"), 
getenv("PDOTEST_USER"), getenv("PDOTEST_PASS"), $options);
+   }
+
+   var $bar = array();
+
+   public function foo()
+   {
+   var_dump($this->bar);
+   }
+}
+
+(new Database_SQL)->foo();
+?>
+--EXPECTF--
+array(0) {
+}

Added: php/php-src/trunk/ext/pdo/tests/bug61292.phpt
===
--- php/php-src/trunk/ext/pdo/tests/bug61292.phpt   
(rev 0)
+++ php/php-src/trunk/ext/pdo/tests/bug61292.phpt   2012-03-06 06:24:50 UTC 
(rev 323936)
@@ -0,0 +1,36 @@
+--TEST--
+Bug #61292 (Segfault while calling a method on an overloaded PDO object)
+--SKIPIF--
+
+--FILE--
+ TRUE);
+   parent::__construct(getenv("PDOTEST_DSN"), 
getenv("PDOTEST_USER"), getenv("PDOTEST_PASS"), $options);
+   }
+
+   var $bar = array();
+
+   public function foo()
+   {
+   var_dump($this->bar);
+   }
+}
+
+(new Database_SQL)->foo();
+?>
+--EXPECTF--
+array(0) {
+}

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/NEWS branches/PHP_5_4/ext/pdo/pdo_dbh.c trunk/ext/pdo/pdo_dbh.c

2012-03-05 Thread Xinchen Hui
laruence Tue, 06 Mar 2012 03:45:27 +

Revision: http://svn.php.net/viewvc?view=revision&revision=323935

Log:
Fixed bug #61292 (Segfault while calling a method on an overloaded PDO object)

Bug: https://bugs.php.net/61292 (Verified) Segfault while calling a method on 
an overloaded PDO object.
  
Changed paths:
U   php/php-src/branches/PHP_5_4/NEWS
U   php/php-src/branches/PHP_5_4/ext/pdo/pdo_dbh.c
U   php/php-src/trunk/ext/pdo/pdo_dbh.c

Modified: php/php-src/branches/PHP_5_4/NEWS
===
--- php/php-src/branches/PHP_5_4/NEWS   2012-03-06 02:21:04 UTC (rev 323934)
+++ php/php-src/branches/PHP_5_4/NEWS   2012-03-06 03:45:27 UTC (rev 323935)
@@ -49,6 +49,10 @@
   . Fixed bug #60887 (SoapClient ignores user_agent option and sends no
 User-Agent header). (carloschilazo at gmail dot com)

+- PDO
+  . Fixed bug #61292 (Segfault while calling a method on an overloaded PDO
+object). (Laruence)
+
 - PDO_mysql
   . Fixed bug #61207 (PDO::nextRowset() after a multi-statement query doesn't
 always work). (Johannes)

Modified: php/php-src/branches/PHP_5_4/ext/pdo/pdo_dbh.c
===
--- php/php-src/branches/PHP_5_4/ext/pdo/pdo_dbh.c  2012-03-06 02:21:04 UTC 
(rev 323934)
+++ php/php-src/branches/PHP_5_4/ext/pdo/pdo_dbh.c  2012-03-06 03:45:27 UTC 
(rev 323935)
@@ -343,6 +343,7 @@
pdbh->def_stmt_ce = dbh->def_stmt_ce;
pdbh->def_stmt_ctor_args = 
dbh->def_stmt_ctor_args;
pdbh->std.properties = dbh->std.properties;
+   pdbh->std.properties_table = 
dbh->std.properties_table;
}
/* kill the non-persistent thingamy */
efree(dbh);

Modified: php/php-src/trunk/ext/pdo/pdo_dbh.c
===
--- php/php-src/trunk/ext/pdo/pdo_dbh.c 2012-03-06 02:21:04 UTC (rev 323934)
+++ php/php-src/trunk/ext/pdo/pdo_dbh.c 2012-03-06 03:45:27 UTC (rev 323935)
@@ -343,6 +343,7 @@
pdbh->def_stmt_ce = dbh->def_stmt_ce;
pdbh->def_stmt_ctor_args = 
dbh->def_stmt_ctor_args;
pdbh->std.properties = dbh->std.properties;
+   pdbh->std.properties_table = 
dbh->std.properties_table;
}
/* kill the non-persistent thingamy */
efree(dbh);

-- 
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_mysql/tests/pdo_mysql___construct_options_libmysql.phpt branches/PHP_5_4/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt trunk/ext

2012-03-05 Thread Johannes Schlüter
johannes Tue, 06 Mar 2012 01:43:49 +

Revision: http://svn.php.net/viewvc?view=revision&revision=323932

Log:
Apply test fix for bug #61288 pdo_mysql___construct_options_libmysql.phpt test 
fails

Bug: https://bugs.php.net/61288 (Open) 
pdo_mysql___construct_options_libmysql.phpt test fails
  
Changed paths:
U   
php/php-src/branches/PHP_5_3/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt
U   
php/php-src/branches/PHP_5_4/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt
U   
php/php-src/trunk/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt

Modified: 
php/php-src/branches/PHP_5_3/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt
===
--- 
php/php-src/branches/PHP_5_3/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt
2012-03-06 00:15:40 UTC (rev 323931)
+++ 
php/php-src/branches/PHP_5_3/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt
2012-03-06 01:43:49 UTC (rev 323932)
@@ -4,6 +4,7 @@
 

Modified: 
php/php-src/branches/PHP_5_4/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt
===
--- 
php/php-src/branches/PHP_5_4/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt
2012-03-06 00:15:40 UTC (rev 323931)
+++ 
php/php-src/branches/PHP_5_4/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt
2012-03-06 01:43:49 UTC (rev 323932)
@@ -4,6 +4,7 @@
 

Modified: 
php/php-src/trunk/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt
===
--- 
php/php-src/trunk/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt
   2012-03-06 00:15:40 UTC (rev 323931)
+++ 
php/php-src/trunk/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt
   2012-03-06 01:43:49 UTC (rev 323932)
@@ -4,6 +4,7 @@
 

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

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

2012-03-05 Thread Johannes Schlüter
johannes Tue, 06 Mar 2012 00:15:40 +

Revision: http://svn.php.net/viewvc?view=revision&revision=323931

Log:
Fix bug #61003 mysql_stat() require a valid connection

Bug: https://bugs.php.net/61003 (Assigned) mysql_stat() require a valid 
connection
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/mysqli/mysqli_prop.c
U   php/php-src/branches/PHP_5_4/NEWS
U   php/php-src/branches/PHP_5_4/ext/mysqli/mysqli_prop.c
U   php/php-src/trunk/ext/mysqli/mysqli_prop.c

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2012-03-05 23:57:24 UTC (rev 323930)
+++ php/php-src/branches/PHP_5_3/NEWS   2012-03-06 00:15:40 UTC (rev 323931)
@@ -36,6 +36,9 @@
 - Firebird Database extension (ibase):
   . Fixed bug #60802 (ibase_trans() gives segfault when passing params).

+- mysqli
+  . Fixed bug #61003 (mysql_stat() require a valid connection). (Johannes).
+
 - PDO_mysql
   . Fixed bug #61207 (PDO::nextRowset() after a multi-statement query doesn't
 always work). (Johannes)

Modified: php/php-src/branches/PHP_5_3/ext/mysqli/mysqli_prop.c
===
--- php/php-src/branches/PHP_5_3/ext/mysqli/mysqli_prop.c   2012-03-05 
23:57:24 UTC (rev 323930)
+++ php/php-src/branches/PHP_5_3/ext/mysqli/mysqli_prop.c   2012-03-06 
00:15:40 UTC (rev 323931)
@@ -211,7 +211,11 @@
MAKE_STD_ZVAL(*retval);
ZVAL_NULL(*retval);

+#if defined(MYSQLI_USE_MYSQLND)
CHECK_STATUS(MYSQLI_STATUS_INITIALIZED);
+#else
+   CHECK_STATUS(MYSQLI_STATUS_VALID);
+#endif

mysql = (MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;


Modified: php/php-src/branches/PHP_5_4/NEWS
===
--- php/php-src/branches/PHP_5_4/NEWS   2012-03-05 23:57:24 UTC (rev 323930)
+++ php/php-src/branches/PHP_5_4/NEWS   2012-03-06 00:15:40 UTC (rev 323931)
@@ -38,6 +38,9 @@
 - mbstring:
   . MFH mb_ereg_replace_callback() for security enhancements. (Rui)

+- mysqli
+  . Fixed bug #61003 (mysql_stat() require a valid connection). (Johannes).
+
 - mysqlnd
   . Fixed bug #60948 (mysqlnd FTBFS when -Wformat-security is enabled).
 (Johannes)

Modified: php/php-src/branches/PHP_5_4/ext/mysqli/mysqli_prop.c
===
--- php/php-src/branches/PHP_5_4/ext/mysqli/mysqli_prop.c   2012-03-05 
23:57:24 UTC (rev 323930)
+++ php/php-src/branches/PHP_5_4/ext/mysqli/mysqli_prop.c   2012-03-06 
00:15:40 UTC (rev 323931)
@@ -260,7 +260,11 @@
MAKE_STD_ZVAL(*retval);
ZVAL_NULL(*retval);

+#if defined(MYSQLI_USE_MYSQLND)
CHECK_STATUS(MYSQLI_STATUS_INITIALIZED);
+#else
+   CHECK_STATUS(MYSQLI_STATUS_VALID);
+#endif

mysql = (MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;


Modified: php/php-src/trunk/ext/mysqli/mysqli_prop.c
===
--- php/php-src/trunk/ext/mysqli/mysqli_prop.c  2012-03-05 23:57:24 UTC (rev 
323930)
+++ php/php-src/trunk/ext/mysqli/mysqli_prop.c  2012-03-06 00:15:40 UTC (rev 
323931)
@@ -260,7 +260,11 @@
MAKE_STD_ZVAL(*retval);
ZVAL_NULL(*retval);

+#if defined(MYSQLI_USE_MYSQLND)
CHECK_STATUS(MYSQLI_STATUS_INITIALIZED);
+#else
+   CHECK_STATUS(MYSQLI_STATUS_VALID);
+#endif

mysql = (MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;


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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/pdo_mysql/mysql_driver.c branches/PHP_5_3/ext/pdo_mysql/pdo_mysql.c branches/PHP_5_3/ext/pdo_mysql/php_pdo_mysql_int.h branches/

2012-03-05 Thread Johannes Schlüter
johannes Mon, 05 Mar 2012 23:57:24 +

Revision: http://svn.php.net/viewvc?view=revision&revision=323930

Log:
Fix bug #61194 PDO should export compression flag with myslqnd

Bug: https://bugs.php.net/61194 (Closed) PDO should export compression flag 
with myslqnd
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/pdo_mysql/mysql_driver.c
U   php/php-src/branches/PHP_5_3/ext/pdo_mysql/pdo_mysql.c
U   php/php-src/branches/PHP_5_3/ext/pdo_mysql/php_pdo_mysql_int.h
U   
php/php-src/branches/PHP_5_3/ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt
U   php/php-src/branches/PHP_5_4/NEWS
U   php/php-src/branches/PHP_5_4/ext/pdo_mysql/mysql_driver.c
U   php/php-src/branches/PHP_5_4/ext/pdo_mysql/pdo_mysql.c
U   php/php-src/branches/PHP_5_4/ext/pdo_mysql/php_pdo_mysql_int.h
U   
php/php-src/branches/PHP_5_4/ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt
U   php/php-src/trunk/ext/pdo_mysql/mysql_driver.c
U   php/php-src/trunk/ext/pdo_mysql/pdo_mysql.c
U   php/php-src/trunk/ext/pdo_mysql/php_pdo_mysql_int.h
U   php/php-src/trunk/ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS	2012-03-05 23:55:12 UTC (rev 323929)
+++ php/php-src/branches/PHP_5_3/NEWS	2012-03-05 23:57:24 UTC (rev 323930)
@@ -36,6 +36,12 @@
 - Firebird Database extension (ibase):
   . Fixed bug #60802 (ibase_trans() gives segfault when passing params).

+- PDO_mysql
+  . Fixed bug #61207 (PDO::nextRowset() after a multi-statement query doesn't
+always work). (Johannes)
+  . Fixed bug #61194 (PDO should export compression flag with myslqnd).
+(Johannes)
+
 - Phar:
   . Fixed bug #61184 (Phar::webPhar() generates headers with trailing NUL bytes). (Nikic)


Modified: php/php-src/branches/PHP_5_3/ext/pdo_mysql/mysql_driver.c
===
--- php/php-src/branches/PHP_5_3/ext/pdo_mysql/mysql_driver.c	2012-03-05 23:55:12 UTC (rev 323929)
+++ php/php-src/branches/PHP_5_3/ext/pdo_mysql/mysql_driver.c	2012-03-05 23:57:24 UTC (rev 323930)
@@ -624,8 +624,8 @@
 		char *init_cmd = NULL;
 #ifndef PDO_USE_MYSQLND
 		char *default_file = NULL, *default_group = NULL;
-		long compress = 0;
 #endif
+		long compress = 0;
 #if defined(HAVE_MYSQL_STMT_PREPARE) || defined(PDO_USE_MYSQLND)
 		char *ssl_key = NULL, *ssl_cert = NULL, *ssl_ca = NULL, *ssl_capath = NULL, *ssl_cipher = NULL;
 #endif
@@ -706,7 +706,7 @@
 			}
 			efree(default_group);
 		}
-
+#endif
 		compress = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_COMPRESS, 0 TSRMLS_CC);
 		if (compress) {
 			if (mysql_options(H->server, MYSQL_OPT_COMPRESS, 0)) {
@@ -714,7 +714,6 @@
 goto cleanup;
 			}
 		}
-#endif
 #if defined(HAVE_MYSQL_STMT_PREPARE) || defined(PDO_USE_MYSQLND)
 		ssl_key = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_KEY, NULL TSRMLS_CC);
 		ssl_cert = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_CERT, NULL TSRMLS_CC);

Modified: php/php-src/branches/PHP_5_3/ext/pdo_mysql/pdo_mysql.c
===
--- php/php-src/branches/PHP_5_3/ext/pdo_mysql/pdo_mysql.c	2012-03-05 23:55:12 UTC (rev 323929)
+++ php/php-src/branches/PHP_5_3/ext/pdo_mysql/pdo_mysql.c	2012-03-05 23:57:24 UTC (rev 323930)
@@ -84,8 +84,8 @@
 	REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_MAX_BUFFER_SIZE", (long)PDO_MYSQL_ATTR_MAX_BUFFER_SIZE);
 	REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_READ_DEFAULT_FILE", (long)PDO_MYSQL_ATTR_READ_DEFAULT_FILE);
 	REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_READ_DEFAULT_GROUP", (long)PDO_MYSQL_ATTR_READ_DEFAULT_GROUP);
+#endif
 	REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_COMPRESS", (long)PDO_MYSQL_ATTR_COMPRESS);
-#endif
 	REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_DIRECT_QUERY", (long)PDO_MYSQL_ATTR_DIRECT_QUERY);
 	REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_FOUND_ROWS", (long)PDO_MYSQL_ATTR_FOUND_ROWS);
 	REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_IGNORE_SPACE", (long)PDO_MYSQL_ATTR_IGNORE_SPACE);

Modified: php/php-src/branches/PHP_5_3/ext/pdo_mysql/php_pdo_mysql_int.h
===
--- php/php-src/branches/PHP_5_3/ext/pdo_mysql/php_pdo_mysql_int.h	2012-03-05 23:55:12 UTC (rev 323929)
+++ php/php-src/branches/PHP_5_3/ext/pdo_mysql/php_pdo_mysql_int.h	2012-03-05 23:57:24 UTC (rev 323930)
@@ -163,8 +163,8 @@
 	PDO_MYSQL_ATTR_READ_DEFAULT_FILE,
 	PDO_MYSQL_ATTR_READ_DEFAULT_GROUP,
 	PDO_MYSQL_ATTR_MAX_BUFFER_SIZE,
+#endif
 	PDO_MYSQL_ATTR_COMPRESS,
-#endif
 	PDO_MYSQL_ATTR_DIRECT_QUERY,
 	PDO_MYSQL_ATTR_FOUND_ROWS,
 	PDO_MYSQL_ATTR_IGNORE_SPACE,

Modified: php/php-src/branches/PHP_5_3/ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt
===
--- php/php-src/branches/PHP_5_3/ext/pd

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/ext/mysqlnd/mysqlnd_wireprotocol.c trunk/ext/mysqlnd/mysqlnd_wireprotocol.c

2012-03-05 Thread Johannes Schlüter
johannes Mon, 05 Mar 2012 23:55:12 +

Revision: http://svn.php.net/viewvc?view=revision&revision=323929

Log:
Fix bug #60948 mysqlnd FTBFS when -Wformat-security is enabled

# 5.3 not affected

Bugs: https://bugs.php.net/60948 (Assigned) mysqlnd FTBFS when 
-Wformat-security is enabled
  https://bugs.php.net/5 (Closed) fclose in php3_minit_file undeclared
  
Changed paths:
U   php/php-src/branches/PHP_5_4/ext/mysqlnd/mysqlnd_wireprotocol.c
U   php/php-src/trunk/ext/mysqlnd/mysqlnd_wireprotocol.c

Modified: php/php-src/branches/PHP_5_4/ext/mysqlnd/mysqlnd_wireprotocol.c
===
--- php/php-src/branches/PHP_5_4/ext/mysqlnd/mysqlnd_wireprotocol.c 
2012-03-05 23:38:15 UTC (rev 323928)
+++ php/php-src/branches/PHP_5_4/ext/mysqlnd/mysqlnd_wireprotocol.c 
2012-03-05 23:55:12 UTC (rev 323929)
@@ -500,7 +500,7 @@
const char * const msg = "Authentication data too long. 
"
"Won't fit into the buffer and will be 
truncated. Authentication will thus fail";
SET_CLIENT_ERROR(*conn->error_info, CR_UNKNOWN_ERROR, 
UNKNOWN_SQLSTATE, msg);
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, msg);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", msg);
DBG_RETURN(0);
}


Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_wireprotocol.c
===
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_wireprotocol.c2012-03-05 
23:38:15 UTC (rev 323928)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_wireprotocol.c2012-03-05 
23:55:12 UTC (rev 323929)
@@ -500,7 +500,7 @@
const char * const msg = "Authentication data too long. 
"
"Won't fit into the buffer and will be 
truncated. Authentication will thus fail";
SET_CLIENT_ERROR(*conn->error_info, CR_UNKNOWN_ERROR, 
UNKNOWN_SQLSTATE, msg);
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, msg);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", msg);
DBG_RETURN(0);
}


-- 
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_mysql/mysql_statement.c branches/PHP_5_3/ext/pdo_mysql/tests/bug_61207.phpt branches/PHP_5_4/ext/pdo_mysql/mysql_statement.c branches/PHP_5_4/ext/

2012-03-05 Thread Johannes Schlüter
johannes Mon, 05 Mar 2012 23:38:15 +

Revision: http://svn.php.net/viewvc?view=revision&revision=323928

Log:
Fix Bug #61207 PDO::nextRowset() after a multi-statement query doesn't always 
work

Bug: https://bugs.php.net/61207 (Assigned) PDO::nextRowset() after a 
multi-statement query doesn't always work
  
Changed paths:
U   php/php-src/branches/PHP_5_3/ext/pdo_mysql/mysql_statement.c
A   php/php-src/branches/PHP_5_3/ext/pdo_mysql/tests/bug_61207.phpt
U   php/php-src/branches/PHP_5_4/ext/pdo_mysql/mysql_statement.c
A   php/php-src/branches/PHP_5_4/ext/pdo_mysql/tests/bug_61207.phpt
U   php/php-src/trunk/ext/pdo_mysql/mysql_statement.c
A   php/php-src/trunk/ext/pdo_mysql/tests/bug_61207.phpt

Modified: php/php-src/branches/PHP_5_3/ext/pdo_mysql/mysql_statement.c
===
--- php/php-src/branches/PHP_5_3/ext/pdo_mysql/mysql_statement.c	2012-03-05 21:22:15 UTC (rev 323927)
+++ php/php-src/branches/PHP_5_3/ext/pdo_mysql/mysql_statement.c	2012-03-05 23:38:15 UTC (rev 323928)
@@ -131,6 +131,39 @@
 }
 /* }}} */

+static int pdo_mysql_fill_stmt_from_result(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+{
+	pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
+	pdo_mysql_db_handle *H = S->H;
+	my_ulonglong row_count;
+	PDO_DBG_ENTER("pdo_mysql_fill_stmt_from_result");
+
+	row_count = mysql_affected_rows(H->server);
+	if (row_count == (my_ulonglong)-1) {
+		/* we either have a query that returned a result set or an error occured
+		   lets see if we have access to a result set */
+		if (!H->buffered) {
+			S->result = mysql_use_result(H->server);
+		} else {
+			S->result = mysql_store_result(H->server);
+		}
+		if (NULL == S->result) {
+			pdo_mysql_error_stmt(stmt);
+			PDO_DBG_RETURN(0);
+		}
+
+		stmt->row_count = (long) mysql_num_rows(S->result);
+		stmt->column_count = (int) mysql_num_fields(S->result);
+		S->fields = mysql_fetch_fields(S->result);
+	} else {
+		/* this was a DML or DDL query (INSERT, UPDATE, DELETE, ... */
+		stmt->row_count = (long) row_count;
+	}
+
+	PDO_DBG_RETURN(1);
+}
+/* }}} */
+
 #ifdef HAVE_MYSQL_STMT_PREPARE
 static int pdo_mysql_stmt_execute_prepared_libmysql(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
 {
@@ -310,30 +343,7 @@
 		PDO_DBG_RETURN(0);
 	}

-	row_count = mysql_affected_rows(H->server);
-	if (row_count == (my_ulonglong)-1) {
-		/* we either have a query that returned a result set or an error occured
-		   lets see if we have access to a result set */
-		if (!H->buffered) {
-			S->result = mysql_use_result(H->server);
-		} else {
-			S->result = mysql_store_result(H->server);
-		}
-		if (NULL == S->result) {
-			pdo_mysql_error_stmt(stmt);
-			PDO_DBG_RETURN(0);
-		}
-
-		stmt->row_count = (long) mysql_num_rows(S->result);
-		stmt->column_count = (int) mysql_num_fields(S->result);
-		S->fields = mysql_fetch_fields(S->result);
-
-	} else {
-		/* this was a DML or DDL query (INSERT, UPDATE, DELETE, ... */
-		stmt->row_count = (long) row_count;
-	}
-
-	PDO_DBG_RETURN(1);
+	PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt TSRMLS_CC));
 }
 /* }}} */

@@ -421,25 +431,7 @@
 		/* No more results */
 		PDO_DBG_RETURN(0);
 	} else {
-		if (!H->buffered) {
-			S->result = mysql_use_result(H->server);
-			row_count = 0;
-		} else {
-			S->result = mysql_store_result(H->server);
-			if ((long)-1 == (row_count = (long) mysql_affected_rows(H->server))) {
-pdo_mysql_error_stmt(stmt);
-PDO_DBG_RETURN(0);
-			}
-		}
-
-		if (NULL == S->result) {
-			PDO_DBG_RETURN(0);
-		}
-
-		stmt->row_count = row_count;
-		stmt->column_count = (int) mysql_num_fields(S->result);
-		S->fields = mysql_fetch_fields(S->result);
-		PDO_DBG_RETURN(1);
+		PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt TSRMLS_CC));
 	}
 #else
 	strcpy(stmt->error_code, "HYC00");

Added: php/php-src/branches/PHP_5_3/ext/pdo_mysql/tests/bug_61207.phpt
===
--- php/php-src/branches/PHP_5_3/ext/pdo_mysql/tests/bug_61207.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_3/ext/pdo_mysql/tests/bug_61207.phpt	2012-03-05 23:38:15 UTC (rev 323928)
@@ -0,0 +1,103 @@
+--TEST--
+PDO MySQL Bug #61207 (PDO::nextRowset() after a multi-statement query doesn't always work)
+--SKIPIF--
+
+--FILE--
+query('create table `bug61207`( `id` int )');
+
+$handle1 = $link->prepare('insert into bug61207(id) values(1);
+  select * from bug61207 where id = ?;
+  update bug61207 set id = 2 where id = ?;');
+
+$handle1->bindValue('1', '1');
+$handle1->bindValue('2', '1');
+
+$handle1->execute();
+$i = 1;
+print("Handle 1:\n");
+do {
+	print('Rowset ' . $i++ . "\n");
+	if ($handle1->columnCount() > 0)
+		print("Results detected\n");
+} while($handle1->nextRowset());
+
+$handle2 = $link->prepare('select * from bug61207 where id = ?;
+   update bug61207 set id = 1 where id = ?;');
+
+$h

[PHP-CVS] svn: /php/php-src/branches/ PHP_5_3/win32/inet.h PHP_5_4/win32/inet.h

2012-03-05 Thread Pierre Joye
pajoye   Mon, 05 Mar 2012 20:53:40 +

Revision: http://svn.php.net/viewvc?view=revision&revision=323926

Log:
- fix bug #61290, fix build

Bug: https://bugs.php.net/61290 (Open) php_sockets build failure - unresolved 
external symbol _inet_aton
  
Changed paths:
U   php/php-src/branches/PHP_5_3/win32/inet.h
U   php/php-src/branches/PHP_5_4/win32/inet.h

Modified: php/php-src/branches/PHP_5_3/win32/inet.h
===
--- php/php-src/branches/PHP_5_3/win32/inet.h   2012-03-05 20:14:55 UTC (rev 
323925)
+++ php/php-src/branches/PHP_5_3/win32/inet.h   2012-03-05 20:53:40 UTC (rev 
323926)
@@ -3,7 +3,7 @@
 #endif
 #include 

-#if (_WIN32_WINNT <= 0x500)
+#if (_WIN32_WINNT < 0x0600)
 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);
 PHPAPI int inet_aton(const char *cp, struct in_addr *inp);

Modified: php/php-src/branches/PHP_5_4/win32/inet.h
===
--- php/php-src/branches/PHP_5_4/win32/inet.h   2012-03-05 20:14:55 UTC (rev 
323925)
+++ php/php-src/branches/PHP_5_4/win32/inet.h   2012-03-05 20:53:40 UTC (rev 
323926)
@@ -3,7 +3,7 @@
 #endif
 #include 

-#if (_WIN32_WINNT <= 0x502)
+#if (_WIN32_WINNT < 0x0600)
 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);
 PHPAPI int inet_aton(const char *cp, struct in_addr *inp);

-- 
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=revision&revision=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] [git] karma.git branch PHP_POST_RECEIVE updated. 89a2d90

2012-03-05 Thread irker
The branch, PHP_POST_RECEIVE on karma.git has been updated
   via  89a2d90e9e5d2e8a661b91c1fdb3f32cf2d90cdd (commit)
  from  5d58ad7ac1700df5ad7d9bf50b73b80b71ce9844 (commit)

http://git.php.net/?p=karma.git;a=log;h=89a2d90e9e5d2e8a661b91c1fdb3f32cf2d90cdd;hp=5d58ad7ac1700df5ad7d9bf50b73b80b71ce9844

Summary of changes:
 lib/Git/PostReceiveHook.php |   86 +-
 1 files changed, 75 insertions(+), 11 deletions(-)

-- Log 
commit 89a2d90e9e5d2e8a661b91c1fdb3f32cf2d90cdd
Author: Alexander Moskaliov 
Date:   Mon Mar 5 21:24:30 2012 +0400

Tag mail

diff --git a/lib/Git/PostReceiveHook.php b/lib/Git/PostReceiveHook.php
index 96660a1..0530ac4 100644
--- a/lib/Git/PostReceiveHook.php
+++ b/lib/Git/PostReceiveHook.php
@@ -60,20 +60,55 @@ class PostReceiveHook extends ReceiveHook
 // TODO: check old post-receive for other especial cases
 }
 
+
+/*
+ * Note:
+ *   * - commits in push,
+ *   digits - simply commits
+ *   chars - branches
+ *   + - commits already in server git repository
+ *   without +  - commits in local git repository
+ *
+ * Situation #1.
+ *
+ *1+ - 2* - A*
+ *  \
+ *  3* - B*
+ *
+ *  Problem: we have 0-B for B branch in push input data.
+ *  Solution: git rev-list B --not A   ->  3-B (--not A C D E F ... 
all branches)
+ *
+ * Situation #2.
+ *1 - 2 - A
+ *  \
+ *  3* - B*
+ *  Problem: we will have 0-B in rev-list.
+ *  Solution: ?
+ *
+ * Situation #3.
+ *
+ *  1+ - 2+  -   3+ - A+
+ *\ /
+ *4* - 5* - B*
+ * Problem: we will have 5-B in rev-list, but what about 4 commit?
+ *
+ * Solution: ?
+ *
+ *
+ * ... more problems
+ *
+ */
 private function sendBranchMail(array $branch)
 {
 
 if ($branch['changetype'] == self::TYPE_UPDATED) {
 $title = "Branch " . $branch['refname'] . " was updated";
-$message = $title . "\n\n";
 } elseif ($branch['changetype'] == self::TYPE_CREATED) {
 $title = "Branch " . $branch['refname'] . " was created";
-$message = $title . "\n\n";
 } else {
 $title = "Branch " . $branch['refname'] . " was deleted";
-$message = $title . "\n\n";
 }
-
+$message = $title . "\n\n";
 
 
 if ($branch['changetype'] != self::TYPE_DELETED) {
@@ -106,26 +141,56 @@ class PostReceiveHook extends ReceiveHook
 
 if ($tag['changetype'] == self::TYPE_UPDATED) {
 $title = "Tag " . $tag['refname'] . " was updated";
-$message = $title . "\n\n";
 } elseif ($tag['changetype'] == self::TYPE_CREATED) {
 $title = "Tag " . $tag['refname'] . " was created";
-$message = $title . "\n\n";
 } else {
 $title = "Tag " . $tag['refname'] . " was deleted";
-$message = $title . "\n\n";
 }
 
-if ($tag['changetype'] != self::TYPE_CREATED) $isAnnotatedOldTag = 
$this->isAnnotatedTag($tag['old']);
-if ($tag['changetype'] != self::TYPE_DELETED) $isAnnotatedNewTag = 
$this->isAnnotatedTag($tag['new']);
+$message = $title . "\n\n";
+
+if ($tag['changetype'] != self::TYPE_DELETED) {
+$message .= "Tag info:\n";
+$isAnnotatedNewTag = $this->isAnnotatedTag($tag['refname']);
+if ($isAnnotatedNewTag) {
+$message .= $this->getAnnotatedTagInfo($tag['refname']) ."\n";
+} else {
+$message .= $this->getTagInfo($tag['new']) ."\n";
+}
+}
+if ($tag['changetype'] != self::TYPE_CREATED) {
+$message .= "Old tag sha: \n" . $tag['old'];
+}
+
 
 // TODO: write info about tag and target
 
 $this->mail($this->emailprefix . '[push] ' . $title , $message);
 }
 
+private function getTagInfo($tag)
+{
+$info = "Target:\n";
+$info .= $this->execute('git diff-tree --stat --pretty=medium -c %s', 
$tag);
+return $info;
+}
+
+private function getAnnotatedTagInfo($tag)
+{
+$tagInfo = $this->execute('git for-each-ref --format="%%(*objectname) 
%%(taggername) %%(taggerdate)" %s', $tag);
+list($target, $tagger, $taggerdate) = explode(' ', $tagInfo);
+
+$info = "Tagger: " . $tagger . "\n";
+$info .= "Date: " . $taggerdate . "\n";
+$info .= $this->execute("git cat-file tag %s | sed -e '1,/^$/d'", 
$tag)."\n";
+$info .= "Target:\n";
+$info .= $this->execute('git diff-tree --stat --pretty=medium -c %s', 
$target);
+return $info;
+}
+
 private function isAnnotatedTag($rev)
 {
-return $this->execute('git for-each-ref --format="%%(objecttype)" %s', 
$rev) == 'tag';
+return trim($this->execute('git for-each-ref --format

[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ NEWS ext/zlib/php_zlib.h ext/zlib/tests/bug61287.phpt ext/zlib/zlib.c

2012-03-05 Thread Michael Wallner
mike Mon, 05 Mar 2012 15:38:24 +

Revision: http://svn.php.net/viewvc?view=revision&revision=323917

Log:
MFH: Fixed 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/branches/PHP_5_4/NEWS
U   php/php-src/branches/PHP_5_4/ext/zlib/php_zlib.h
A + php/php-src/branches/PHP_5_4/ext/zlib/tests/bug61287.phpt
(from php/php-src/trunk/ext/zlib/tests/bug61287.phpt:r323916)
U   php/php-src/branches/PHP_5_4/ext/zlib/zlib.c

Modified: php/php-src/branches/PHP_5_4/NEWS
===
--- php/php-src/branches/PHP_5_4/NEWS   2012-03-05 15:35:22 UTC (rev 323916)
+++ php/php-src/branches/PHP_5_4/NEWS   2012-03-05 15:38:24 UTC (rev 323917)
@@ -61,6 +61,7 @@

 - Zlib:
   . Fixed bug #61139 (gzopen leaks when specifying invalid mode). (Nikita 
Popov)
+  . Fixed bug #61287 (A particular string fails to decompress). (Mike)

 01 Mar 2012, PHP 5.4.0


Modified: php/php-src/branches/PHP_5_4/ext/zlib/php_zlib.h
===
--- php/php-src/branches/PHP_5_4/ext/zlib/php_zlib.h2012-03-05 15:35:22 UTC 
(rev 323916)
+++ php/php-src/branches/PHP_5_4/ext/zlib/php_zlib.h2012-03-05 15:38:24 UTC 
(rev 323917)
@@ -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)

Copied: php/php-src/branches/PHP_5_4/ext/zlib/tests/bug61287.phpt (from rev 
323916, php/php-src/trunk/ext/zlib/tests/bug61287.phpt)
===
--- php/php-src/branches/PHP_5_4/ext/zlib/tests/bug61287.phpt   
(rev 0)
+++ php/php-src/branches/PHP_5_4/ext/zlib/tests/bug61287.phpt   2012-03-05 
15:38:24 UTC (rev 323917)
@@ -0,0 +1,24 @@
+--TEST--
+bug #61287 - inflate needs the terminating null byte
+--SKIPIF--
+ 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/branches/PHP_5_4/ext/zlib/zlib.c
===
--- php/php-src/branches/PHP_5_4/ext/zlib/zlib.c2012-03-05 15:35:22 UTC 
(rev 323916)
+++ php/php-src/branches/PHP_5_4/ext/zlib/zlib.c2012-03-05 15:38:24 UTC 
(rev 323917)
@@ -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/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=revision&revision=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--
+ 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

Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/soap/php_sdl.c branches/PHP_5_4/NEWS branches/PHP_5_4/ext/soap/php_sdl.c trunk/ext/soap/php_sdl.c

2012-03-05 Thread Hannes Magnusson
On Mon, Mar 5, 2012 at 13:59, Dmitry Stogov  wrote:
> dmitry                                   Mon, 05 Mar 2012 12:59:01 +
>
> Revision: http://svn.php.net/viewvc?view=revision&revision=323909
>
> Log:
> Fixed bug #60887 (SoapClient ignores user_agent option and sends no 
> User-Agent header)
>
> Bug: https://bugs.php.net/60887 (Assigned) SoapClient ignores user_agent 
> option and sends no User-Agent header
>
> Changed paths:
>    U   php/php-src/branches/PHP_5_3/NEWS
>    U   php/php-src/branches/PHP_5_3/ext/soap/php_sdl.c
>    U   php/php-src/branches/PHP_5_4/NEWS
>    U   php/php-src/branches/PHP_5_4/ext/soap/php_sdl.c
>    U   php/php-src/trunk/ext/soap/php_sdl.c
>
> Modified: php/php-src/branches/PHP_5_3/NEWS
> ===
> --- php/php-src/branches/PHP_5_3/NEWS   2012-03-05 12:47:25 UTC (rev 323908)
> +++ php/php-src/branches/PHP_5_3/NEWS   2012-03-05 12:59:01 UTC (rev 323909)
> @@ -41,7 +41,11 @@
>
>  - PHP-FPM SAPI:
>   . Fixed bug #60811 (php-fpm compilation problem). (rasmus)
> -
> +
> +- SOAP
> +  . Fixed bug #60887 (SoapClient ignores user_agent option and sends no
> +    User-Agent header). (carloschilazo at gmail dot com)
> +
>  - SQLite3 extension:
>   . Add createCollation() method. (Brad Dewar)
>
>
> Modified: php/php-src/branches/PHP_5_3/ext/soap/php_sdl.c
> ===
> --- php/php-src/branches/PHP_5_3/ext/soap/php_sdl.c     2012-03-05 12:47:25 
> UTC (rev 323908)
> +++ php/php-src/branches/PHP_5_3/ext/soap/php_sdl.c     2012-03-05 12:59:01 
> UTC (rev 323909)
> @@ -3259,6 +3259,13 @@
>                context = php_stream_context_alloc();
>        }
>
> +       if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_user_agent", 
> sizeof("_user_agent"), (void **) &tmp) == SUCCESS &&
> +           Z_TYPE_PP(tmp) == IS_STRING && Z_STRLEN_PP(tmp) > 0) {
> +               smart_str_appends(&headers, "User-Agent: ");
> +               smart_str_appends(&headers, Z_STRVAL_PP(tmp));
> +               smart_str_appends(&headers, "\r\n");
> +       }

Shouldn't it fallback on the ini option?

-Hannes

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



[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/soap/php_sdl.c branches/PHP_5_4/NEWS branches/PHP_5_4/ext/soap/php_sdl.c trunk/ext/soap/php_sdl.c

2012-03-05 Thread Dmitry Stogov
dmitry   Mon, 05 Mar 2012 12:59:01 +

Revision: http://svn.php.net/viewvc?view=revision&revision=323909

Log:
Fixed bug #60887 (SoapClient ignores user_agent option and sends no User-Agent 
header)

Bug: https://bugs.php.net/60887 (Assigned) SoapClient ignores user_agent option 
and sends no User-Agent header
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/soap/php_sdl.c
U   php/php-src/branches/PHP_5_4/NEWS
U   php/php-src/branches/PHP_5_4/ext/soap/php_sdl.c
U   php/php-src/trunk/ext/soap/php_sdl.c

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2012-03-05 12:47:25 UTC (rev 323908)
+++ php/php-src/branches/PHP_5_3/NEWS   2012-03-05 12:59:01 UTC (rev 323909)
@@ -41,7 +41,11 @@

 - PHP-FPM SAPI:
   . Fixed bug #60811 (php-fpm compilation problem). (rasmus)
-
+
+- SOAP
+  . Fixed bug #60887 (SoapClient ignores user_agent option and sends no
+User-Agent header). (carloschilazo at gmail dot com)
+
 - SQLite3 extension:
   . Add createCollation() method. (Brad Dewar)


Modified: php/php-src/branches/PHP_5_3/ext/soap/php_sdl.c
===
--- php/php-src/branches/PHP_5_3/ext/soap/php_sdl.c 2012-03-05 12:47:25 UTC 
(rev 323908)
+++ php/php-src/branches/PHP_5_3/ext/soap/php_sdl.c 2012-03-05 12:59:01 UTC 
(rev 323909)
@@ -3259,6 +3259,13 @@
context = php_stream_context_alloc();
}

+   if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_user_agent", 
sizeof("_user_agent"), (void **) &tmp) == SUCCESS &&
+   Z_TYPE_PP(tmp) == IS_STRING && Z_STRLEN_PP(tmp) > 0) {
+   smart_str_appends(&headers, "User-Agent: ");
+   smart_str_appends(&headers, Z_STRVAL_PP(tmp));
+   smart_str_appends(&headers, "\r\n");
+   }
+
if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_proxy_host", 
sizeof("_proxy_host"), (void **) &proxy_host) == SUCCESS &&
Z_TYPE_PP(proxy_host) == IS_STRING &&
zend_hash_find(Z_OBJPROP_P(this_ptr), "_proxy_port", 
sizeof("_proxy_port"), (void **) &proxy_port) == SUCCESS &&

Modified: php/php-src/branches/PHP_5_4/NEWS
===
--- php/php-src/branches/PHP_5_4/NEWS   2012-03-05 12:47:25 UTC (rev 323908)
+++ php/php-src/branches/PHP_5_4/NEWS   2012-03-05 12:59:01 UTC (rev 323909)
@@ -38,6 +38,10 @@
 - mbstring:
   . MFH mb_ereg_replace_callback() for security enhancements. (Rui)

+- SOAP
+  . Fixed bug #60887 (SoapClient ignores user_agent option and sends no
+User-Agent header). (carloschilazo at gmail dot com)
+
 - Phar
   . Fixed bug #61184 (Phar::webPhar() generates headers with trailing NUL
 bytes). (Nikita Popov)

Modified: php/php-src/branches/PHP_5_4/ext/soap/php_sdl.c
===
--- php/php-src/branches/PHP_5_4/ext/soap/php_sdl.c 2012-03-05 12:47:25 UTC 
(rev 323908)
+++ php/php-src/branches/PHP_5_4/ext/soap/php_sdl.c 2012-03-05 12:59:01 UTC 
(rev 323909)
@@ -3259,6 +3259,13 @@
context = php_stream_context_alloc(TSRMLS_C);
}

+   if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_user_agent", 
sizeof("_user_agent"), (void **) &tmp) == SUCCESS &&
+   Z_TYPE_PP(tmp) == IS_STRING && Z_STRLEN_PP(tmp) > 0) {
+   smart_str_appends(&headers, "User-Agent: ");
+   smart_str_appends(&headers, Z_STRVAL_PP(tmp));
+   smart_str_appends(&headers, "\r\n");
+   }
+
if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_proxy_host", 
sizeof("_proxy_host"), (void **) &proxy_host) == SUCCESS &&
Z_TYPE_PP(proxy_host) == IS_STRING &&
zend_hash_find(Z_OBJPROP_P(this_ptr), "_proxy_port", 
sizeof("_proxy_port"), (void **) &proxy_port) == SUCCESS &&

Modified: php/php-src/trunk/ext/soap/php_sdl.c
===
--- php/php-src/trunk/ext/soap/php_sdl.c2012-03-05 12:47:25 UTC (rev 
323908)
+++ php/php-src/trunk/ext/soap/php_sdl.c2012-03-05 12:59:01 UTC (rev 
323909)
@@ -3259,6 +3259,13 @@
context = php_stream_context_alloc(TSRMLS_C);
}

+   if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_user_agent", 
sizeof("_user_agent"), (void **) &tmp) == SUCCESS &&
+   Z_TYPE_PP(tmp) == IS_STRING && Z_STRLEN_PP(tmp) > 0) {
+   smart_str_appends(&headers, "User-Agent: ");
+   smart_str_appends(&headers, Z_STRVAL_PP(tmp));
+   smart_str_appends(&headers, "\r\n");
+   }
+
if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_proxy_host", 
sizeof("_proxy_host"), (void **) &proxy_host) == SUCCESS &&
Z_TYPE_PP(proxy_host) == IS_STRING &&
zend_hash_find(Z_OBJPROP_P(this_ptr), "_proxy_port", 
sizeof("_proxy_po

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

2012-03-05 Thread Dmitry Stogov
dmitry   Mon, 05 Mar 2012 12:47:25 +

Revision: http://svn.php.net/viewvc?view=revision&revision=323908

Log:
Fixed module numbering

Changed paths:
U   php/php-src/branches/PHP_5_3/Zend/zend_API.c
U   php/php-src/branches/PHP_5_4/Zend/zend_API.c
U   php/php-src/trunk/Zend/zend_API.c

Modified: php/php-src/branches/PHP_5_3/Zend/zend_API.c
===
--- php/php-src/branches/PHP_5_3/Zend/zend_API.c2012-03-05 12:21:39 UTC 
(rev 323907)
+++ php/php-src/branches/PHP_5_3/Zend/zend_API.c2012-03-05 12:47:25 UTC 
(rev 323908)
@@ -33,7 +33,6 @@
 #endif

 /* these variables are true statics/globals, and have to be mutex'ed on every 
access */
-static int module_count=0;
 ZEND_API HashTable module_registry;

 /* this function doesn't check for too many parameters */
@@ -2184,7 +2183,7 @@
 /* return the next free module number */
 int zend_next_free_module(void) /* {{{ */
 {
-   return ++module_count;
+   return zend_hash_num_elements(&module_registry) + 1;
 }
 /* }}} */


Modified: php/php-src/branches/PHP_5_4/Zend/zend_API.c
===
--- php/php-src/branches/PHP_5_4/Zend/zend_API.c2012-03-05 12:21:39 UTC 
(rev 323907)
+++ php/php-src/branches/PHP_5_4/Zend/zend_API.c2012-03-05 12:47:25 UTC 
(rev 323908)
@@ -33,7 +33,6 @@
 #endif

 /* these variables are true statics/globals, and have to be mutex'ed on every 
access */
-static int module_count=0;
 ZEND_API HashTable module_registry;

 static zend_module_entry **module_request_startup_handlers;
@@ -2381,7 +2380,7 @@
 /* return the next free module number */
 int zend_next_free_module(void) /* {{{ */
 {
-   return ++module_count;
+   return zend_hash_num_elements(&module_registry) + 1;
 }
 /* }}} */


Modified: php/php-src/trunk/Zend/zend_API.c
===
--- php/php-src/trunk/Zend/zend_API.c   2012-03-05 12:21:39 UTC (rev 323907)
+++ php/php-src/trunk/Zend/zend_API.c   2012-03-05 12:47:25 UTC (rev 323908)
@@ -33,7 +33,6 @@
 #endif

 /* these variables are true statics/globals, and have to be mutex'ed on every 
access */
-static int module_count=0;
 ZEND_API HashTable module_registry;

 static zend_module_entry **module_request_startup_handlers;
@@ -2381,7 +2380,7 @@
 /* return the next free module number */
 int zend_next_free_module(void) /* {{{ */
 {
-   return ++module_count;
+   return zend_hash_num_elements(&module_registry) + 1;
 }
 /* }}} */


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