aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCassio de Campos <cassiopc@gmail.com>2018-09-05 20:07:08 +0000
committerCassio de Campos <cassiopc@gmail.com>2018-09-05 20:07:08 +0000
commit6302826d53cc12f731c41915a47c6c19f65743cf (patch)
tree3234edb033355e28525d01deb7a36a1470190b53 /src
parent034545b62ea8e7e10d544b40e1bb78778a874f71 (diff)
downloadboca-6302826d53cc12f731c41915a47c6c19f65743cf.tar.gz
boca-6302826d53cc12f731c41915a47c6c19f65743cf.zip
fix some printing issues
Diffstat (limited to 'src')
-rw-r--r--src/admin/clar.php4
-rw-r--r--src/admin/claredit.php5
-rw-r--r--src/admin/report/clar.php4
-rwxr-xr-xsrc/globals.php2
-rw-r--r--src/judge/clar.php2
-rw-r--r--src/judge/claredit.php4
-rw-r--r--src/judge/history.php4
-rw-r--r--src/team/clar.php4
8 files changed, 15 insertions, 14 deletions
diff --git a/src/admin/clar.php b/src/admin/clar.php
index 66a7b0d..9d02d11 100644
--- a/src/admin/clar.php
+++ b/src/admin/clar.php
@@ -92,13 +92,13 @@ for ($i=0; $i<count($clar); $i++) {
echo " <td>";
// echo "<pre>" . $clar[$i]["question"] . "</pre>";
// echo $clar[$i]["question"];
- echo " <textarea name=\"m$i\" cols=\"60\" rows=\"8\" readonly>".$clar[$i]["question"]."</textarea>\n";
+ echo " <textarea name=\"m$i\" cols=\"60\" rows=\"8\" readonly>". unsanitizeText($clar[$i]["question"]) ."</textarea>\n";
echo "</td>\n";
if (trim($clar[$i]["answer"]) == "") $clar[$i]["answer"] = "Not answered yet";
echo " <td>";
// echo " <pre>" . $clar[$i]["answer"] . "</pre>";
// echo $clar[$i]["answer"];
- echo " <textarea name=\"a$i\" cols=\"60\" rows=\"8\" readonly>".$clar[$i]["answer"]."</textarea>\n";
+ echo " <textarea name=\"a$i\" cols=\"60\" rows=\"8\" readonly>". unsanitizeText($clar[$i]["answer"]) ."</textarea>\n";
echo "</td>\n";
echo " </tr>\n";
diff --git a/src/admin/claredit.php b/src/admin/claredit.php
index 5eb812f..cf9785c 100644
--- a/src/admin/claredit.php
+++ b/src/admin/claredit.php
@@ -125,14 +125,13 @@ if (($a = DBChiefGetClarToAnswer($clarnumber, $clarsitenumber,
<tr>
<td width="20%" align=right><b>Clarification:</b></td>
<td width="80%">
- <textarea name="message" readonly cols="60" rows="8"><?php echo $a["question"]; ?>
- </textarea>
+ <textarea name="message" readonly cols="60" rows="8"><?php echo unsanitizeText($a["question"]); ?></textarea>
</td>
</tr>
<tr>
<td width="20%" align=right><b>Answer:</b></td>
<td width="80%">
- <textarea name="answer" cols="60" rows="8"><?php echo $a["answer"]; ?></textarea>
+ <textarea name="answer" cols="60" rows="8"><?php echo unsanitizeText($a["answer"]); ?></textarea>
</td>
</tr>
<tr>
diff --git a/src/admin/report/clar.php b/src/admin/report/clar.php
index 61816d9..27616d5 100644
--- a/src/admin/report/clar.php
+++ b/src/admin/report/clar.php
@@ -63,13 +63,13 @@ for ($i=0; $i<count($clar); $i++) {
echo " <td>";
// echo "<pre>" . $clar[$i]["question"] . "</pre>";
// echo $clar[$i]["question"];
- echo " <textarea name=\"m$i\" cols=\"60\" rows=\"8\" readonly>".$clar[$i]["question"]."</textarea>\n";
+ echo " <textarea name=\"m$i\" cols=\"60\" rows=\"8\" readonly>". unsanitizeText($clar[$i]["question"]) ."</textarea>\n";
echo "</td>\n";
if (trim($clar[$i]["answer"]) == "") $clar[$i]["answer"] = "Not answered yet";
echo " <td>";
// echo " <pre>" . $clar[$i]["answer"] . "</pre>";
// echo $clar[$i]["answer"];
- echo " <textarea name=\"a$i\" cols=\"60\" rows=\"8\" readonly>".$clar[$i]["answer"]."</textarea>\n";
+ echo " <textarea name=\"a$i\" cols=\"60\" rows=\"8\" readonly>". unsanitizeText($clar[$i]["answer"]) ."</textarea>\n";
echo "</td>\n";
echo " </tr>\n";
diff --git a/src/globals.php b/src/globals.php
index 80f79df..ae11a13 100755
--- a/src/globals.php
+++ b/src/globals.php
@@ -227,6 +227,8 @@ function sanitizeFilename($text)
function unsanitizeText($text) {
$text = str_replace("&lt;", "<", $text);
$text = str_replace("&gt;", ">", $text);
+ $text = str_replace("&#39;", "'", $text);
+ $text = str_replace("&#96;", "`", $text);
$text = str_replace("&amp;", "&", $text);
return $text;
}
diff --git a/src/judge/clar.php b/src/judge/clar.php
index ee120ab..a195af8 100644
--- a/src/judge/clar.php
+++ b/src/judge/clar.php
@@ -71,7 +71,7 @@ for ($i=0; $i<count($clar); $i++) {
echo " <td>";
// echo "<pre>" . $clar[$i]["question"] . "</pre>";
// echo $clar[$i]["question"];
- echo " <textarea name=\"m$i\" cols=\"60\" rows=\"8\" readonly>".$clar[$i]["question"]."</textarea>\n";
+ echo " <textarea name=\"m$i\" cols=\"60\" rows=\"8\" readonly>". unsanitizeText($clar[$i]["question"]) ."</textarea>\n";
echo "</td>\n";
echo " </tr>\n";
diff --git a/src/judge/claredit.php b/src/judge/claredit.php
index c459747..a5c3265 100644
--- a/src/judge/claredit.php
+++ b/src/judge/claredit.php
@@ -111,13 +111,13 @@ if (($a = DBGetClarToAnswer($clarnumber, $clarsitenumber,
<tr>
<td width="20%" align=right><b>Clarification:</b></td>
<td width="80%">
- <textarea name="message" readonly cols="60" rows="8"><?php echo $a["question"]; ?></textarea>
+ <textarea name="message" readonly cols="60" rows="8"><?php echo unsanitizeText($a["question"]); ?></textarea>
</td>
</tr>
<tr>
<td width="20%" align=right><b>Answer:</b></td>
<td width="80%">
- <textarea name="answer" cols="60" rows="8"><?php echo $a["answer"]; ?></textarea>
+ <textarea name="answer" cols="60" rows="8"><?php echo unsanitizeText($a["answer"]); ?></textarea>
</td>
</tr>
<tr>
diff --git a/src/judge/history.php b/src/judge/history.php
index b612f9a..a6bcc79 100644
--- a/src/judge/history.php
+++ b/src/judge/history.php
@@ -54,13 +54,13 @@ for ($i=0; $i<count($clar); $i++) {
echo " <td>";
// echo "<pre>" . $clar[$i]["question"] . "</pre>";
// echo $clar[$i]["question"];
- echo " <textarea name=\"m$i\" cols=\"60\" rows=\"8\" readonly>".$clar[$i]["question"]."</textarea>\n";
+ echo " <textarea name=\"m$i\" cols=\"60\" rows=\"8\" readonly>". unsanitizeText($clar[$i]["question"]) ."</textarea>\n";
echo "</td>\n";
if (trim($clar[$i]["answer"]) == "") $clar[$i]["answer"] = "Not answered yet";
echo " <td>";
// echo " <pre>" . $clar[$i]["answer"] . "</pre>";
// echo $clar[$i]["answer"];
- echo " <textarea name=\"a$i\" cols=\"60\" rows=\"8\" readonly>".$clar[$i]["answer"]."</textarea>\n";
+ echo " <textarea name=\"a$i\" cols=\"60\" rows=\"8\" readonly>". unsanitizeText($clar[$i]["answer"]) ."</textarea>\n";
echo "</td>\n";
echo " </tr>\n";
diff --git a/src/team/clar.php b/src/team/clar.php
index a1e3972..c763c2c 100644
--- a/src/team/clar.php
+++ b/src/team/clar.php
@@ -56,13 +56,13 @@ for ($i=0; $i<count($clar); $i++) {
if ($clar[$i]["question"] == "") $clar[$i]["question"] = "&nbsp;";
echo " <td>";
// echo "<pre>" . $clar[$i]["question"] . "</pre>";
- echo " <textarea name=\"m$i\" cols=\"60\" rows=\"8\" readonly>".$clar[$i]["question"]."</textarea>\n";
+ echo " <textarea name=\"m$i\" cols=\"60\" rows=\"8\" readonly>". unsanitizeText($clar[$i]["question"]) ."</textarea>\n";
echo "</td>\n";
if (trim($clar[$i]["answer"]) == "") $clar[$i]["answer"] = "Not answered yet";
echo " <td>";
// echo " <pre>" . $clar[$i]["answer"] . "</pre>";
- echo " <textarea name=\"a$i\" cols=\"60\" rows=\"8\" readonly>".$clar[$i]["answer"]."</textarea>\n";
+ echo " <textarea name=\"a$i\" cols=\"60\" rows=\"8\" readonly>". unsanitizeText($clar[$i]["answer"]) ."</textarea>\n";
echo "</td>\n";
echo " </tr>\n";
}