summaryrefslogtreecommitdiff
path: root/motion.php
diff options
context:
space:
mode:
Diffstat (limited to 'motion.php')
-rw-r--r--motion.php16
1 files changed, 5 insertions, 11 deletions
diff --git a/motion.php b/motion.php
index 4672cf7..71fe4b7 100644
--- a/motion.php
+++ b/motion.php
@@ -16,12 +16,6 @@
}
$db->getStatement("stats")->execute();
$stats = $db->getStatement("stats")->fetch();
- function htmlesc($string) {
- $string = preg_replace('/&/',"&",$string);
- $string = preg_replace('/</',"&lt;",$string);
- $string = preg_replace('/>/',"&gt;",$string);
- echo $string;
- }
?>
<html>
<head>
@@ -179,11 +173,11 @@ BODY;
}
?>
<table>
- <tr><td>ID:</td><td><?php htmlesc($motion['tag']); ?></td></tr>
- <tr><td>Proponent:</td><td><?php htmlesc($motion['proposer']); ?><input type="hidden" name="proponent" value="<?php htmlesc($user['id']); ?>"></td></tr>
- <tr><td>Proposed:</td><td><?php htmlesc($motion['proposed']); ?> UTC</td></tr>
- <tr><td>Title:</td><td><input name="title" value="<?php htmlesc($motion['title'])?>"></td></tr>
- <tr><td>Text:</td><td><textarea name="content"><?php htmlesc($motion['content'])?></textarea></td></tr>
+ <tr><td>ID:</td><td><?php echo htmlentities($motion['tag']); ?></td></tr>
+ <tr><td>Proponent:</td><td><?php echo htmlentities($motion['proposer']); ?><input type="hidden" name="proponent" value="<?php echo htmlentities($user['id']); ?>"></td></tr>
+ <tr><td>Proposed:</td><td><?php echo htmlentities($motion['proposed']); ?> UTC</td></tr>
+ <tr><td>Title:</td><td><input name="title" value="<?php echo htmlentities($motion['title'])?>"></td></tr>
+ <tr><td>Text:</td><td><textarea name="content"><?php echo htmlspecialchars($motion['content'])?></textarea></td></tr>
<tr><td>Quorum:</td><td><select name="quorum">
<option value="<?php echo(ceil($stats["voters"])); ?>" <?php if($motion['quorum'] == $stats["voters"]) { echo(" selected=\"selected\""); } ?>>100% Votes (<?php echo($stats["voters"]); ?>)</option>
<option value="<?php echo(ceil($stats["voters"] / 2)); ?>" <?php if($motion['quorum'] == ceil($stats["voters"] / 2)) { echo(" selected=\"selected\""); } ?>>50% Votes (<?php echo(ceil($stats["voters"] / 2)); ?>)</option>