Skip to content

Commit

Permalink
Replace apostrophe with html entity. See noumo#103
Browse files Browse the repository at this point in the history
  • Loading branch information
boehsermoe committed Dec 22, 2015
1 parent 64a71a4 commit 8e2bda5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/catalog/controllers/AController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function actionFields($id)
foreach($fields as $field){
$temp = json_decode($field);

if( $temp === null && json_last_error() !== JSON_ERROR_NONE ||
if($temp === null && json_last_error() !== JSON_ERROR_NONE ||
empty($temp->name) ||
empty($temp->title) ||
empty($temp->type) ||
Expand Down
3 changes: 2 additions & 1 deletion modules/catalog/media/js/fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ $(function(){
options : $this.find('.field-options').val()
};
if(data.name != '') {
form += '<input type="hidden" name="Field[' + i + ']" value=\'' + JSON.stringify(data) + '\'>';
var json = JSON.stringify(data).replace("'", "&apos;"); // See issue #103
form += '<input type="hidden" name="Field[' + i + ']" value=\'' + json + '\'>';
}
});
$('<form method="post">' + form + '</form>').appendTo('body').submit();
Expand Down

0 comments on commit 8e2bda5

Please sign in to comment.