PageRenderTime 54ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/lib/exe/ajax.php

http://github.com/splitbrain/dokuwiki
PHP | 25 lines | 12 code | 4 blank | 9 comment | 3 complexity | 1efcd51ee922932e8cf28ff2bc5f5152 MD5 | raw file
Possible License(s): GPL-3.0, LGPL-2.1, GPL-2.0
  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('utf8_stripspecials')->str('call');
  18. new \dokuwiki\Ajax($call);
  19. } else {
  20. http_status(404);
  21. }