Skip to content

Commit

Permalink
Critical Bug Fix: Replace '\\' with DIRECTORY_SEPARATOR
Browse files Browse the repository at this point in the history
  • Loading branch information
ncjoes committed Nov 25, 2016
1 parent 3338f7f commit 69176e5
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/OfficeConverter/OfficeConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class OfficeConverter
* @param null $tempPath
* @param string $bin
*/
public function __construct($filename, $tempPath = null, $bin = 'soffice')
public function __construct($filename, $tempPath = null, $bin = 'libreoffice')
{
if ($this->open($filename)) {
$this->setup($tempPath, $bin);
Expand Down Expand Up @@ -125,12 +125,13 @@ protected function makeCommand($outputDirectory, $outputExtension)
*/
protected function prepOutput($outdir, $filename, $outputExtension)
{
$DS = DIRECTORY_SEPARATOR;
$tmpName = str_replace($this->extension, '', $this->basename).$outputExtension;
if (rename($outdir.'\\'.$tmpName, $outdir.'\\'.$filename)) {
return $outdir.'\\'.$filename;
if (rename($outdir.$DS.$tmpName, $outdir.$DS.$filename)) {
return $outdir.$DS.$filename;
}
elseif (is_file($outdir.'\\'.$tmpName)) {
return $outdir.'\\'.$tmpName;
elseif (is_file($outdir.$DS.$tmpName)) {
return $outdir.$DS.$tmpName;
}

return null;
Expand Down

0 comments on commit 69176e5

Please sign in to comment.