@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | // 1) templates/register_notice.txt - displayed above the registration form |
5 | 5 | // 2) register_expire_do.php - contains user expiration queries when necessary |
6 | 6 | |
7 | - set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR . |
|
7 | + set_include_path(dirname(__FILE__)."/include".PATH_SEPARATOR. |
|
8 | 8 | get_include_path()); |
9 | 9 | |
10 | 10 | require_once "autoload.php"; |
@@ -25,13 +25,13 @@ discard block |
||
25 | 25 | |
26 | 26 | print '<?xml version="1.0" encoding="utf-8"?>'; |
27 | 27 | print "<feed xmlns=\"http://www.w3.org/2005/Atom\"> |
28 | - <id>".htmlspecialchars(SELF_URL_PATH . "/register.php")."</id> |
|
28 | + <id>".htmlspecialchars(SELF_URL_PATH."/register.php")."</id> |
|
29 | 29 | <title>Tiny Tiny RSS registration slots</title> |
30 | - <link rel=\"self\" href=\"".htmlspecialchars(SELF_URL_PATH . "/register.php?format=feed")."\"/> |
|
30 | + <link rel=\"self\" href=\"".htmlspecialchars(SELF_URL_PATH."/register.php?format=feed")."\"/> |
|
31 | 31 | <link rel=\"alternate\" href=\"".htmlspecialchars(SELF_URL_PATH)."\"/>"; |
32 | 32 | |
33 | 33 | if (ENABLE_REGISTRATION) { |
34 | - $result = db_query( "SELECT COUNT(*) AS cu FROM ttrss_users"); |
|
34 | + $result = db_query("SELECT COUNT(*) AS cu FROM ttrss_users"); |
|
35 | 35 | $num_users = db_fetch_result($result, 0, "cu"); |
36 | 36 | |
37 | 37 | $num_users = REG_MAX_USERS - $num_users; |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | |
45 | 45 | print "<entry> |
46 | 46 | <id>".htmlspecialchars(SELF_URL_PATH)."/register.php?$num_users"."</id> |
47 | - <link rel=\"alternate\" href=\"".htmlspecialchars(SELF_URL_PATH . "/register.php")."\"/>"; |
|
47 | + <link rel=\"alternate\" href=\"".htmlspecialchars(SELF_URL_PATH."/register.php")."\"/>"; |
|
48 | 48 | |
49 | 49 | print "<title>$num_users slots are currently available, registration $reg_suffix</title>"; |
50 | 50 | print "<summary>$num_users slots are currently available, registration $reg_suffix</summary>"; |
@@ -59,10 +59,10 @@ discard block |
||
59 | 59 | /* Remove users which didn't login after receiving their registration information */ |
60 | 60 | |
61 | 61 | if (DB_TYPE == "pgsql") { |
62 | - db_query( "DELETE FROM ttrss_users WHERE last_login IS NULL |
|
62 | + db_query("DELETE FROM ttrss_users WHERE last_login IS NULL |
|
63 | 63 | AND created < NOW() - INTERVAL '1 day' AND access_level = 0"); |
64 | 64 | } else { |
65 | - db_query( "DELETE FROM ttrss_users WHERE last_login IS NULL |
|
65 | + db_query("DELETE FROM ttrss_users WHERE last_login IS NULL |
|
66 | 66 | AND created < DATE_SUB(NOW(), INTERVAL 1 DAY) AND access_level = 0"); |
67 | 67 | } |
68 | 68 | |
@@ -73,9 +73,9 @@ discard block |
||
73 | 73 | if ($action == "check") { |
74 | 74 | header("Content-Type: application/xml"); |
75 | 75 | |
76 | - $login = trim(db_escape_string( $_REQUEST['login'])); |
|
76 | + $login = trim(db_escape_string($_REQUEST['login'])); |
|
77 | 77 | |
78 | - $result = db_query( "SELECT id FROM ttrss_users WHERE |
|
78 | + $result = db_query("SELECT id FROM ttrss_users WHERE |
|
79 | 79 | LOWER(login) = LOWER('$login')"); |
80 | 80 | |
81 | 81 | $is_registered = db_num_rows($result) > 0; |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | ?> |
198 | 198 | |
199 | 199 | <?php if (REG_MAX_USERS > 0) { |
200 | - $result = db_query( "SELECT COUNT(*) AS cu FROM ttrss_users"); |
|
200 | + $result = db_query("SELECT COUNT(*) AS cu FROM ttrss_users"); |
|
201 | 201 | $num_users = db_fetch_result($result, 0, "cu"); |
202 | 202 | } ?> |
203 | 203 | |
@@ -241,9 +241,9 @@ discard block |
||
241 | 241 | <?php } else if ($action == "do_register") { ?> |
242 | 242 | |
243 | 243 | <?php |
244 | - $login = mb_strtolower(trim(db_escape_string( $_REQUEST["login"]))); |
|
245 | - $email = trim(db_escape_string( $_REQUEST["email"])); |
|
246 | - $test = trim(db_escape_string( $_REQUEST["turing_test"])); |
|
244 | + $login = mb_strtolower(trim(db_escape_string($_REQUEST["login"]))); |
|
245 | + $email = trim(db_escape_string($_REQUEST["email"])); |
|
246 | + $test = trim(db_escape_string($_REQUEST["turing_test"])); |
|
247 | 247 | |
248 | 248 | if (!$login || !$email || !$test) { |
249 | 249 | print_error(__("Your registration information is incomplete.")); |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | |
256 | 256 | if ($test == "four" || $test == "4") { |
257 | 257 | |
258 | - $result = db_query( "SELECT id FROM ttrss_users WHERE |
|
258 | + $result = db_query("SELECT id FROM ttrss_users WHERE |
|
259 | 259 | login = '$login'"); |
260 | 260 | |
261 | 261 | $is_registered = db_num_rows($result) > 0; |
@@ -272,11 +272,11 @@ discard block |
||
272 | 272 | $salt = substr(bin2hex(get_random_bytes(125)), 0, 250); |
273 | 273 | $pwd_hash = encrypt_password($password, $salt, true); |
274 | 274 | |
275 | - db_query( "INSERT INTO ttrss_users |
|
275 | + db_query("INSERT INTO ttrss_users |
|
276 | 276 | (login,pwd_hash,access_level,last_login, email, created, salt) |
277 | 277 | VALUES ('$login', '$pwd_hash', 0, null, '$email', NOW(), '$salt')"); |
278 | 278 | |
279 | - $result = db_query( "SELECT id FROM ttrss_users WHERE |
|
279 | + $result = db_query("SELECT id FROM ttrss_users WHERE |
|
280 | 280 | login = '$login' AND pwd_hash = '$pwd_hash'"); |
281 | 281 | |
282 | 282 | if (db_num_rows($result) != 1) { |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | |
289 | 289 | $new_uid = db_fetch_result($result, 0, "id"); |
290 | 290 | |
291 | - initialize_user( $new_uid); |
|
291 | + initialize_user($new_uid); |
|
292 | 292 | |
293 | 293 | $reg_text = "Hi!\n". |
294 | 294 | "\n". |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | - set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR . |
|
2 | + set_include_path(dirname(__FILE__)."/include".PATH_SEPARATOR. |
|
3 | 3 | get_include_path()); |
4 | 4 | |
5 | 5 | $op = $_REQUEST["op"]; |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | "fbexport", "logout", "pubsub"); |
17 | 17 | |
18 | 18 | if (array_search($op, $public_calls) !== false) { |
19 | - header("Location: public.php?" . $_SERVER['QUERY_STRING']); |
|
19 | + header("Location: public.php?".$_SERVER['QUERY_STRING']); |
|
20 | 20 | return; |
21 | 21 | } |
22 | 22 | |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | } |
43 | 43 | |
44 | 44 | if (SINGLE_USER_MODE) { |
45 | - authenticate_user( "admin", null); |
|
45 | + authenticate_user("admin", null); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | if ($_SESSION["uid"]) { |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | print error_json(6); |
52 | 52 | return; |
53 | 53 | } |
54 | - load_user_plugins( $_SESSION["uid"]); |
|
54 | + load_user_plugins($_SESSION["uid"]); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | $purge_intervals = array( |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | - set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR . |
|
2 | + set_include_path(dirname(__FILE__)."/include".PATH_SEPARATOR. |
|
3 | 3 | get_include_path()); |
4 | 4 | |
5 | 5 | require_once "autoload.php"; |
@@ -33,6 +33,6 @@ |
||
33 | 33 | return Db::get()->last_query_error(); |
34 | 34 | } |
35 | 35 | |
36 | -function db_quote($str){ |
|
36 | +function db_quote($str) { |
|
37 | 37 | return Db::get()->quote($str); |
38 | 38 | } |
@@ -17,12 +17,12 @@ discard block |
||
17 | 17 | function make_self_url() { |
18 | 18 | $proto = is_server_https() ? 'https' : 'http'; |
19 | 19 | |
20 | - return $proto . '://' . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]; |
|
20 | + return $proto.'://'.$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]; |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | function make_self_url_path() { |
24 | 24 | $proto = is_server_https() ? 'https' : 'http'; |
25 | - $url_path = $proto . '://' . $_SERVER["HTTP_HOST"] . parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH); |
|
25 | + $url_path = $proto.'://'.$_SERVER["HTTP_HOST"].parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH); |
|
26 | 26 | |
27 | 27 | return $url_path; |
28 | 28 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | } |
70 | 70 | |
71 | 71 | if (version_compare(PHP_VERSION, '5.6.0', '<')) { |
72 | - array_push($errors, "PHP version 5.6.0 or newer required. You're using " . PHP_VERSION . "."); |
|
72 | + array_push($errors, "PHP version 5.6.0 or newer required. You're using ".PHP_VERSION."."); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | if (!class_exists("UConverter")) { |
@@ -80,15 +80,15 @@ discard block |
||
80 | 80 | array_push($errors, "Configuration file (config.php) has incorrect version. Update it with new options from config.php-dist and set CONFIG_VERSION to the correct value."); |
81 | 81 | } |
82 | 82 | |
83 | - if (!is_writable(CACHE_DIR . "/images")) { |
|
83 | + if (!is_writable(CACHE_DIR."/images")) { |
|
84 | 84 | array_push($errors, "Image cache is not writable (chmod -R 777 ".CACHE_DIR."/images)"); |
85 | 85 | } |
86 | 86 | |
87 | - if (!is_writable(CACHE_DIR . "/upload")) { |
|
87 | + if (!is_writable(CACHE_DIR."/upload")) { |
|
88 | 88 | array_push($errors, "Upload cache is not writable (chmod -R 777 ".CACHE_DIR."/upload)"); |
89 | 89 | } |
90 | 90 | |
91 | - if (!is_writable(CACHE_DIR . "/export")) { |
|
91 | + if (!is_writable(CACHE_DIR."/export")) { |
|
92 | 92 | array_push($errors, "Data export cache is not writable (chmod -R 777 ".CACHE_DIR."/export)"); |
93 | 93 | } |
94 | 94 | |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | |
125 | 125 | if (isset($_SERVER["HTTP_HOST"]) && |
126 | 126 | (!defined('_SKIP_SELF_URL_PATH_CHECKS') || !_SKIP_SELF_URL_PATH_CHECKS) && |
127 | - SELF_URL_PATH != $ref_self_url_path && SELF_URL_PATH != mb_substr($ref_self_url_path, 0, mb_strlen($ref_self_url_path)-1)) { |
|
127 | + SELF_URL_PATH != $ref_self_url_path && SELF_URL_PATH != mb_substr($ref_self_url_path, 0, mb_strlen($ref_self_url_path) - 1)) { |
|
128 | 128 | array_push($errors, |
129 | 129 | "Please set SELF_URL_PATH to the correct value detected for your server: <b>$ref_self_url_path</b>"); |
130 | 130 | } |
@@ -187,8 +187,8 @@ discard block |
||
187 | 187 | array_push($bad_tables_fmt, sprintf("%s (%s)", $bt['table_name'], $bt['engine'])); |
188 | 188 | } |
189 | 189 | |
190 | - $msg = "<p>The following tables use an unsupported MySQL engine: <b>" . |
|
191 | - implode(", ", $bad_tables_fmt) . "</b>.</p>"; |
|
190 | + $msg = "<p>The following tables use an unsupported MySQL engine: <b>". |
|
191 | + implode(", ", $bad_tables_fmt)."</b>.</p>"; |
|
192 | 192 | |
193 | 193 | $msg .= "<p>The only supported engine on MySQL is InnoDB. MyISAM lacks functionality to run |
194 | 194 | tt-rss. |
@@ -15,9 +15,9 @@ |
||
15 | 15 | // 3. plugin classes are loaded by PluginHandler from plugins.local/ and plugins/ (TODO: use generic autoloader?) |
16 | 16 | |
17 | 17 | if ($namespace && $class_name) { |
18 | - $class_file = "$root_dir/vendor/$namespace/" . str_replace('\\', '/', $class_name) . ".php"; |
|
18 | + $class_file = "$root_dir/vendor/$namespace/".str_replace('\\', '/', $class_name).".php"; |
|
19 | 19 | } else { |
20 | - $class_file = "$root_dir/classes/" . str_replace("_", "/", strtolower($class)) . ".php"; |
|
20 | + $class_file = "$root_dir/classes/".str_replace("_", "/", strtolower($class)).".php"; |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | if (file_exists($class_file)) |
@@ -1,3 +1,3 @@ |
||
1 | 1 | <?php # This file has been generated at: Thu Nov 22 22:14:43 MSK 2018 |
2 | 2 | define('GENERATED_CONFIG_CHECK', 26); |
3 | -$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', 'SPHINX_SERVER', 'SPHINX_INDEX', 'ENABLE_REGISTRATION', 'REG_NOTIFY_ADDRESS', 'REG_MAX_USERS', 'SESSION_COOKIE_LIFETIME', 'SMTP_FROM_NAME', 'SMTP_FROM_ADDRESS', 'DIGEST_SUBJECT', 'CHECK_FOR_UPDATES', 'ENABLE_GZIP_OUTPUT', 'PLUGINS', 'LOG_DESTINATION', 'CONFIG_VERSION'); ?> |
|
3 | +$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', 'SPHINX_SERVER', 'SPHINX_INDEX', 'ENABLE_REGISTRATION', 'REG_NOTIFY_ADDRESS', 'REG_MAX_USERS', 'SESSION_COOKIE_LIFETIME', 'SMTP_FROM_NAME', 'SMTP_FROM_ADDRESS', 'DIGEST_SUBJECT', 'CHECK_FOR_UPDATES', 'ENABLE_GZIP_OUTPUT', 'PLUGINS', 'LOG_DESTINATION', 'CONFIG_VERSION'); ?> |
@@ -13,12 +13,12 @@ discard block |
||
13 | 13 | if (!is_object($a)) { |
14 | 14 | array_push($fmt_args, $a); |
15 | 15 | } else { |
16 | - array_push($fmt_args, "[" . get_class($a) . "]"); |
|
16 | + array_push($fmt_args, "[".get_class($a)."]"); |
|
17 | 17 | } |
18 | 18 | } |
19 | 19 | } |
20 | 20 | |
21 | - $filename = str_replace(dirname(__DIR__) . "/", "", $e["file"]); |
|
21 | + $filename = str_replace(dirname(__DIR__)."/", "", $e["file"]); |
|
22 | 22 | |
23 | 23 | $rv .= sprintf("%d. %s(%s): %s(%s)\n", |
24 | 24 | $idx, $filename, $e["line"], $e["function"], implode(", ", $fmt_args)); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $errno = $error["type"]; |
53 | 53 | $file = $error["file"]; |
54 | 54 | $line = $error["line"]; |
55 | - $errstr = $error["message"]; |
|
55 | + $errstr = $error["message"]; |
|
56 | 56 | |
57 | 57 | if (!$errno) return false; |
58 | 58 |
@@ -3,7 +3,7 @@ |
||
3 | 3 | header("Location: install/"); |
4 | 4 | } |
5 | 5 | |
6 | - set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR . |
|
6 | + set_include_path(dirname(__FILE__)."/include".PATH_SEPARATOR. |
|
7 | 7 | get_include_path()); |
8 | 8 | |
9 | 9 | if (!file_exists("config.php")) { |