From c7e83588dab798207cc32121bc62cc25404b0829 Mon Sep 17 00:00:00 2001 From: conradverm Date: Tue, 26 Feb 2008 14:57:05 +0000 Subject: [PATCH] KTS-1594 "Support for Office 2007 Documents" Fixed. --- search2/indexing/extractors/OpenXmlTextExtractor.inc.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/search2/indexing/extractors/OpenXmlTextExtractor.inc.php b/search2/indexing/extractors/OpenXmlTextExtractor.inc.php index b1baf72..abba3d7 100644 --- a/search2/indexing/extractors/OpenXmlTextExtractor.inc.php +++ b/search2/indexing/extractors/OpenXmlTextExtractor.inc.php @@ -43,6 +43,7 @@ class OpenXmlTextExtractor extends ExternalDocumentExtractor $config = KTConfig::getSingleton(); $this->unzip = KTUtil::findCommand("import/unzip", 'unzip'); + $this->unzip = str_replace('\\','/',$this->unzip); $this->unzip_params = $config->get('extractorParameters/unzip', '"{source}" "{part}" -d "{target_dir}"'); parent::__construct(); } @@ -148,9 +149,14 @@ class OpenXmlTextExtractor extends ExternalDocumentExtractor $time = 'openxml_'. time() . '-' . $docid; $this->openxml_dir = $temp_dir . '/' . $time; - $cmd = $this->unzip . ' ' . str_replace( + $this->sourcefile = str_replace('\\','/',$this->sourcefile); + $this->openxml_dir = str_replace('\\','/',$this->openxml_dir); + + $cmd = '"' . $this->unzip . '"' . ' ' . str_replace( array('{source}','{part}', '{target_dir}'), - array($this->sourcefile, '\[Content_Types\].xml',$this->openxml_dir), $this->unzip_params); + array($this->sourcefile, '*Content_Types*.xml',$this->openxml_dir), $this->unzip_params); + + $cmd = str_replace('\\','/', $cmd); if (!$this->exec($cmd)) { -- libgit2 0.21.4