X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=index.php;h=520d7d30af41cfc17f721334279d7a15fabb3c7d;hb=ef4275c50edad6de268d53214db37f071e227b34;hp=369f49267fd9679f8fb9417fee66f84f5ec106dd;hpb=ca2012366bfbe008a2177336d9b787d2bab43a3d;p=github%2Fshaarli%2FShaarli.git 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;