cvs: php-src(PHP_5_2) /ext/session session.c
| From: | Antony Dovgal | Date: | Wed, 30 Aug 2006 15:43:10 +0000 |
| Subject: | cvs: php-src(PHP_5_2) /ext/session session.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-40190@lists.php.net to get a copy of this message | ||
tony2001 Wed Aug 30 15:43:10 2006 UTC
Modified files: (Branch: PHP_5_2)
/php-src/ext/session session.c
Log:
MFH: change E_ERROR to E_WARNING when invalid argument has been passed
make sure ini_set() doesn't reset PS(mod) and PS(serializer) to invalid values
http://cvs.php.net/viewvc.cgi/php-src/ext/session/session.c?r1=1.417.2.8.2.12&r2=1.417.2.8.2.13&diff_format=u
Index: php-src/ext/session/session.c
diff -u php-src/ext/session/session.c:1.417.2.8.2.12 php-src/ext/session/session.c:1.417.2.8.2.13
--- php-src/ext/session/session.c:1.417.2.8.2.12 Thu Aug 10 21:10:03 2006
+++ php-src/ext/session/session.c Wed Aug 30 15:43:10 2006
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: session.c,v 1.417.2.8.2.12 2006/08/10 21:10:03 iliaa Exp $ */
+/* $Id: session.c,v 1.417.2.8.2.13 2006/08/30 15:43:10 tony2001 Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -95,13 +95,16 @@
static PHP_INI_MH(OnUpdateSaveHandler)
{
+ ps_module *tmp;
SESSION_CHECK_ACTIVE_STATE;
- PS(mod) = _php_find_ps_module(new_value TSRMLS_CC);
+ tmp = _php_find_ps_module(new_value TSRMLS_CC);
- if (PG(modules_activated) && !PS(mod)) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot find save handler %s", new_value);
+ if (PG(modules_activated) && !tmp) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot find save handler %s", new_value);
+ return FAILURE;
}
+ PS(mod) = tmp;
return SUCCESS;
}
@@ -121,13 +124,16 @@
static PHP_INI_MH(OnUpdateSerializer)
{
+ const ps_serializer *tmp;
SESSION_CHECK_ACTIVE_STATE;
- PS(serializer) = _php_find_ps_serializer(new_value TSRMLS_CC);
+ tmp = _php_find_ps_serializer(new_value TSRMLS_CC);
- if (PG(modules_activated) && !PS(serializer)) {
+ if (PG(modules_activated) && !tmp) {
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot find serialization handler %s",
new_value);
+ return FAILURE;
}
+ PS(serializer) = tmp;
return SUCCESS;
}
@@ -1395,8 +1401,9 @@
if (ac == 1) {
convert_to_string_ex(p_name);
if (!_php_find_ps_module(Z_STRVAL_PP(p_name) TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot find named PHP session module (%s)",
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot find named PHP session module
(%s)",
Z_STRVAL_PP(p_name));
+ zval_dtor(return_value);
RETURN_FALSE;
}
if (PS(mod_data)) {