Skip to content
Snippets Groups Projects
Commit a7273786 authored by Demian Katz's avatar Demian Katz
Browse files

Streamlined and documented entity cleanup within stored MARC records.

parent 3f985775
Branches
Tags
No related merge requests found
...@@ -73,8 +73,11 @@ class SolrMarc extends SolrDefault ...@@ -73,8 +73,11 @@ class SolrMarc extends SolrDefault
if (strcasecmp(substr($marc, 0, strlen($xmlHead)), $xmlHead) === 0) { if (strcasecmp(substr($marc, 0, strlen($xmlHead)), $xmlHead) === 0) {
$marc = new \File_MARCXML($marc, \File_MARCXML::SOURCE_STRING); $marc = new \File_MARCXML($marc, \File_MARCXML::SOURCE_STRING);
} else { } else {
$marc = preg_replace('/#31;/', "\x1F", $marc); // When indexing over HTTP, SolrMarc may use entities instead of certain
$marc = preg_replace('/#30;/', "\x1E", $marc); // control characters; we should normalize these:
$marc = str_replace(
array('#29;', '#30;', '#31;'), array("\x1D", "\x1E", "\x1F"), $marc
);
$marc = new \File_MARC($marc, \File_MARC::SOURCE_STRING); $marc = new \File_MARC($marc, \File_MARC::SOURCE_STRING);
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment