xref: /dokuwiki/lib/exe/ajax.php (revision cdefa10b874351d06c6f83b3563ab9c3f116e5ab)
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
9if(!defined('DOKU_INC')) define('DOKU_INC', dirname(__FILE__) . '/../../');
10require_once(DOKU_INC . 'inc/init.php');
11
12//close session
13session_write_close();
14
15// default header, ajax call may overwrite it later
16header('Content-Type: text/html; charset=utf-8');
17
18//call the requested function
19global $INPUT;
20if($INPUT->has('call')) {
21    $call = $INPUT->filter('utf8_stripspecials')->str('call');
22    new \dokuwiki\Ajax($call);
23} else {
24    http_status(404);
25}
26