From 9d869ea397ffc0dd44cfdfe17ebaf7b1dba6cd14 Mon Sep 17 00:00:00 2001 From: Eirik Oeverby Date: Sun, 15 Aug 2010 09:13:43 +0200 Subject: [PATCH] Fixed pattern matching for relayctl output (fixes vservers with spaces in name) --- usr/local/www/status_lb_vs.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr/local/www/status_lb_vs.php b/usr/local/www/status_lb_vs.php index 220b2c139e..cec75cef65 100755 --- a/usr/local/www/status_lb_vs.php +++ b/usr/local/www/status_lb_vs.php @@ -94,9 +94,9 @@ function parse_redirects($rdr_a) { $line = $rdr_a[$i]; if (preg_match("/^[0-9]+/", $line)) { $regs = array(); - if($x = preg_match("/^[0-9]+\s+redirect\s+([0-9a-zA-Z]+)\s+([a-z]+)/", $line, $regs)) { - $vs[$regs[1]] = array(); - $vs[$regs[1]]['status'] = $regs[2]; + if($x = preg_match("/^[0-9]+\s+redirect\s+([0-9a-zA-Z\s]+)\s+([a-z]+)/", $line, $regs)) { + $vs[trim($regs[1])] = array(); + $vs[trim($regs[1])]['status'] = trim($regs[2]); } } }