From 2ad181b6e1f3e8cdccc31fa2347df3ec7f6139dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=BCrth?= Date: Thu, 16 Oct 2014 19:10:52 +0200 Subject: [PATCH] Now the tableParameters array gets escaped through values(), too --- lib/Cake/Model/CakeSchema.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/Cake/Model/CakeSchema.php b/lib/Cake/Model/CakeSchema.php index cebc1937d..38f663cc5 100644 --- a/lib/Cake/Model/CakeSchema.php +++ b/lib/Cake/Model/CakeSchema.php @@ -397,8 +397,10 @@ class CakeSchema extends Object { } /** - * Generate the code for a table. Takes a table name and $fields array - * Returns a completed variable declaration to be used in schema classes. + * Generate the schema code for a table. + * + * Takes a table name and $fields array and returns a completed, + * escaped variable declaration to be used in schema classes. * * @param string $table Table name you want returned. * @param array $fields Array of field information to generate the table with. @@ -426,10 +428,7 @@ class CakeSchema extends Object { $col .= implode(",\n\t\t\t", $props) . "\n\t\t"; } elseif ($field === 'tableParameters') { $col = "\t\t'tableParameters' => array("; - $props = array(); - foreach ((array)$value as $key => $param) { - $props[] = "'{$key}' => '$param'"; - } + $props = $this->_values($value); $col .= implode(', ', $props); } $col .= ")";