1
votes

I'm using Cake1.2 and have a CMS page which was working fine. Now it seems that someone has pasted in content from Word, which has obviously got lots of random ' and " characters in. The classic word ones.

Now my form will not display the content. I have pr()'d my $this->data and all the content is there, hell I can even echo it out.

I am displaying my form field thus,

echo $form->input('text', array('type'=>'textarea', 'between'=>'<br />'));

It works 8/10 times, but often the field will be blank. I'm assuming it's to do with the Word characters not being displayable, but to just not populate the whole field? Can I escape the characters in the input? I've been trauling the docs looking for a way to pass data in without extending the helper for a custom method.

I guess if all else fails I'll just write my own markup.

1
I've always hated dealing with Word for this reason. What happens if you copy the text from MSWord, paste it into a text editor, copy it in the text editor and paste it into your CMS? Does that at least get stuff to display (you'll probably have some wacky characters in there)?Rob Wilkerson
I've just created the markup in the end, got a bit sick of faffing ;)David Yell

1 Answers

0
votes

I just emulated the markup in the end.

<div class="input textarea required">
  <label for="UserReviewText">Text</label>
  <textarea id="UserReviewText" rows="10" cols="30" name="data[UserReview][text]"><?php echo htmlentities($this->data['UserReview']['text']); ?></textarea>
</div>