Source for file file_uploads.php

Documentation is available at file_uploads.php

  1. <?php
  2. /**
  3. * Test Class for file_uploads
  4. *
  5. * @package PhpSecInfo
  6. * @author Ed Finkler <coj@funkatron.com>
  7. */
  8.  
  9.  
  10. /**
  11. * require the PhpSecInfo_Test_Core class
  12. */
  13. require_once('PhpSecInfo/Test/Test_Core.php');
  14.  
  15. /**
  16. * Test Class for file_uploads
  17. *
  18. * @package PhpSecInfo
  19. */
  20. class PhpSecInfo_Test_Core_File_Uploads extends PhpSecInfo_Test_Core
  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 = "file_uploads";
  29.  
  30. var $recommended_value = FALSE;
  31. function _retrieveCurrentValue() {
  32. $this->current_value = $this->returnBytes(ini_get('file_uploads'));
  33. }
  34. /**
  35. * Checks to see if expose_php is enabled
  36. *
  37. */
  38. function _execTest() {
  39. if ($this->current_value == $this->recommended_value) {
  40. return PHPSECINFO_TEST_RESULT_OK;
  41. }
  42. return PHPSECINFO_TEST_RESULT_NOTICE;
  43. }
  44. /**
  45. * Set the messages specific to this test
  46. *
  47. */
  48. function _setMessages() {
  49. parent::_setMessages();
  50. $this->setMessageForResult(PHPSECINFO_TEST_RESULT_OK, 'en', 'file_uploads are disabled. Unless you\'re sure you need them, this is the recommended setting');
  51. $this->setMessageForResult(PHPSECINFO_TEST_RESULT_NOTICE, 'en', 'file_uploads are enabled. If you do not require file upload capability, consider disabling them.');
  52. }
  53.  
  54. }

Documentation generated on Fri, 06 Apr 2007 13:32:12 -0400 by phpDocumentor 1.3.0RC3