View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
05025Bug reportsSurvey participants (Tokens)public2011-04-14 00:00
ReportermagiclkoAssigned ToMazi  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version1.90+ 
Fixed in Version1.91RC5 
Summary05025: Header already sent error
Description

If a token is not in valid time frame and is used to enter in a survey, i am getting following error along with appropriate message.

"Warning: Cannot modify header information - headers already sent by (output started at /home/content/68/7598978/html/limesurvey/common.php:4232) in /home/content/68/7598978/html/limesurvey/common.php on line 5098"

Check screenshot

Steps To Reproduce
  1. Create a survey in closed mode(users with only valid token can participate).
  2. Create a dummy token entry whos time frame has expired(i.e. not valid anymore).
  3. Try giving survey with this expired token, you get header already sent error.

For more clarification, see image attached.

Additional Information

We are echoing text before calling killSession() and hence the error.

TagsNo tags attached.
Attached Files
Capture.PNG (25,468 bytes)   
Capture.PNG (25,468 bytes)   
header_already_sent_corrected.patch (711 bytes)   
Index: index.php
===================================================================
--- index.php	(revision 9887)
+++ index.php	(working copy)
@@ -665,6 +665,7 @@
     $tokendata = $tkresult->FetchRow();
     if ($tkresult->RecordCount()==0 || $areTokensUsed)
     {
+        killSession();
         sendcacheheaders();
         doHeader();
         //TOKEN DOESN'T EXIST OR HAS ALREADY BEEN USED. EXPLAIN PROBLEM AND EXIT
@@ -677,7 +678,7 @@
         ." (<a href='mailto:{$thissurvey['adminemail']}'>"
         ."{$thissurvey['adminemail']}</a>)<br /><br />&nbsp;\n";
         echo templatereplace(file_get_contents("$thistpl/endpage.pstpl"));
-	killSession();
+	
         doFooter();
         exit;
 }
Bug heat4
Complete LimeSurvey version number (& build)9642
I will donate to the project if issue is resolvedNo
BrowserGoogle Chrome, Mozilla Firefox, Microsoft IE
Database type & versionMySQL(i) 5.1.37
Server OS (if known)Windows 7
Webserver software & version (if known)IIS 6.0
PHP Version5.2.13

Users monitoring this issue

There are no users monitoring this issue.

Activities

Mazi

Mazi

2011-03-12 13:05

updater   ~14420

I can NOT reproduce this issue using the latest 1.91RC5 version. Can you test this version if you can reproduce the error with your survey?!

magiclko

magiclko

2011-03-12 17:47

reporter   ~14421

Last edited: 2011-03-12 17:49

Ok.. neither can i.. tested on 1.91RC5! But shouldn't killSession() be called before echoing text?

Mazi

Mazi

2011-03-12 17:59

updater   ~14422

Fixed at 1.91 RC5

The text echoed is just a PHP warning. Warnings and notices should generally be switched off at production servers.
You can't influence the output of such warnings because it always refers to a certain line of code so it can't be put after the killSession() part.

magiclko

magiclko

2011-03-12 18:01

reporter   ~14423

I see. ok.

Issue History

Date Modified Username Field Change
2011-03-11 22:15 magiclko New Issue
2011-03-11 22:15 magiclko File Added: Capture.PNG
2011-03-11 22:16 magiclko File Added: header_already_sent_corrected.patch
2011-03-12 13:05 Mazi Note Added: 14420
2011-03-12 13:05 Mazi Assigned To => Mazi
2011-03-12 13:05 Mazi Status new => feedback
2011-03-12 17:47 magiclko Note Added: 14421
2011-03-12 17:47 magiclko Status feedback => assigned
2011-03-12 17:49 magiclko Note Edited: 14421
2011-03-12 17:59 Mazi Note Added: 14422
2011-03-12 17:59 Mazi Status assigned => resolved
2011-03-12 17:59 Mazi Fixed in Version => 1.91RC5
2011-03-12 17:59 Mazi Resolution open => fixed
2011-03-12 18:01 magiclko Note Added: 14423
2011-04-14 00:00 c_schmitz Status resolved => closed
2016-12-08 10:39 c_schmitz Category Tokens => Survey participants (Tokens)