Skip to content

Commit

Permalink
Updated to fix problem with apostrophes in answers breaking javascrip…
Browse files Browse the repository at this point in the history
…t. Add cslashes to all answers regardless of whether magic_quotes_gpc is on or off.

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/trunk/unstable@375 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
jcleeland committed Jun 20, 2003
1 parent 4f8cd1c commit 892f9db
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions admin/conditions.php
Expand Up @@ -155,11 +155,7 @@
$acount=mysql_num_rows($aresult);
while ($arow=mysql_fetch_array($aresult))
{
if (get_magic_quotes_gpc() == "0")
{
$theanswer = addcslashes($arows['answer'], "'");
}
else {$theanswer=$arows['answer'];}
$theanswer = addcslashes($arows['answer'], "'");
$quicky[]=array($arow['code'], $theanswer);
}
for ($i=1; $i<=$acount; $i++)
Expand Down Expand Up @@ -200,11 +196,7 @@
$aresult=mysql_query($aquery) or die ("Couldn't get answers to Ranking question<br />$aquery<br />".mysql_error());
while ($arows=mysql_fetch_array($aresult))
{
if (get_magic_quotes_gpc() == "0")
{
$theanswer = addcslashes($arows['answer'], "'");
}
else {$theanswer=$arows['answer'];}
$theanswer = addcslashes($arows['answer'], "'");
$canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'], $arows['code'], $theanswer);
}
$canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'], "", "No Answer");
Expand Down

0 comments on commit 892f9db

Please sign in to comment.