Skip to content

Commit

Permalink
JavaScript help alerts can now contain all manner of special characte…
Browse files Browse the repository at this point in the history
…rs (single quote, double quote, newlines, returns, tabs).

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/trunk/unstable@78 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
James Richards committed Mar 19, 2003
1 parent 0f9a3de commit a99d7d3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion admin/dataentry.php
Expand Up @@ -502,7 +502,8 @@
//DIFFERENT TYPES OF DATA FIELD HERE
if ($deqrow[6])
{
$hh=str_replace("'", "\'", strip_tags($deqrow['help']));
$hh = addcslashes($deqrow['help'], "\0..\37'\""); //Escape ASCII decimal 0-32 plus single and double quotes to make JavaScript happy.
$hh = htmlspecialchars($hh, ENT_QUOTES); //Change & " ' < > to HTML entities to make HTML happy.
echo "<IMG SRC='help.gif' ALT='Help about this question' ALIGN='RIGHT' onClick=\"javascript:alert('Question {$deqrow['title']} Help: $hh')\">";
}
switch($deqrow['type'])
Expand Down

0 comments on commit a99d7d3

Please sign in to comment.