Skip to content

Commit 0866ff2

Browse files
authored
Update view.php (#180)
* Update view.php When `$type = 'ReJSON-RL'`, a warning is displayed: "Notice: Undefined variable: size in view.php on line 116." This is a small patch while reJson is added to library. * Update view.php * Update view.php Extended `if` code (didn't want to nest ternary operators). * Update view.php Default statement updated.
1 parent 140cfb8 commit 0866ff2

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

view.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@
9696
}
9797
$size = count($values);
9898
break;
99+
100+
default:
101+
$size = -1;
99102
}
100103

101104
if (isset($values) && ($count_elements_page !== false)) {
@@ -113,7 +116,19 @@
113116
<tr><td><div>Encoding:</div></td><td><div><?php echo format_html($encoding)?></div></td></tr>
114117
<?php } ?>
115118

116-
<tr><td><div>Size:</div></td><td><div><?php echo $size?> <?php echo ($type == 'string') ? 'characters' : 'items'?></div></td></tr>
119+
<tr><td><div>Size:</div></td><td><div>
120+
<?php
121+
echo $size;
122+
123+
if ($type === 'string') {
124+
echo " characters";
125+
} else if ($size < 0) {
126+
echo " (Type Unsupported)";
127+
} else {
128+
echo " items";
129+
}
130+
?>
131+
</div></td></tr>
117132

118133
</table>
119134

0 commit comments

Comments
 (0)