コード例 #1
0
function msb_gettoken()
{
    global $mybb, $lang, $parser, $settings;
    if (!is_object($parser)) {
        require_once MYBB_ROOT . 'inc/class_parser.php';
        $parser = new postParser();
    }
    if ($mybb->input['action'] != "msb_gettoken" || $mybb->request_method != "post") {
        return false;
        exit;
    }
    if (!verify_post_check($mybb->input['my_post_key'], true)) {
        xmlhttp_error($lang->invalid_post_code);
    }
    if ($mybb->input['action'] == "msb_gettoken") {
        $arraytoken = array('token' => msb_token_gen());
        echo json_encode($arraytoken);
    }
}
コード例 #2
0
function MSB_updatebadword()
{
    global $mybb, $badwordcache, $cache;
    if (!$badwordcache) {
        if (!is_array($badword_cache)) {
            $badword_cache = $cache->read("badwords");
        }
        foreach ($badword_cache as $badword) {
            $badword['badword'] = preg_quote(htmlspecialchars_uni($badword['badword']));
            if (!$badword['replacement']) {
                $badword['replacement'] = "*****";
            }
            $badword['replacement'] = htmlspecialchars_uni($badword['replacement']);
            $badwordcache[$badword['bid']] = $badword;
        }
    }
    $data = array("badw" => $badwordcache, "token" => msb_token_gen());
    unset($badword);
    sendPostDataMSB('upbadwl', $data);
}