Source for file force_redirect.php

Documentation is available at force_redirect.php

  1. <?php
  2. /**
  3. * Test class for cgi force_redirect
  4. *
  5. * @package PhpSecInfo
  6. * @author Ed Finkler <coj@funkatron.com>
  7. */
  8.  
  9. /**
  10. * require the PhpSecInfo_Test_Cgi class
  11. */
  12. require_once('PhpSecInfo/Test/Test_Cgi.php');
  13.  
  14. /**
  15. * Test class for cgi force_redirect
  16. *
  17. * @package PhpSecInfo
  18. * @author Ed Finkler <coj@funkatron.com>
  19. */
  20. class PhpSecInfo_Test_Cgi_Force_Redirect extends PhpSecInfo_Test_Cgi
  21. {
  22.  
  23. /**
  24. * This should be a <b>unique</b>, human-readable identifier for this test
  25. *
  26. * @var string
  27. */
  28. var $test_name = "force_redirect";
  29. /**
  30. * Checks to see if cgi.force_redirect is enabled
  31. *
  32. */
  33. function _execTest() {
  34. if ($this->getBooleanIniValue('cgi.force_redirect')) {
  35. return PHPSECINFO_TEST_RESULT_OK;
  36. }
  37. return PHPSECINFO_TEST_RESULT_WARN;
  38. }
  39. /**
  40. * Set the messages specific to this test
  41. *
  42. */
  43. function _setMessages() {
  44. parent::_setMessages();
  45. $this->setMessageForResult(PHPSECINFO_TEST_RESULT_OK, 'en', "force_redirect is enabled, which is the recommended setting");
  46. $this->setMessageForResult(PHPSECINFO_TEST_RESULT_WARN, 'en', "force_redirect is disabled. In most cases, this is a <strong>serious</strong> security vulnerability. Unless you are absolutely sure this is not needed, enable this setting");
  47. }
  48. }

Documentation generated on Tue, 24 Oct 2006 10:53:35 -0400 by phpDocumentor 1.3.0RC3