Skip to content

Commit 7bacbbf

Browse files
author
Rias
committed
Fix encoding error
1 parent d01e8cc commit 7bacbbf

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
## 1.0.9 - 2018-08-03
8+
### Fixed
9+
- Fixed a bug with encoding caused by the previous update
10+
711
## 1.0.8 - 2018-07-31
812
### Fixed
913
- UTF8 encoding issues should now be fixed for new submissions

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "rias/craft-contact-form-extensions",
33
"description": "Adds extensions to the Craft CMS contact form plugin.",
44
"type": "craft-plugin",
5-
"version": "1.0.8",
5+
"version": "1.0.9",
66
"keywords": [
77
"craft",
88
"cms",

src/services/ContactFormExtensionsService.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ public function saveSubmission(Submission $submission)
6060
$contactFormSubmission->fromName = $submission->fromName;
6161
$contactFormSubmission->fromEmail = $submission->fromEmail;
6262
$contactFormSubmission->subject = $submission->subject;
63+
64+
if (!is_array($submission->message)) {
65+
$submission->message = ['message' => $submission->message];
66+
}
67+
6368
$message = array_map('utf8_encode', $submission->message);
6469
$contactFormSubmission->message = json_encode($message);
6570

0 commit comments

Comments
 (0)