1<?php
2
3/**
4 * DokuWiki AJAX call handler
5 *
6 * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
7 * @author     Andreas Gohr <andi@splitbrain.org>
8 */
9
10use dokuwiki\Utf8\Clean;
11use dokuwiki\Ajax;
12
13if (!defined('DOKU_INC')) define('DOKU_INC', __DIR__ . '/../../');
14require_once(DOKU_INC . 'inc/init.php');
15
16//close session
17session_write_close();
18
19// default header, ajax call may overwrite it later
20header('Content-Type: text/html; charset=utf-8');
21
22//call the requested function
23global $INPUT;
24if ($INPUT->has('call')) {
25    $call = $INPUT->filter([Clean::class, 'stripspecials'])->str('call');
26    new Ajax($call);
27} else {
28    http_status(404);
29}
30