Пример #1
0
function SECURITY($debug, $userlevel, $censor)
{
    if (count($_POST) != 0 || count($_GET) != 0) {
        if (count($_POST) != 0) {
            include "plugins/decoda/decoda.php";
            foreach ($_POST as $key => $val) {
                if ($key == 'message') {
                    $code = new Decoda($val);
                    $code->useShorthand(false);
                    $code->makeClickable(true);
                    $code->setupGeshi("use_css = false");
                    $code->addCensored(array($censor));
                    $val = $code->parse(true);
                }
                $_POST[$key] = $val;
                if ($debug == 1 && $userlevel == 255) {
                    echo "POST ARRAY - Field : {$key} Value: {$val}<br />";
                }
            }
            return $_POST;
        } elseif (count($_GET) != 0) {
            foreach ($_GET as $key => $val) {
                $val = addslashes($val);
                $val = htmlentities($val, ENT_QUOTES);
                $_GET[$key] = $val;
                if ($debug == 1 && $userlevel == 255) {
                    echo "GET ARRAY - Field : {$key} Value: {$val}<br />";
                }
            }
            return $_GET;
        } else {
            die("ERROR with the http phaser");
        }
    }
    if ($debug == 1 && $userlevel == 255) {
        if (is_array($_SESSION)) {
            foreach ($_SESSION as $key => $val) {
                $_SESSION[$key] = $val;
                echo "SESSION ARRAY - Field : {$key} Value: {$val}<br />";
            }
        }
    }
}
Пример #2
0
 */
protected function parseDefaults($string) {
	if (empty($this->allowed)) {
		$code = $this->markupCode;
		$result = $this->markupResult;
	} else {
		$code = array();
		$result = array();
		foreach ($this->markupCode as $tag => $regex) {
			if (in_array($tag, $this->allowed)) {
				$code[$tag] = $this->markupCode[$tag];
				$result[$tag] = $this->markupResult[$tag];
			}
		}
	}
	
	$string = preg_replace($code, $result, $string);
	return $string;
}[/code]';
// Translate
$code = new Decoda($string);
$code->useShorthand(false);
$code->makeClickable(true);
//$code->addCensored(array('sit'));
$test = $code->parse(true);
echo $test;
?>

</body>
</html>