Skip to content

Commit f41c542

Browse files
Trainmastertroosan
authored andcommitted
Enforce valid value for on/off type
1 parent 6a64979 commit f41c542

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/PhpWord/Writer/Word2007/Part/Settings.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,8 @@ private function setOnOffValue($settingName, $booleanValue)
174174
return;
175175
}
176176

177-
if ($booleanValue) {
178-
$this->settings[$settingName] = array('@attributes' => array());
179-
} else {
180-
$this->settings[$settingName] = array('@attributes' => array('w:val' => 'false'));
181-
}
177+
$value = $booleanValue ? 'true' : 'false';
178+
$this->settings[$settingName] = array('@attributes' => array('w:val' => $value));
182179
}
183180

184181
/**

0 commit comments

Comments
 (0)