浏览代码

Close #51: Prevent players from cheating the dice roller by using markup

tags/vichan-4.9.92
8chan Fredrick Brennan 9 年前
父节点
当前提交
e28f233e3d
共有 2 个文件被更改,包括 163 次插入1 次删除
  1. +2
    -1
      inc/functions.php
  2. +161
    -0
      static/d10.svg

+ 2
- 1
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;
}
}
}

+ 161
- 0
static/d10.svg
文件差异内容过多而无法显示
查看文件


正在加载...
取消
保存