From ef4275c50edad6de268d53214db37f071e227b34 Mon Sep 17 00:00:00 2001 From: Seb Sauvage Date: Tue, 20 Sep 2011 13:28:06 +0200 Subject: Version 0.0.14 beta --- index.php | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/index.php b/index.php index 369f4926..520d7d30 100644 --- a/index.php +++ b/index.php @@ -1,5 +1,5 @@ '); // Suffix to encapsulate data in php code. +$STARTTIME = microtime(true); // Measure page execution time. checkphpversion(); error_reporting(E_ALL^E_WARNING); // See all error except warnings. //error_reporting(-1); // See all errors (for debugging only) -$STARTTIME = microtime(true); // Measure page execution time. ob_start(); +// In case stupid admin has left magic_quotes enabled in php.ini: +if (get_magic_quotes_gpc()) +{ + function stripslashes_deep($value) { $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value); return $value; } + $_POST = array_map('stripslashes_deep', $_POST); + $_GET = array_map('stripslashes_deep', $_GET); + $_COOKIE = array_map('stripslashes_deep', $_COOKIE); +} // Prevent caching: (yes, it's ugly) header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); -define('shaarli_version','0.0.13 beta'); +define('shaarli_version','0.0.14 beta'); if (!is_dir(DATADIR)) { mkdir(DATADIR,0705); chmod(DATADIR,0705); } if (!is_file(DATADIR.'/.htaccess')) { file_put_contents(DATADIR.'/.htaccess',"Allow from none\nDeny from all\n"); } // Protect data files. if (!is_file(CONFIG_FILE)) install(); require CONFIG_FILE; // Read login/password hash into $GLOBALS. -ini_set('max_input_time','60'); // High execution time in case of problematic imports/exports. -ini_set('memory_limit', '128M'); // Try to set max upload file size and read (May not work on some hosts). -ini_set('post_max_size', '16M'); -ini_set('upload_max_filesize', '16M'); -define('PHPPREFIX',''); // Suffix to encapsulate data in php code. autoLocale(); // Sniff browser language and set date format accordingly. header('Content-Type: text/html; charset=utf-8'); // We use UTF-8 for proper international characters handling. $LINKSDB=false; -- cgit v1.2.3