some cleanups found on the way
This commit is contained in:
@ -216,7 +216,6 @@ document.body.insertBefore(fragment, document.body.childNodes[0]);
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!function_exists('file_get_contents')) {
|
if (!function_exists('file_get_contents')) {
|
||||||
function file_get_contents($filename, $use_include_path = 0) {
|
function file_get_contents($filename, $use_include_path = 0) {
|
||||||
$file = fopen($filename, 'rb', $use_include_path);
|
$file = fopen($filename, 'rb', $use_include_path);
|
||||||
@ -333,7 +332,6 @@ if (ini_get('magic_quotes_gpc')) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Merge get and post into the serendipity array
|
// Merge get and post into the serendipity array
|
||||||
$serendipity['GET'] = &$_GET['serendipity'];
|
$serendipity['GET'] = &$_GET['serendipity'];
|
||||||
$serendipity['POST'] = &$_POST['serendipity'];
|
$serendipity['POST'] = &$_POST['serendipity'];
|
||||||
|
@ -46,7 +46,10 @@ function serendipity_truncateString($s, $len) {
|
|||||||
*/
|
*/
|
||||||
function serendipity_gzCompression() {
|
function serendipity_gzCompression() {
|
||||||
global $serendipity;
|
global $serendipity;
|
||||||
if (isset($serendipity['useGzip']) && serendipity_db_bool($serendipity['useGzip']) && function_exists('ob_gzhandler') && extension_loaded('zlib') && serendipity_ini_bool(ini_get('zlib.output_compression')) == false && serendipity_ini_bool(ini_get('session.use_trans_sid')) == false) {
|
if (isset($serendipity['useGzip']) && serendipity_db_bool($serendipity['useGzip'])
|
||||||
|
&& function_exists('ob_gzhandler') && extension_loaded('zlib')
|
||||||
|
&& serendipity_ini_bool(ini_get('zlib.output_compression')) == false
|
||||||
|
&& serendipity_ini_bool(ini_get('session.use_trans_sid')) == false) {
|
||||||
ob_start("ob_gzhandler");
|
ob_start("ob_gzhandler");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1160,7 +1163,8 @@ function serendipity_build_query(&$array, $array_prefix = null, $comb_char = '&a
|
|||||||
return implode($comb_char, $ret);
|
return implode($comb_char, $ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Picks a specified key from an array and returns it
|
/**
|
||||||
|
* Picks a specified key from an array and returns it
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @param array The input array
|
* @param array The input array
|
||||||
@ -1188,7 +1192,8 @@ function &serendipity_pickKey(&$array, $key, $default) {
|
|||||||
return $default;
|
return $default;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Retrieves the current timestamp but only deals with minutes to optimize Database caching
|
/**
|
||||||
|
* Retrieves the current timestamp but only deals with minutes to optimize Database caching
|
||||||
* @access public
|
* @access public
|
||||||
* @return timestamp
|
* @return timestamp
|
||||||
* @author Matthew Groeninger
|
* @author Matthew Groeninger
|
||||||
@ -1205,23 +1210,23 @@ function serendipity_db_time() {
|
|||||||
return $ts;
|
return $ts;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Inits the logger.
|
/**
|
||||||
|
* Inits the logger.
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
function serendipity_initLog() {
|
function serendipity_initLog() {
|
||||||
global $serendipity;
|
global $serendipity;
|
||||||
|
|
||||||
if (isset($serendipity['logLevel']) && $serendipity['logLevel'] !== 'Off') {
|
if (isset($serendipity['logLevel']) && $serendipity['logLevel'] !== 'Off') {
|
||||||
if ($serendipity['logLevel'] == 'debug') {
|
if ($serendipity['logLevel'] == 'debug') {
|
||||||
$log_level = Psr\Log\LogLevel::DEBUG;
|
$log_level = Psr\Log\LogLevel::DEBUG;
|
||||||
} else {
|
} else {
|
||||||
$log_level = Psr\Log\LogLevel::ERROR;
|
$log_level = Psr\Log\LogLevel::ERROR;
|
||||||
}
|
}
|
||||||
|
$serendipity['logger'] = new Katzgrau\KLogger\Logger($serendipity['serendipityPath'] . '/templates_c/logs', $log_level);
|
||||||
$serendipity['logger'] = new Katzgrau\KLogger\Logger($serendipity['serendipityPath'] . '/templates_c/logs', $log_level);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
define("serendipity_FUNCTIONS_LOADED", true);
|
define("serendipity_FUNCTIONS_LOADED", true);
|
||||||
/* vim: set sts=4 ts=4 expandtab : */
|
/* vim: set sts=4 ts=4 expandtab : */
|
||||||
|
@ -438,7 +438,7 @@ function serendipity_printComments($comments, $parentid = 0, $depth = 0, $trace
|
|||||||
function serendipity_printCommentsByAuthor() {
|
function serendipity_printCommentsByAuthor() {
|
||||||
global $serendipity;
|
global $serendipity;
|
||||||
|
|
||||||
$type = serendipity_db_escape_string($serendipity['GET']['commentMode']);
|
$type = serendipity_db_escape_string($serendipity['GET']['commentMode']);
|
||||||
|
|
||||||
if ($type == 'comments' || empty($type)) {
|
if ($type == 'comments' || empty($type)) {
|
||||||
$type = 'NORMAL';
|
$type = 'NORMAL';
|
||||||
|
Reference in New Issue
Block a user