Skip to content
Browse files

Catching any possible exception in DatabaseSession destructor, using …

…exceptions in destructors is a bad idea in PHP
  • Loading branch information...
1 parent eaf6f0e commit e25867da79dc9f6baa826e0d20ff3baf19f5729f @lorenzo lorenzo committed
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/Cake/Model/Datasource/Session/DatabaseSession.php
View
4 lib/Cake/Model/Datasource/Session/DatabaseSession.php
@@ -150,6 +150,8 @@ public function gc($expires = null) {
* @return void
*/
public function __destruct() {
- session_write_close();
+ try {
+ session_write_close();
+ } catch (Exception $e) {}
}
}

0 comments on commit e25867d

Please sign in to comment.
Something went wrong with that request. Please try again.