Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

BUGFIX #6304 PageCommentInterface::PostCommentForm() loads inappropri…

…ate data from cookie, including wrong values for ParentID

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@115399 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
commit 3b6a9579d44effc8c1fbe94ad5ab94bf27c33090 1 parent 25de630
@halkyon halkyon authored sminnee committed
Showing with 7 additions and 2 deletions.
  1. +7 −2 code/sitefeatures/PageCommentInterface.php
View
9 code/sitefeatures/PageCommentInterface.php
@@ -216,8 +216,13 @@ function PostCommentForm() {
$this->extend('updatePageCommentForm', $form);
// Load the users data from a cookie
- if($cookie = Cookie::get("PageCommentInterface_Data")) {
- $form->loadDataFrom(unserialize($cookie));
+ $cookie = Cookie::get('PageCommentInterface_Data');
+ if($cookie) {
+ $visibleFields = array();
+ foreach($fields as $field) {
+ if(!$field instanceof HiddenField) $visibleFields[] = $field->Name();
+ }
+ $form->loadDataFrom(unserialize($cookie), false, $visibleFields);
}
return $form;
Please sign in to comment.
Something went wrong with that request. Please try again.