whitelist.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * Exporting of $goto_whitelist from PHP to Javascript
  5. *
  6. * @package PhpMyAdmin
  7. */
  8. chdir('..');
  9. // Send correct type:
  10. header('Content-Type: text/javascript; charset=UTF-8');
  11. // Cache output in client - the nocache query parameter makes sure that this
  12. // file is reloaded when config changes
  13. header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 3600) . ' GMT');
  14. // Avoid loading the full common.inc.php because this would add many
  15. // non-js-compatible stuff like DOCTYPE
  16. define('PMA_MINIMUM_COMMON', true);
  17. require_once './libraries/common.inc.php';
  18. // Close session early as we won't write anything there
  19. session_write_close();
  20. require_once './libraries/OutputBuffering.class.php';
  21. $buffer = PMA_OutputBuffering::getInstance();
  22. $buffer->start();
  23. register_shutdown_function(
  24. function () {
  25. echo PMA_OutputBuffering::getInstance()->getContents();
  26. }
  27. );
  28. echo "var PMA_gotoWhitelist = new Array();\n";
  29. $i = -1;
  30. foreach ($GLOBALS['goto_whitelist'] as $one_whitelist) {
  31. $i++;
  32. echo 'PMA_gotoWhitelist[' . $i . ']="' . $one_whitelist . '";' . "\n";
  33. }