Skip to content

Commit

Permalink
TWEAK: uses trim() for the select query when looking up a token (to r…
Browse files Browse the repository at this point in the history
…emove any possible whitespace passed with the URL).

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/trunk/unstable@1055 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
jcleeland committed May 30, 2004
1 parent 6b568ef commit a1f4edd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@
exit;
}

//GET BASIC INFORMATION ABOUT THIS SURVEY
if (!isset($token)) {$token=returnglobal('token');}
//GET BASIC INFORMATION ABOUT THIS SURVEY
$query="SELECT * FROM {$dbprefix}surveys WHERE sid=$sid";
$result=mysql_query($query) or die ("Couldn't access surveys<br />$query<br />".mysql_error());
$surveyexists=mysql_num_rows($result);
Expand Down Expand Up @@ -958,7 +958,7 @@ function buildsurveysession()
elseif ($tokensexist == 1 && returnglobal('token'))
{
//check if token actually does exist
$tkquery = "SELECT * FROM {$dbprefix}tokens_$sid WHERE token='".returnglobal('token')."' AND completed != 'Y'";
$tkquery = "SELECT * FROM {$dbprefix}tokens_$sid WHERE token='".trim(returnglobal('token'))."' AND completed != 'Y'";
$tkresult = mysql_query($tkquery);
$tkexist = mysql_num_rows($tkresult);
if (!$tkexist)
Expand Down

0 comments on commit a1f4edd

Please sign in to comment.