diff --git a/cake/console/libs/console.php b/cake/console/libs/console.php index 9d7f9aa4930..19b075092fb 100644 --- a/cake/console/libs/console.php +++ b/cake/console/libs/console.php @@ -252,8 +252,7 @@ function main($command = null) { if ($this->__isValidModel($modelToSave)) { // Extract the array of data we are trying to build list($foo, $data) = explode("->save", $command); - $badChars = array("(", ")"); - $data = str_replace($badChars, "", $data); + $data = preg_replace('/^\(*(array)?\(*(.+?)\)*$/i', '\\2', $data); $saveCommand = "\$this->{$modelToSave}->save(array('{$modelToSave}' => array({$data})));"; @eval($saveCommand); $this->out('Saved record for ' . $modelToSave); @@ -336,4 +335,4 @@ function __loadRoutes() { return true; } } -?> \ No newline at end of file +?>