Skip to content

Commit 7407723

Browse files
author
Sergei Lomakov
committed
pFilename is required parameter for save
1 parent 00981c1 commit 7407723

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

Classes/PHPPowerPoint/Writer/ODPresentation.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,11 @@ public function __construct(PHPPowerPoint $pPHPPowerPoint = null)
102102
* @param string $pFilename
103103
* @throws Exception
104104
*/
105-
public function save($pFilename = null)
105+
public function save($pFilename)
106106
{
107+
if (empty($pFilename)) {
108+
throw new Exception("Filename is empty");
109+
}
107110
if (!is_null($this->_presentation)) {
108111
// If $pFilename is php://output or php://stdout, make it a temporary file...
109112
$originalFilename = $pFilename;

Classes/PHPPowerPoint/Writer/PowerPoint2007.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,11 @@ public function getWriterPart($pPartName = '')
139139
* @param string $pFilename
140140
* @throws Exception
141141
*/
142-
public function save($pFilename = null)
142+
public function save($pFilename)
143143
{
144+
if (empty($pFilename)) {
145+
throw new Exception("Filename is empty");
146+
}
144147
if (!is_null($this->_presentation)) {
145148
// If $pFilename is php://output or php://stdout, make it a temporary file...
146149
$originalFilename = $pFilename;

Classes/PHPPowerPoint/Writer/Serialized.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,11 @@ public function __construct(PHPPowerPoint $pPHPPowerPoint = null)
5858
* @param string $pFilename
5959
* @throws Exception
6060
*/
61-
public function save($pFilename = null)
61+
public function save($pFilename)
6262
{
63+
if (empty($pFilename)) {
64+
throw new Exception("Filename is empty");
65+
}
6366
if (!is_null($this->_presentation)) {
6467
// Create new ZIP file and open it for writing
6568
$objZip = new ZipArchive();

0 commit comments

Comments
 (0)