diff options
| author | 8chan <admin@8chan.co> | 2014-08-10 15:14:11 +0000 |
|---|---|---|
| committer | Fredrick Brennan <admin@8chan.co> | 2014-08-10 15:38:02 +0000 |
| commit | e28f233e3de6d471ab2ce9c178ba8d626bbeb563 (patch) | |
| tree | 8fad1562d17030986032a9428fb88067c3bd8289 /inc | |
| parent | 1ea3da1db6c5291abfbd99aa8f5f7e28de8ed9ed (diff) | |
Close #51: Prevent players from cheating the dice roller by using markup
Diffstat (limited to 'inc')
| -rw-r--r-- | inc/functions.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/inc/functions.php b/inc/functions.php index 24ec3863..a88e8fc8 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -2333,6 +2333,7 @@ function shell_exec_error($command, $suppress_stdout = false) { * added on. The result is displayed at the top of the post. */ function diceRoller($post) { + global $config; if(strpos(strtolower($post->email), 'dice%20') === 0) { $dicestr = str_split(substr($post->email, strlen('dice%20'))); @@ -2380,7 +2381,7 @@ function diceRoller($post) { // Prepend the result to the post body $modifier = ($diceZ != 0) ? ((($diceZ < 0) ? ' - ' : ' + ') . abs($diceZ)) : ''; $dicesum = ($diceX > 1) ? ' = ' . $dicesum : ''; - $post->body = 'Rolled ' . implode(', ', $dicerolls) . $modifier . $dicesum . '<br/>' . $post->body; + $post->body = '<table class="diceroll"><tr><td><img src="'.$config['dir']['static'].'d10.svg" alt="Dice roll" width="24"></td><td>Rolled ' . implode(', ', $dicerolls) . $modifier . $dicesum . '</td></tr></table><br/>' . $post->body; } } } |
