Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Data Model Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

$dataobject->Content cutting off with special chars?


Go to End


1097 Views

Avatar
nekranox

Community Member, 31 Posts

23 November 2012 at 2:37am

Hey guys,

I'm looping through a flat data file and pushing the content into new data objects like so:

$Property = new DetailPropertyPage();
$Property->Content = htmlspecialchars($dataFileRow[25]);
$Property->writeToStage('Stage'); 
$Property->publish('Stage', 'Live');

The content is consistently cutting off at the same point. When I inspect the data in the flat file, it's cutting off as soon as it hits an un-encoded pound (£) symbol. So I added htmlspecialchars(); as demonstrated above but this hasn't solved the problem. Does anyone know what's going wrong here?

Thanks,

Robbie