Skip to content

Commit

Permalink
Switch to use Strings instead of JSON when saving tools. Fixes saving…
Browse files Browse the repository at this point in the history
… when quotes are used. Fixes: #284
  • Loading branch information
wdamien committed Oct 4, 2018
1 parent 17473d2 commit 7949385
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions server/actions/patterns/save.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ function savePattern($userProfile) {

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

if (!is_null($tool)) {
$tool = json_encode($tool);
}

// Check to see if the user wants to edit this pattern.
if (!empty($id)) { // Update
// Make sure the user has access to edit this pattern.
Expand Down Expand Up @@ -129,7 +125,7 @@ public function getSchema() {
"text" => array("type"=>self::STRING, "required"=>false),
"description" => array("type"=>self::STRING, "required"=>false, "length"=>250),
"token" => array("type"=>self::STRING, "required"=>false),
"tool" => array("type"=>self::JSON, "required"=>false, "length"=>1024),
"tool" => array("type"=>self::STRING, "required"=>false, "length"=>1024),
"flavor" => array("type"=>self::ENUM, "values"=>$this->getTypeValues(), "required"=>false),
"parentId" => array("type"=>self::STRING, "required"=>false),
"access" => array("type"=>self::ENUM, "values"=>$this->getVisibilityValues(), "required"=>false)
Expand Down

0 comments on commit 7949385

Please sign in to comment.