Commit 4b85344a2c2a8af413fc009730b5b2d52a05380e

Authored by kevin_fourie
1 parent 96c50621

Merged in from DEV trunk...

KTS-2859
"Unable to upload files in Windows XP and Windows 2003 - seemingly an MS Word issue only."
Fixed. Add "call " in front of the command passed to exec().

Committed by: Megan Watson
Reviewed By: Conrad Vermeulen

git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/branches/3.4.6-Release-Branch@7932 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/util/ktutil.inc
@@ -206,11 +206,9 @@ class KTUtil { @@ -206,11 +206,9 @@ class KTUtil {
206 $aOutput = array(); 206 $aOutput = array();
207 $iRet = ''; 207 $iRet = '';
208 208
209 - if (OS_WINDOWS){  
210 - $wait = false;  
211 - if(isset($aOptions['exec_wait']) && ($aOptions['exec_wait'] == 'true')){  
212 - $wait = true;  
213 - } 209 + if(OS_WINDOWS){
  210 + $sCmd = 'call '.$sCmd;
  211 + }
214 212
215 $WshShell = new COM("WScript.Shell"); 213 $WshShell = new COM("WScript.Shell");
216 $res = $WshShell->Run($sCmd, 0, $wait); 214 $res = $WshShell->Run($sCmd, 0, $wait);
plugins/ktstandard/contents/BaseIndexer.php
@@ -148,11 +148,8 @@ class KTBaseIndexerTrigger { @@ -148,11 +148,8 @@ class KTBaseIndexerTrigger {
148 $cmdline[] = $sTempFilename; 148 $cmdline[] = $sTempFilename;
149 } 149 }
150 150
151 - if(OS_WINDOWS){  
152 - $aRet = KTUtil::winexec($cmdline, $aOptions);  
153 - }else{  
154 - $aRet = KTUtil::pexec($cmdline, $aOptions);  
155 - } 151 + $aRet = KTUtil::pexec($cmdline, $aOptions);
  152 +
156 $this->aCommandOutput = $aRet['out']; 153 $this->aCommandOutput = $aRet['out'];
157 $contents = file_get_contents($sTempFilename); 154 $contents = file_get_contents($sTempFilename);
158 155
plugins/ktstandard/contents/WordIndexer.php
@@ -56,25 +56,6 @@ class KTWordIndexerTrigger extends KTBaseIndexerTrigger { @@ -56,25 +56,6 @@ class KTWordIndexerTrigger extends KTBaseIndexerTrigger {
56 if (OS_WINDOWS) { 56 if (OS_WINDOWS) {
57 $sDir = dirname(dirname($sCommand)); 57 $sDir = dirname(dirname($sCommand));
58 putenv('HOME=' . $sDir); 58 putenv('HOME=' . $sDir);
59 -  
60 - /*  
61 - $cmdline = array($sCommand);  
62 - $cmdline = kt_array_merge($cmdline, $this->args);  
63 - $cmdline[] = $sFilename;  
64 -  
65 - $sCmd = KTUtil::safeShellString($cmdline);  
66 - $sCmd .= " >> " . escapeshellarg($sTempFilename);  
67 -  
68 - $sCmd = str_replace( '/','\\',$sCmd);  
69 -  
70 - $sCmd = "start /b \"kt\" " . $sCmd;  
71 -  
72 - pclose(popen($sCmd, 'r'));  
73 -  
74 - $this->aCommandOutput = 1;  
75 - $contents = file_get_contents($sTempFilename);  
76 - return $contents;  
77 - */  
78 } 59 }
79 return parent::extract_contents($sFilename, $sTempFilename); 60 return parent::extract_contents($sFilename, $sTempFilename);
80 } 61 }