[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/lib/exe/ -> ajax.php (source)

   1  <?php
   2  
   3  /**
   4   * DokuWiki AJAX call handler
   5   *
   6   * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
   7   * @author     Andreas Gohr <andi@splitbrain.org>
   8   */
   9  
  10  use dokuwiki\Utf8\Clean;
  11  use dokuwiki\Ajax;
  12  
  13  if (!defined('DOKU_INC')) define('DOKU_INC', __DIR__ . '/../../');
  14  require_once (DOKU_INC . 'inc/init.php');
  15  
  16  //close session
  17  session_write_close();
  18  
  19  // default header, ajax call may overwrite it later
  20  header('Content-Type: text/html; charset=utf-8');
  21  
  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);
  29  }