Warning: Use of undefined LOCAL_SERVER - assumed 'LOCAL_SERVER' in /web/includes/page-definitions.php on line 13
<?php
error_reporting(8191);
if (!DEBUG)
{
function errorHandler ($errno, $errstr, $errfile, $errline)
{
// .
if ($errno == E_ERROR ||
$errno == E_PARSE ||
$errno == E_CORE_ERROR ||
$errno == E_COMPILE_ERROR ||
$errno == E_USER_ERROR)
{
// . , «, »...
}
return true;
}
set_error_handler('errorHandler');
}
?>
<?php
...
if (check_admin($..., $...))
{
...
$user_level = 169;
}
...
if ($user_level > 150)
{
echo 'Boom!';
}
?>
<?php
$user = mysql_fetch_assoc(mysql_query("SELECT * FROM `users` WHERE `username` = '{$_POST['username'}' AND `password` = '{$_POST['password']}'"));
?>
<?php
{
if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc())
{
function stripslashes_deep($value)
{
if(is_array($value))
{
$value = array_map('stripslashes_deep', $value);
}
elseif (!empty($value) && is_string($value))
{
$value = stripslashes($value);
}
return $value;
}
$_POST = stripslashes_deep($_POST);
$_GET = stripslashes_deep($_GET);
$_COOKIE = stripslashes_deep($_COOKIE);
}
}
?>
<?php
function quote($value) {
if (!is_numeric($value)) {
$value = "'".mysql_real_escape_string($value)."'";
}
return $value;
}
?>
<?php
$user = mysql_fetch_assoc(mysql_query('SELECT * FROM `users` WHERE `username` = '.quote($_POST['username']).' AND `password` = '.quote($_POST['password'])));
?>
<?php
if (are_bad_symbols($data)) boo();
?>
<?php
if (!all_good_symbols($data)) boo();
// :
is_numeric($data);
preg_match('/[a-z0-9_-]*/i', $data)
...
?>
<?php
include($_GET['module'] . '.php');
?>
<?php
session_start();
$_SESSION['userid'] = 168;
session_write_close();
?>
Source: https://habr.com/ru/post/12067/
All Articles