Subversion Repositories ggsysinfo

[/] [modules/] [sysinfo/] [lib/] [PhpSecInfo/] [Test/] [Suhosin/] [extension.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 Suhosin extension
4
 *
5
 * @package PhpSecInfo
6
 * @author Piwik
7
 */
8
 
9
/**
10
 * require the PhpSecInfo_Test_Suhosin class
11
 */
12
require_once(PHPSECINFO_BASE_DIR.'/Test/Test_Suhosin.php');
13
 
14
/**
15
 * Test class for Suhosin extension
16
 *
17
 * Checks for suhosin extension
18
 *
19
 * @package PhpSecInfo
20
 * @author Piwik
21
 */
22
class PhpSecInfo_Test_Suhosin_Extension extends PhpSecInfo_Test_Suhosin
23
{
24
        var $test_name = "Suhosin extension";
25
 
26
        var $recommended_value = true;
27
 
28
        function _retrieveCurrentValue() {
29
                $this->current_value = extension_loaded('suhosin');
30
        }
31
 
32
        function _execTest() {
33
                if ( $this->current_value === true ) {
34
                        return PHPSECINFO_TEST_RESULT_OK;
35
                } else {
36
                        return PHPSECINFO_TEST_RESULT_NOTICE;
37
                }
38
        }
39
 
40
        function _setMessages() {
41
                parent::_setMessages();
42
 
43
                $this->setMessageForResult(PHPSECINFO_TEST_RESULT_OK, 'en', "You are running PHP with the Suhosin extension loaded. This extension provides high-level runtime protections, and additional filtering and logging features.");
44
                $this->setMessageForResult(PHPSECINFO_TEST_RESULT_NOTICE, 'en', "You are not running PHP with the Suhosin extension loaded. We recommend both the patch and extension for low- and high-level protections including transparent cookie encryption and remote inclusion vulnerabilities.");
45
        }
46
}