From d8ab9fad2e88341c8c6cc7c2913ea74625fbe9d2 Mon Sep 17 00:00:00 2001 From: Liam McLoughlin Date: Fri, 15 Jul 2011 20:58:22 +0100 Subject: Handle \r\n when building the configuration file --- web/process.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/web/process.php b/web/process.php index 149c1b7..1b68d03 100644 --- a/web/process.php +++ b/web/process.php @@ -11,10 +11,10 @@ $root_password = escapeshellarg($_POST["rootpassword"]); $packages_list = escapeshellarg($_POST["packages"]); $output_format = escapeshellarg($_POST["format"]); - - + + $packages_list = str_replace("\r\n", " ", $packages_list); $packages_list = str_replace("\n", " ", $packages_list); - + $ini_string = "[vmconfig] BUILD_ID='$build_id' @@ -36,11 +36,11 @@ OUTPUT_FORMAT=$output_format"; $client = new GearmanClient(); $client->addServer(); $handle = $client->doBackground("invoke_image_build", $ini_string); - + $db = mysql_connect("localhost","gentoaster",""); if(!$db) die("Could not connect to database ".mysql_error()); mysql_select_db("gentoaster"); mysql_query("INSERT INTO builds (id, handle) VALUES('".$build_id."','".$handle."')"); header("Location: finished.php?uuid=".$build_id); -?> \ No newline at end of file +?> -- cgit v1.2.3-65-gdbad