Skip to content

Commit

Permalink
implict properties creation is deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
nightflyza committed Jan 19, 2023
1 parent 865cf81 commit 129ca61
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion RELEASE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.4 rev 8780
1.3.4 rev 8781
21 changes: 14 additions & 7 deletions userstats/modules/engine/api.docx.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class DOCXTemplate {
private $data;
private $package;
private $error;
private $debug;
private $datasec = array();

public function __construct($template_filename, $is_data = false, $debug = false) {
$this->data = array();
Expand Down Expand Up @@ -404,9 +406,11 @@ private function _zip($fh) {
}

function saveAs($filename) {
if ( !$this->_parse() ) return false;
if (!$this->_parse())
return false;
$fh = fopen($filename, 'wb');
if ( !$fh ) return false;
if (!$fh)
return false;
if (!$this->_zip($fh)) {
fclose($fh);
return false;
Expand All @@ -415,12 +419,14 @@ function saveAs($filename) {
return true;
}

function downloadAs( $filename, $exit = true ) {
if ( !$this->_parse() ) return false;
function downloadAs($filename, $exit = true) {
if (!$this->_parse())
return false;
//php://stdin
$fh = tmpfile();
if ( !$fh ) return false;
if ( !$this->_zip($fh) ) {
if (!$fh)
return false;
if (!$this->_zip($fh)) {
fclose($fh);
return false;
}
Expand All @@ -433,7 +439,8 @@ function downloadAs( $filename, $exit = true ) {
fseek($fh, 0);
echo fread($fh, $size);
fclose($fh);
if ( $exit ) exit();
if ($exit)
exit();
return true;
}

Expand Down

0 comments on commit 129ca61

Please sign in to comment.