Have Chunked upload jobs bail if cannot associate with session.
[lhc/web/wiklou.git] / includes / job / jobs / PublishStashedFileJob.php
index 5114dc0..5a24f93 100644 (file)
@@ -42,6 +42,16 @@ class PublishStashedFileJob extends Job {
                                return false;
                        }
 
+                       if ( count( $_SESSION ) === 0 ) {
+                               // Empty session probably indicates that we didn't associate
+                               // with the session correctly. Note that being able to load
+                               // the user does not necessarily mean the session was loaded.
+                               // Most likely cause by suhosin.session.encrypt = On.
+                               $this->setLastError( "Error associating with user session. Try setting suhosin.session.encrypt = Off" );
+                               return false;
+                       }
+
+
                        UploadBase::setSessionStatus(
                                $this->params['filekey'],
                                array( 'result' => 'Poll', 'stage' => 'publish', 'status' => Status::newGood() )