xref: /dokuwiki/lib/exe/ajax.php (revision e3c3abf1ebade68a06abb03d098d58afda87b317)
1f62ea8a1Sandi<?php
2*e3c3abf1SAndreas Gohruse dokuwiki\Utf8\Clean;
3*e3c3abf1SAndreas Gohruse dokuwiki\Ajax;
4f62ea8a1Sandi/**
5f62ea8a1Sandi * DokuWiki AJAX call handler
6f62ea8a1Sandi *
7f62ea8a1Sandi * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
8f62ea8a1Sandi * @author     Andreas Gohr <andi@splitbrain.org>
9f62ea8a1Sandi */
10f62ea8a1Sandi
11*e3c3abf1SAndreas Gohrif (!defined('DOKU_INC')) define('DOKU_INC', __DIR__ . '/../../');
12f62ea8a1Sandirequire_once(DOKU_INC . 'inc/init.php');
13814e20b8SYurii K
1424b3cb1aSAndreas Gohr//close session
158746e727Sandisession_write_close();
16f62ea8a1Sandi
1716a367d4SAndreas Gohr// default header, ajax call may overwrite it later
1895657bc6Sandiheader('Content-Type: text/html; charset=utf-8');
1995657bc6Sandi
20f62ea8a1Sandi//call the requested function
2116a367d4SAndreas Gohrglobal $INPUT;
22e0ded59cSAndreas Gohrif ($INPUT->has('call')) {
23*e3c3abf1SAndreas Gohr    $call = $INPUT->filter([Clean::class, 'stripspecials'])->str('call');
24*e3c3abf1SAndreas Gohr    new Ajax($call);
25f62ea8a1Sandi} else {
2616a367d4SAndreas Gohr    http_status(404);
2780423ab6SAdrian Lang}
28