Commit c7e83588dab798207cc32121bc62cc25404b0829

Authored by conradverm
1 parent c6f48fb5

KTS-1594

"Support for Office 2007 Documents"
Fixed.

Committed By: Conrad Vermeulen
Reviewed By: Megan Watson

git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@8158 c91229c3-7414-0410-bfa2-8a42b809f60b
search2/indexing/extractors/OpenXmlTextExtractor.inc.php
@@ -43,6 +43,7 @@ class OpenXmlTextExtractor extends ExternalDocumentExtractor @@ -43,6 +43,7 @@ class OpenXmlTextExtractor extends ExternalDocumentExtractor
43 $config = KTConfig::getSingleton(); 43 $config = KTConfig::getSingleton();
44 44
45 $this->unzip = KTUtil::findCommand("import/unzip", 'unzip'); 45 $this->unzip = KTUtil::findCommand("import/unzip", 'unzip');
  46 + $this->unzip = str_replace('\\','/',$this->unzip);
46 $this->unzip_params = $config->get('extractorParameters/unzip', '"{source}" "{part}" -d "{target_dir}"'); 47 $this->unzip_params = $config->get('extractorParameters/unzip', '"{source}" "{part}" -d "{target_dir}"');
47 parent::__construct(); 48 parent::__construct();
48 } 49 }
@@ -148,9 +149,14 @@ class OpenXmlTextExtractor extends ExternalDocumentExtractor @@ -148,9 +149,14 @@ class OpenXmlTextExtractor extends ExternalDocumentExtractor
148 $time = 'openxml_'. time() . '-' . $docid; 149 $time = 'openxml_'. time() . '-' . $docid;
149 $this->openxml_dir = $temp_dir . '/' . $time; 150 $this->openxml_dir = $temp_dir . '/' . $time;
150 151
151 - $cmd = $this->unzip . ' ' . str_replace( 152 + $this->sourcefile = str_replace('\\','/',$this->sourcefile);
  153 + $this->openxml_dir = str_replace('\\','/',$this->openxml_dir);
  154 +
  155 + $cmd = '"' . $this->unzip . '"' . ' ' . str_replace(
152 array('{source}','{part}', '{target_dir}'), 156 array('{source}','{part}', '{target_dir}'),
153 - array($this->sourcefile, '\[Content_Types\].xml',$this->openxml_dir), $this->unzip_params); 157 + array($this->sourcefile, '*Content_Types*.xml',$this->openxml_dir), $this->unzip_params);
  158 +
  159 + $cmd = str_replace('\\','/', $cmd);
154 160
155 if (!$this->exec($cmd)) 161 if (!$this->exec($cmd))
156 { 162 {