$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()));
$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))) {