From: Gergő Tisza Date: Thu, 21 Jan 2016 12:24:43 +0000 (-0800) Subject: Do not raise a PHP warning when session write fails X-Git-Tag: 1.31.0-rc.0~8261^2 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=bfed32eb78b6c720b16bc7ed60153fd2fe257a9e;p=lhc%2Fweb%2Fwiklou.git Do not raise a PHP warning when session write fails Bug: T124126 Change-Id: I3482d8dba4a4d9fe92a39439df41c0e70bfef35d --- diff --git a/includes/session/PHPSessionHandler.php b/includes/session/PHPSessionHandler.php index 44d14cd009..53443211f0 100644 --- a/includes/session/PHPSessionHandler.php +++ b/includes/session/PHPSessionHandler.php @@ -238,10 +238,12 @@ class PHPSessionHandler { $session = $this->manager->getSessionById( $id, true ); if ( !$session ) { + // This can happen under normal circumstances, if the session exists but is + // invalid. Let's emit a log warning instead of a PHP warning. $this->logger->warning( __METHOD__ . ": Session \"$id\" cannot be loaded, skipping write." ); - return false; + return true; } // First, decode the string PHP handed us