function slashStrip($input) { if (is_array($input)) { foreach ($input as $key => $value) { $input[$key] = PommoHelper::slashStrip($value); } return $input; } else { return stripslashes($input); } }
} // [RELEASE] // Include core components require dirname(__FILE__) . '/inc/helpers/common.php'; // base helper functions require dirname(__FILE__) . '/inc/classes/api.php'; // base API require dirname(__FILE__) . '/inc/classes/pommo.php'; // base object // Setup the core global. All utility is tucked away within this global to reduce namespace // pollution and possible collissions when poMMo is embedded in another application. $GLOBALS['pommo'] = new Pommo(dirname(__FILE__) . '/'); /* * Disable session.use_trans_sid to mitigate performance-penalty * (do it before any output is started) [from gallery2] */ if (!defined('SID')) { @ini_set('session.use_trans_sid', 0); } // soft turn off magic quotes -- NOTE; this may break embedded scripts? // clean user input of slashes added by magic quotes. TODO; optimize this. if (get_magic_quotes_gpc()) { $_REQUEST = PommoHelper::slashStrip($_REQUEST); $_GET = PommoHelper::slashStrip($_GET); $_POST = PommoHelper::slashStrip($_POST); } // disable escaping from DB ini_set("magic_quotes_runtime", 0); // Assign alias to the core global which can be used by the script calling bootstrap.php $pommo =& $GLOBALS['pommo']; $pommo->preinit();