Beispiel #1
0
function JLV_EscapeArray($inp)
{
    if (is_array($inp)) {
        foreach ($inp as $key => $value) {
            if (is_array($inp[$key])) {
                $inp[$key] = JLV_EscapeArray($inp[$key]);
            } else {
                if (get_magic_quotes_gpc()) {
                    $inp[$key] = mysql_real_escape_string(stripslashes((string) $inp[$key]));
                } else {
                    $inp[$key] = mysql_real_escape_string((string) $inp[$key]);
                }
            }
        }
    }
    return $inp;
}
Beispiel #2
0
 * Connect to db
 */
if (isset($CFG->mysql_host) && !empty($CFG->mysql_host)) {
    if ($CFG->mysql_extension == 'mysql') {
        mysql_connect($CFG->mysql_host, $CFG->mysql_username, $CFG->mysql_password);
        mysql_select_db($CFG->mysql_db);
    }
}
/*
 * Import framework libraries and classes
 */
require_once FRAMEWORK_PATH . "/library/JLV_Core.php";
require_once FRAMEWORK_PATH . "/library/JLV_lib.php";
/*
 * Import custom libraries and classes
 */
@(include_once SITE_PATH . "/library/custom.methods.php");
foreach ($CFG->include_libraries as $libname) {
    if (file_exists(SITE_PATH . "/library/lib." . $libname . ".php")) {
        @(include_once SITE_PATH . "/library/lib." . $libname . ".php");
    }
}
/*
 * Escape input variables
 */
if ($CFG->mysql_escape_http_post && isset($_POST) && count($_POST)) {
    $_POST = JLV_EscapeArray($_POST);
}
if ($CFG->mysql_escape_http_get && isset($_GET) && count($_GET)) {
    $_GET = JLV_EscapeArray($_GET);
}