Subversion Repositories ggsysinfo

[/] [modules/] [sysinfo/] [lib/] [PhpSecInfo/] [Test/] [Core/] [allow_url_include.php] - Blame information for rev 123

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 123 gg
<?php
2
/**
3
 * Test Class for allow_url_include
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_BASE_DIR.'/Test/Test_Core.php');
14
 
15
/**
16
 * Test Class for allow_url_include
17
 *
18
 * @package PhpSecInfo
19
 *
20
 *
21
 */
22
class PhpSecInfo_Test_Core_Allow_Url_Include extends PhpSecInfo_Test_Core
23
{
24
        /**
25
         * This should be a <b>unique</b>, human-readable identifier for this test
26
         *
27
         * @var string
28
         */
29
        var $test_name = "allow_url_include";
30
 
31
 
32
        var $recommended_value = FALSE;
33
 
34
 
35
        function _retrieveCurrentValue() {
36
                $this->current_value = $this->getBooleanIniValue('allow_url_include');
37
        }
38
 
39
 
40
        /**
41
         * Checks to see if allow_url_fopen is enabled
42
         *
43
         */
44
        function _execTest() {
45
                if ($this->current_value == $this->recommended_value) {
46
                        return PHPSECINFO_TEST_RESULT_OK;
47
                }
48
 
49
                return PHPSECINFO_TEST_RESULT_WARN;
50
        }
51
 
52
 
53
        /**
54
         * allow_url_include is only available since PHP 5.2
55
         *
56
         * @return boolean
57
         */
58
        function isTestable() {
59
                return version_compare(PHP_VERSION, '5.2', '>=');
60
        }
61
 
62
 
63
 
64
        /**
65
         * Set the messages specific to this test
66
         *
67
         */
68
        function _setMessages() {
69
                parent::_setMessages();
70
 
71
                $this->setMessageForResult(PHPSECINFO_TEST_RESULT_NOTRUN, 'en', 'You are running a version of PHP older than 5.2, and allow_url_include is not available');
72
                $this->setMessageForResult(PHPSECINFO_TEST_RESULT_OK, 'en', 'allow_url_include is disabled, which is the recommended setting');
73
                $this->setMessageForResult(PHPSECINFO_TEST_RESULT_WARN, 'en', 'allow_url_include is enabled.  This could be a serious security risk.  You should disable allow_url_include and consider using the <a href="http://php.net/manual/en/ref.curl.php" target="_blank">PHP cURL functions</a> instead.');
74
        }
75
 
76
 
77
}