Commit b524f641e5bb413cbc0742232c4efe5beac8b872

Authored by bshuttle
1 parent ac6deda7

handle the fact that escapeShellArg on windows can't handle certain filenames.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@5307 c91229c3-7414-0410-bfa2-8a42b809f60b
plugins/ktstandard/contents/BaseIndexer.php
@@ -88,10 +88,17 @@ class KTBaseIndexerTrigger { @@ -88,10 +88,17 @@ class KTBaseIndexerTrigger {
88 $tempstub = $this->command; 88 $tempstub = $this->command;
89 } 89 }
90 $myfilename = tempnam("/tmp", 'kt.' . $tempstub); 90 $myfilename = tempnam("/tmp", 'kt.' . $tempstub);
91 - $contents = $this->extract_contents($sFile, $myfilename); 91 + $intermediate = tempnam("/tmp", 'kt.' . $tempstub);
  92 + if (OS_WINDOWS && !@copy($sFile, $intermediate)) {
  93 + return ;
  94 + } else {
  95 + $intermediate = $sFile;
  96 + }
92 97
93 - unlink($myfilename); 98 + $contents = $this->extract_contents($intermediate, $myfilename);
94 99
  100 + unlink($myfilename);
  101 + if (OS_WINDOWS) { unlink($intermediate); }
95 if (empty($contents)) { 102 if (empty($contents)) {
96 return; 103 return;
97 } 104 }