View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
04399 | Bug reports | Survey taking | public | 2010-06-07 21:29 | 2010-06-08 21:51 |
Reporter | jdalegonzalez | Assigned To | machaven | ||
Priority | normal | Severity | minor | ||
Status | closed | Resolution | fixed | ||
Product Version | 1.87+ | ||||
Fixed in Version | 1.90RC1 | ||||
Summary | 04399: limesurvey/index.php line 1072 could break out of foreach on successful find. | ||||
Description | // record the qid and question type for future use That code is trying to find the field to be checked in the session fieldarray. Since there should only be one matching field, once $value_qid and $value_type have been set, the code could break the foreach, potentially speeding up execution of the condition. Even better would be keying session fields off of their name (ie $value_qid = $_SESSION[fieldarray][$masterFieldName][0]) to prevent the linear lookup, but maybe there is something I'm missing about the fieldarray that prevents this. | ||||
Steps To Reproduce | look at the code at 1072 and verify my conclusion | ||||
Tags | No tags attached. | ||||
Bug heat | 2 | ||||
Complete LimeSurvey version number (& build) | 8488 | ||||
I will donate to the project if issue is resolved | |||||
Browser | all | ||||
Database type & version | all | ||||
Server OS (if known) | all | ||||
Webserver software & version (if known) | all | ||||
PHP Version | all | ||||
I continued looking at the code and it occurs to me that right below the block in question, the code does the same foreach ($_SESSION['fieldarray'] as $sfa). It seems like the best solution would be to combine the two loops together, setting $value_qid and $value_type inside the second foreach (which is much more complicated and doing many more things). That would remove above loop entirely. |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2010-06-07 21:29 | jdalegonzalez | New Issue | |
2010-06-07 21:29 | jdalegonzalez | Status | new => assigned |
2010-06-07 21:29 | jdalegonzalez | Assigned To | => user372 |
2010-06-07 21:35 | jdalegonzalez | Note Added: 12201 | |
2010-06-08 11:05 | machaven | Assigned To | user372 => machaven |
2010-06-08 11:14 | machaven | Status | assigned => resolved |
2010-06-08 11:14 | machaven | Fixed in Version | => 1.90RC1 |
2010-06-08 11:14 | machaven | Resolution | open => fixed |
2010-06-08 21:51 | c_schmitz | Status | resolved => closed |
2010-10-25 00:18 | c_schmitz | Category | Survey at Runtime => Survey taking |