Skip to content

Commit

Permalink
Autoupdater Robot
Browse files Browse the repository at this point in the history
  • Loading branch information
CuteNews committed Sep 20, 2013
1 parent 74cd4fc commit f5944db
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
22 changes: 22 additions & 0 deletions core/core.php
Expand Up @@ -1003,6 +1003,28 @@ function cn_config_load()
setoption("#grp", $cfg['grp']);
}

// Since 2.0.1: Filter magic quotes gpc
function cn_filter_magic_quotes($in = null, $lv = 0)
{
if ($lv == 0)
{
$_GET = cn_filter_magic_quotes($_GET, 1);
$_POST = cn_filter_magic_quotes($_POST, 1);
$_COOKIE = cn_filter_magic_quotes($_COOKIE, 1);

return TRUE;
}
elseif (is_array($in))
{
foreach ($in as $a => $b) $in[$a] = cn_filter_magic_quotes($b, $lv + 1);
return $in;
}
else
{
return stripslashes($in);
}
}

// Since 2.0: Save whole config
function cn_config_save($cfg = null)
{
Expand Down
4 changes: 3 additions & 1 deletion core/init.php
Expand Up @@ -6,7 +6,6 @@

// definitions
error_reporting(E_ALL ^ E_NOTICE);
ini_set('magic_quotes_gpc', 0);

define('EXEC_TIME', microtime(true));
define('VERSION', '2.0');
Expand All @@ -23,6 +22,9 @@
require_once SERVDIR . '/core/news.php';
require_once SERVDIR . '/core/captcha/captcha.php';

// magic quotes = ON, filtering it
if (ini_get('magic_quotes_gpc')) cn_filter_magic_quotes();

// catch errors
set_error_handler("user_error_handler");

Expand Down

0 comments on commit f5944db

Please sign in to comment.