Location: PHPKode > projects > Bloggie Lite > init.php
<?

// Copyright (C) Bloggie Lite Written by : Sean
// http://www.mywebland.com , http://mybloggie.mywebland.com

// You are requested to retain this copyright notice in order to use
// this software.

//This program is free software; you can redistribute it and/or
//modify it under the terms of the GNU General Public License
//as published by the Free Software Foundation; either version 2
//of the License, or (at your option) any later version.

//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.

//You should have received a copy of the GNU General Public License
//along with this program; if not, write to the Free Software
//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

if ( !defined('IN_BLOGGIE') )
{
    die("Hacking attempt");
}

//
//error_reporting  (E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninitialized variables
set_magic_quotes_runtime(0); // Disable magic_quotes_runtime

$user_ip = $_SERVER['REMOTE_ADDR'];         // cookie new antispam code

define('ABSDIR', dirname(__FILE__).'/');

// For server with PHP as CGI hosts
if ( strstr( $_SERVER['SCRIPT_NAME'], 'php.cgi' ) )
    unset($_SERVER['PATH_INFO']);

// Emulate register_globals off
function unregister_GLOBALS()
{
if (!ini_get('register_globals')) {
return;
}


// Protect against GLOBALS tricks
if (isset($_REQUEST['GLOBALS']) || isset($_FILES['GLOBALS'])) {
die('GLOBALS overwrite attempt detected');
}

if (isset($_POST['GLOBALS']) || isset($_FILES['GLOBALS']) || isset($_GET['GLOBALS']) || isset($_COOKIE['GLOBALS'])  || isset($_REQUEST['GLOBALS'] )) {
    die('GLOBALS overwrite attempt detected');
}

if (isset($_SESSION) && !is_array($_SESSION)) {
    die('GLOBALS overwrite attempt detected');
}


// Variables that shouldn't be unset
$noUnset = array('GLOBALS', '_GET',
'_POST', '_COOKIE',
'_REQUEST', '_SERVER',
'_ENV', '_FILES');

$input = array_merge($_GET, $_POST,
$_COOKIE, $_SERVER,
$_ENV, $_FILES,
isset($_SESSION) && is_array($_SESSION) ? $_SESSION : array());

foreach ($input as $k => $v) {
if (!in_array($k, $noUnset) && isset($GLOBALS[$k])) {
unset($GLOBALS[$k]);
}
}
}

unregister_GLOBALS();

if( !get_magic_quotes_gpc() )
{
    if( is_array($_GET) )
    {
        while( list($k, $v) = each($_GET) )
        {
            if( is_array($_GET[$k]) )
            {
                while( list($k2, $v2) = each($_GET[$k]) )
                {
                    $_GET[$k][$k2] = addslashes($v2);
                    $_GET[$k][$k2] = htmlspecialchars($v2);
                }
                @reset($_GET[$k]);
            }
            else
            {
                $_GET[$k] = addslashes($v);
                $_GET[$k] = htmlspecialchars($v);
            }
        }
        @reset($_GET);
    }

    if( is_array($_POST) )
    {
        while( list($k, $v) = each($_POST) )
        {
            if( is_array($_POST[$k]) )
            {
                while( list($k2, $v2) = each($_POST[$k]) )
                {
                    $_POST[$k][$k2] = addslashes($v2);
                }
                @reset($_POST[$k]);
            }
            else
            {
                $_POST[$k] = addslashes($v);
            }
        }
        @reset($_POST);
    }

    if( is_array($_COOKIE) )
    {
        while( list($k, $v) = each($_COOKIE) )
        {
            if( is_array($_COOKIE[$k]) )
            {
                while( list($k2, $v2) = each($_COOKIE[$k]) )
                {
                    $_COOKIE[$k][$k2] = addslashes($v2);
                }
                @reset($_COOKIE[$k]);
            }
            else
            {
                $_COOKIE[$k] = addslashes($v);
            }
        }
        @reset($_COOKIE);
    }
}

include_once($bloggie_root_path.'config.php');
include_once($bloggie_root_path.'includes/db.php');
include_once($bloggie_root_path.'includes/template.php');
include_once($bloggie_root_path.'includes/functions.php');
include_once($bloggie_root_path.'includes/function-format.php');
include_once($bloggie_root_path.'includes/classes.php');

$html_entities_match = array('#&(?!(\#[0-9]+;))#', '#<#', '#>#', '#"#');
$html_entities_replace = array('&amp;', '&lt;', '&gt;', '&quot;');

$pref_data = pref_data() ;

$active_plugins = unserialize($pref_data["plugins"]);
if ( $active_plugins ) {
   if ( is_array($active_plugins) ) {
      foreach ($active_plugins as $plugin) {
         if ('' != $plugin && file_exists('./plugins/' . $plugin)) include_once('./plugins/' . $plugin);
      }
   }
}

?>
Return current item: Bloggie Lite