Skip to content

Commit 7949385

Browse files
committed
Switch to use Strings instead of JSON when saving tools. Fixes saving when quotes are used. Fixes: gskinner#284
1 parent 17473d2 commit 7949385

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

server/actions/patterns/save.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ function savePattern($userProfile) {
4949

5050
$author = empty($savedAuthor)?$userProfile->username:$savedAuthor;
5151

52-
if (!is_null($tool)) {
53-
$tool = json_encode($tool);
54-
}
55-
5652
// Check to see if the user wants to edit this pattern.
5753
if (!empty($id)) { // Update
5854
// Make sure the user has access to edit this pattern.
@@ -129,7 +125,7 @@ public function getSchema() {
129125
"text" => array("type"=>self::STRING, "required"=>false),
130126
"description" => array("type"=>self::STRING, "required"=>false, "length"=>250),
131127
"token" => array("type"=>self::STRING, "required"=>false),
132-
"tool" => array("type"=>self::JSON, "required"=>false, "length"=>1024),
128+
"tool" => array("type"=>self::STRING, "required"=>false, "length"=>1024),
133129
"flavor" => array("type"=>self::ENUM, "values"=>$this->getTypeValues(), "required"=>false),
134130
"parentId" => array("type"=>self::STRING, "required"=>false),
135131
"access" => array("type"=>self::ENUM, "values"=>$this->getVisibilityValues(), "required"=>false)

0 commit comments

Comments
 (0)