Skip to content

Commit

Permalink
Checks that "datestamp" entry does not already exist in "insertarray"…
Browse files Browse the repository at this point in the history
… before adding it - this should (hopefully) stop errors when submitting surveys caused by duplicate "datestamp" values.

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/trunk/unstable@1244 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
jcleeland committed Oct 14, 2004
1 parent 9f80ba2 commit d3038bf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion group.php
Expand Up @@ -86,7 +86,10 @@
//If survey has datestamp turned on, add $localtimedate to sessions
if ($thissurvey['datestamp'] == "Y")
{
$_SESSION['insertarray'][] = "datestamp";
if (!in_array("datestamp", $_SESSION['insertarray'])) //Only add this if it doesn't already exist
{
$_SESSION['insertarray'][] = "datestamp";
}
$_SESSION['datestamp'] = $localtimedate;
}

Expand Down
5 changes: 4 additions & 1 deletion question.php
Expand Up @@ -68,7 +68,10 @@
//If survey has datestamp turned on, add $localtimedate to sessions
if ($thissurvey['datestamp'] == "Y")
{
$_SESSION['insertarray'][] = "datestamp";
if (!in_array("datestamp", $_SESSION['insertarray'])) //Only add this if it doesn't already exist
{
$_SESSION['insertarray'][] = "datestamp";
}
$_SESSION['datestamp'] = $localtimedate;
}

Expand Down
5 changes: 4 additions & 1 deletion survey.php
Expand Up @@ -72,7 +72,10 @@
//If survey has datestamp turned on, add $localtimedate to sessions
if ($thissurvey['datestamp'] == "Y")
{
$_SESSION['insertarray'][] = "datestamp";
if (!in_array("datestamp", $_SESSION['insertarray'])) //Only add this if it doesn't already exist
{
$_SESSION['insertarray'][] = "datestamp";
}
$_SESSION['datestamp'] = $localtimedate;
}

Expand Down

0 comments on commit d3038bf

Please sign in to comment.