mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 07:05:56 +00:00
fix several issues reported by phpstan
This commit is contained in:
@@ -34,8 +34,8 @@
|
||||
error_reporting(E_ALL & ~E_NOTICE);
|
||||
}
|
||||
|
||||
ini_set('display_errors', 0);
|
||||
ini_set('display_startup_errors', 0);
|
||||
ini_set('display_errors', "false");
|
||||
ini_set('display_startup_errors', "false");
|
||||
|
||||
require_once 'config.php';
|
||||
|
||||
@@ -281,7 +281,7 @@
|
||||
} else if (is_string($param)) {
|
||||
return trim(strip_tags($param));
|
||||
} else {
|
||||
return trim($param);
|
||||
return $param;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -430,7 +430,7 @@
|
||||
}
|
||||
|
||||
function uniqid_short() {
|
||||
return uniqid(base_convert(rand(), 10, 36));
|
||||
return uniqid(base_convert((string)rand(), 10, 36));
|
||||
}
|
||||
|
||||
function T_sprintf() {
|
||||
|
||||
@@ -40,8 +40,6 @@
|
||||
array_push($errors, "Configuration file not found. Looks like you forgot to copy config.php-dist to config.php and edit it.");
|
||||
} else {
|
||||
|
||||
require_once "sanity_config.php";
|
||||
|
||||
if (!file_exists("config.php")) {
|
||||
array_push($errors, "Please copy config.php-dist to config.php");
|
||||
}
|
||||
@@ -78,12 +76,14 @@
|
||||
array_push($errors, "Data export cache is not writable (chmod -R 777 ".CACHE_DIR."/export)");
|
||||
}
|
||||
|
||||
require_once "sanity_config.php";
|
||||
|
||||
if (GENERATED_CONFIG_CHECK != EXPECTED_CONFIG_VERSION) {
|
||||
array_push($errors,
|
||||
"Configuration option checker sanity_config.php is outdated, please recreate it using ./utils/regen_config_checks.sh");
|
||||
}
|
||||
|
||||
foreach ($required_defines as $d) {
|
||||
foreach (get_required_defines() as $d) {
|
||||
if (!defined($d)) {
|
||||
array_push($errors,
|
||||
"Required configuration file parameter $d is not defined in config.php. You might need to copy it from config.php-dist.");
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<?php # This file has been generated at: Fri Feb 12 21:33:46 MSK 2021
|
||||
<?php # This file has been generated at: Mon Feb 22 14:17:27 MSK 2021
|
||||
define('GENERATED_CONFIG_CHECK', 26);
|
||||
$required_defines = array( 'DB_TYPE', 'DB_HOST', 'DB_USER', 'DB_NAME', 'DB_PASS', 'MYSQL_CHARSET', 'SELF_URL_PATH', 'SINGLE_USER_MODE', 'SIMPLE_UPDATE_MODE', 'PHP_EXECUTABLE', 'LOCK_DIRECTORY', 'CACHE_DIR', 'ICONS_DIR', 'ICONS_URL', 'AUTH_AUTO_CREATE', 'AUTH_AUTO_LOGIN', 'FORCE_ARTICLE_PURGE', 'SESSION_COOKIE_LIFETIME', 'SMTP_FROM_NAME', 'SMTP_FROM_ADDRESS', 'DIGEST_SUBJECT', 'CHECK_FOR_UPDATES', 'PLUGINS', 'LOG_DESTINATION', 'CONFIG_VERSION'); ?>
|
||||
function get_required_defines() { return [ 'DB_TYPE', 'DB_HOST', 'DB_USER', 'DB_NAME', 'DB_PASS', 'MYSQL_CHARSET', 'SELF_URL_PATH', 'SINGLE_USER_MODE', 'SIMPLE_UPDATE_MODE', 'PHP_EXECUTABLE', 'LOCK_DIRECTORY', 'CACHE_DIR', 'ICONS_DIR', 'ICONS_URL', 'AUTH_AUTO_CREATE', 'AUTH_AUTO_LOGIN', 'FORCE_ARTICLE_PURGE', 'SESSION_COOKIE_LIFETIME', 'SMTP_FROM_NAME', 'SMTP_FROM_ADDRESS', 'DIGEST_SUBJECT', 'CHECK_FOR_UPDATES', 'PLUGINS', 'LOG_DESTINATION', 'CONFIG_VERSION']; }
|
||||
|
||||
@@ -12,14 +12,14 @@
|
||||
$session_name = (!defined('TTRSS_SESSION_NAME')) ? "ttrss_sid" : TTRSS_SESSION_NAME;
|
||||
|
||||
if (is_server_https()) {
|
||||
ini_set("session.cookie_secure", true);
|
||||
ini_set("session.cookie_secure", "true");
|
||||
}
|
||||
|
||||
ini_set("session.gc_probability", 75);
|
||||
ini_set("session.gc_probability", "75");
|
||||
ini_set("session.name", $session_name);
|
||||
ini_set("session.use_only_cookies", true);
|
||||
ini_set("session.use_only_cookies", "true");
|
||||
ini_set("session.gc_maxlifetime", $session_expire);
|
||||
ini_set("session.cookie_lifetime", 0);
|
||||
ini_set("session.cookie_lifetime", "0");
|
||||
|
||||
function session_get_schema_version() {
|
||||
global $schema_version;
|
||||
|
||||
Reference in New Issue
Block a user