Slight modification to CSRF error message to make timeouts less user-unfriendly.
[htmlpurifier-web.git] / misc / phorum / htmlpurifier-custom / htmlpurifier-custom.php
blob01425d401f00fcb545d0e3c35fa0e443b03c3828
1 <?php
3 function phorum_htmlpurifier_custom_common() {
4 global $PHORUM;
5 $base = dirname(__FILE__) . '/../../..';
6 $PHORUM['DATA']['HP_NAVIGATION'] = @file_get_contents($base . '/navigation.frag');
8 function phorum_csrf_callback() {
9 echo 'CSRF check failed. Please ensure cookies are enabled and try resubmitting.<br><br>';
10 if (isset($_POST['body'])) {
11 echo 'You posted:<br><pre>' . htmlspecialchars($_POST['body']) . '</pre>';
15 function csrf_startup() {
16 csrf_conf('rewrite-js', '/csrf-magic/csrf-magic.js');
17 csrf_conf('callback', 'phorum_csrf_callback');
19 require_once $base . '/csrf-magic/csrf-magic.php';