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