Skip to content

Commit

Permalink
Update view.php (#180)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
diplopito authored Apr 11, 2022
1 parent 140cfb8 commit 0866ff2
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion view.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@
}
$size = count($values);
break;

default:
$size = -1;
}

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

<tr><td><div>Size:</div></td><td><div><?php echo $size?> <?php echo ($type == 'string') ? 'characters' : 'items'?></div></td></tr>
<tr><td><div>Size:</div></td><td><div>
<?php
echo $size;

if ($type === 'string') {
echo " characters";
} else if ($size < 0) {
echo " (Type Unsupported)";
} else {
echo " items";
}
?>
</div></td></tr>

</table>

Expand Down

0 comments on commit 0866ff2

Please sign in to comment.