Commit c99a7d79fab03be0074dfd654ff0590598e524fd

Authored by kevin_fourie
1 parent a2d120a3

Merged in from STABLE trunk...

KTS-3427
"Indexing a large XML document (97 meg) resulted in the indexer throwing an error relating to heap not being big enough"
Updated. Optimised the read of content so text extractor does not crash indexer.

Committed By: Conrad Vermeulen
Reviewed By: Megan Watson


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/branches/3.5.3-Release-Branch@9020 c91229c3-7414-0410-bfa2-8a42b809f60b
search2/indexing/extractorCore.inc.php
@@ -686,7 +686,7 @@ abstract class TextExtractor extends DocumentExtractor @@ -686,7 +686,7 @@ abstract class TextExtractor extends DocumentExtractor
686 686
687 $config = KTConfig::getSingleton(); 687 $config = KTConfig::getSingleton();
688 $maxTextSize = $config->get('indexer/maxTextSize', 1024 * 1024 * 10); // we'll only take 10 meg by default 688 $maxTextSize = $config->get('indexer/maxTextSize', 1024 * 1024 * 10); // we'll only take 10 meg by default
689 - $content = substr(file_get_contents($this->sourcefile), 0, $maxTextSize); 689 + $content = file_get_contents($this->sourcefile, null, null, null, $maxTextSize);
690 if (false === $content) 690 if (false === $content)
691 { 691 {
692 return false; 692 return false;