Skip to content

Commit

Permalink
changed str_replace to preg_replace
Browse files Browse the repository at this point in the history
  • Loading branch information
sheepeeh committed Mar 20, 2014
1 parent 8aa5508 commit e433ca6
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -253,9 +253,10 @@ protected function _buildElementSetContainerForRecord(Omeka_Record_AbstractRecor
$elementTextContainerElement = $this->_createElement('elementTextContainer');
foreach ($element['elementTexts'] as $elementTextId => $elementText) {
// elementText
$elementText['text'] = str_replace("\f","",$elementText['text']);
$elementTextElement = $this->_createElement('elementText', null, $elementTextId);
$textElement = $this->_createElement('text', $elementText['text'], null, $elementTextElement);
// Replace invalid control characters
$text = preg_replace('#[\x00-\x08\x0B\x0C\x0E-\x1F]#', "\xef\xbf\xbd", $elementText['text']);
$textElement = $this->_createElement('text', $text, null, $elementTextElement);
$elementTextContainerElement->appendChild($elementTextElement);
}
$elementElement->appendChild($elementTextContainerElement);
Expand Down

0 comments on commit e433ca6

Please sign in to comment.