tony2001 Wed Aug 30 15:42:41 2006 UTC
Modified files:
/php-src/ext/session session.c
Log:
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.447&r2=1.448&diff_format=u
Index: php-src/ext/session/session.c
diff -u php-src/ext/session/session.c:1.447 php-src/ext/session/session.c:1.448
--- php-src/ext/session/session.c:1.447 Thu Aug 10 21:11:00 2006
+++ php-src/ext/session/session.c Wed Aug 30 15:42:40 2006
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: session.c,v 1.447 2006/08/10 21:11:00 iliaa Exp $ */
+/* $Id: session.c,v 1.448 2006/08/30 15:42:40 tony2001 Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -92,14 +92,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;
}
@@ -119,14 +121,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)) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot find
serialization handler %s", new_value);
+ if (PG(modules_activated) && !tmp) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot find
serialization handler %s", new_value);
return FAILURE;
}
+ PS(serializer) = tmp;
return SUCCESS;
}
@@ -1285,8 +1289,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)) {
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php