ajax.php 645 B

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