From 59e7ff552c199af333c46f74c9f48248d7ceb07d Mon Sep 17 00:00:00 2001 From: shammash <shammash@autistici.org> Date: Mon, 19 Sep 2011 10:43:39 +0200 Subject: [PATCH] fix backends configuration parsing --- r2db/db-backends.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/r2db/db-backends.php b/r2db/db-backends.php index d7eafc977..3988f164c 100644 --- a/r2db/db-backends.php +++ b/r2db/db-backends.php @@ -10,10 +10,11 @@ function noblogs_load_backends($db_config_file, $hashptr) { die("Database backends not configured!"); } while (($line = fgets($fp, 1024)) !== false) { - if ($line[0] == '#') { + $wline = rtrim($line); + if ($wline == "" || $wline[0] == '#') { continue; } - $line_parts = explode(" ", rtrim($line)); + $line_parts = explode(" ", $wline); $server_id = $line_parts[0]; $dataset = "backend_" . $server_id; $backend_url = $line_parts[2]; -- GitLab