From 6cfa8426eaa46bd2fb4c5a7c499dd8ca4e18b213 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 --- db-backends.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/db-backends.php b/db-backends.php index d7eafc9..3988f16 100644 --- a/db-backends.php +++ b/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