Skip to content

Commit b4c4bf8

Browse files
hasziGirgias
authored andcommitted
Explicitly cast values to the expected types
1 parent 85aecca commit b4c4bf8

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

phpdotnet/phd/Package/Generic/XHTML.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ public function format_literal($open, $name, $attrs)
757757
public function format_literal_text($value, $tag) {
758758
switch ($this->getRole()) {
759759
case 'infdec':
760-
$value = (float)$value;
760+
$value = (string) (float)$value;
761761
$p = strpos($value, '.');
762762
$str = substr($value, 0, $p + 1);
763763
$str .= '<span style="text-decoration: overline;">';

phpdotnet/phd/Package/PHP/EnhancedCHM.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ public function footer($id) {
137137
if ($noteUser) {
138138
$noteUser = '<strong class="user">' . htmlspecialchars($noteUser) . '</strong>';
139139
}
140+
$noteTimestamp = $noteTimestamp === "" ? null : (int) $noteTimestamp;
140141
$noteDate = '<a href="#' . $noteId . '" class="date">' . date("d-M-Y h:i", $noteTimestamp) . '</a>';
141142
$anchor = '<a name="' . $noteId . '""></a>';
142143

0 commit comments

Comments
 (0)