From 1b3df8b05e3763b1554bd965ed787d4fd8ff6e99 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Wed, 12 Nov 2008 11:48:51 -0700 Subject: [PATCH] Use file_get_contents(). --- framework/Mime/lib/Horde/Mime/Viewer/enscript.php | 4 +--- framework/Mime/lib/Horde/Mime/Viewer/msexcel.php | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/framework/Mime/lib/Horde/Mime/Viewer/enscript.php b/framework/Mime/lib/Horde/Mime/Viewer/enscript.php index c2c060c6c..c63132d60 100644 --- a/framework/Mime/lib/Horde/Mime/Viewer/enscript.php +++ b/framework/Mime/lib/Horde/Mime/Viewer/enscript.php @@ -75,9 +75,7 @@ class Horde_Mime_Viewer_enscript extends Horde_Mime_Viewer_source $tmpin = Horde::getTempFile('enscriptin'); /* Write the contents of our buffer to the temporary input file. */ - $fh = fopen($tmpin, 'wb'); - fwrite($fh, $this->_mimepart->getContents()); - fclose($fh); + file_put_contents($tmpin, $this->_mimepart->getContents()); /* Execute the enscript command. */ $lang = escapeshellarg($this->_typeToLang($this->_mimepart->getType())); diff --git a/framework/Mime/lib/Horde/Mime/Viewer/msexcel.php b/framework/Mime/lib/Horde/Mime/Viewer/msexcel.php index ad1f29fa5..654bb5220 100644 --- a/framework/Mime/lib/Horde/Mime/Viewer/msexcel.php +++ b/framework/Mime/lib/Horde/Mime/Viewer/msexcel.php @@ -41,9 +41,7 @@ class Horde_Mime_Viewer_msexcel extends Horde_Mime_Viewer_Driver $data = ''; $tmp_xls = Horde::getTempFile('horde_msexcel'); - $fh = fopen($tmp_xls, 'w'); - fwrite($fh, $this->_mimepart->getContents()); - fclose($fh); + file_put_contents($tmp_xls, $this->_mimepart->getContents()); $fh = popen($this->_conf['location'] . " -nh $tmp_xls 2>&1", 'r'); while (($rc = fgets($fh, 8192))) { -- 2.11.0