Skip to content

Commit

Permalink
Merge pull request #53 from godbone/godbone-patch-2
Browse files Browse the repository at this point in the history
dustpress-js arguement fix
  • Loading branch information
villesiltala committed Nov 10, 2017
2 parents 842d514 + f2d37c9 commit 6bf7482
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Changed
- Fixed not properly recognizing tidy & render arguements on older dustpress-js calls

## [1.7.0] - 2017-11-03
### Added
- Model and partial containing the basic functionality of the default wp-activate.php file.
Expand Down
4 changes: 4 additions & 0 deletions dustpress.php
Expand Up @@ -979,6 +979,10 @@ public function create_ajax_instance() {
}
elseif ( isset( $_POST['dustpress_data'] ) ) {
$request_data = (object) $_POST['dustpress_data'];

// Parse old data to correct format and assume it to be false if it isn't defined
$request_data->tidy = ( isset( $request_data->tidy ) && $request_data->tidy === 'true' ) ? true : false;
$request_data->render = ( isset( $request_data->render ) && $request_data->render === 'true' ) ? true : false;
}
else {
die( json_encode( [ "error" => "Something went wrong. There was no dustpress_data present at the request." ] ) );
Expand Down

0 comments on commit 6bf7482

Please sign in to comment.