diff options
| author | 2016-11-06 14:06:02 +0100 | |
|---|---|---|
| committer | 2016-11-06 14:06:02 +0100 | |
| commit | 6a7b5fea3ec301214527f4d8c888cca11d9125e5 (patch) | |
| tree | 00d7d71d6015e78b036746e65d62eb5fc8755b0f /lib | |
| parent | 60941b9a40731be6f06d9422744cbba27982b6f3 (diff) | |
| parent | 1a4fdfb1be7b638f5bfd1011e0f81f5814591474 (diff) | |
Merge branch 'FreshRSS/dev' into git-update
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/lib_install.php | 6 | ||||
| -rw-r--r-- | lib/lib_rss.php | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/lib_install.php b/lib/lib_install.php index 0e7b7f036..dd8090bcd 100644 --- a/lib/lib_install.php +++ b/lib/lib_install.php @@ -54,8 +54,8 @@ function generateSalt() { function checkDb(&$dbOptions) { $dsn = ''; + $driver_options = null; try { - $driver_options = null; switch ($dbOptions['type']) { case 'mysql': include_once(APP_PATH . '/SQL/install.sql.mysql.php'); @@ -99,8 +99,12 @@ function checkDb(&$dbOptions) { default: return false; } + + $c = new PDO($dsn, $dbOptions['user'], $dbOptions['password'], $driver_options); + $res = $c->query('SELECT 1'); } catch (PDOException $e) { $dsn = ''; + syslog(LOG_DEBUG, 'FreshRSS SQL warning: ' . $e->getMessage()); $dbOptions['error'] = $e->getMessage(); } $dbOptions['dsn'] = $dsn; diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 143b55bee..fc68a96d3 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -127,6 +127,8 @@ function format_bytes($bytes, $precision = 2, $system = 'IEC') { } elseif ($system === 'SI') { $base = 1000; $units = array('B', 'KB', 'MB', 'GB', 'TB'); + } else { + return format_number($bytes, $precision); } $bytes = max(intval($bytes), 0); $pow = $bytes === 0 ? 0 : floor(log($bytes) / log($base)); |
