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