monero-integrations / monerophp

Monero PHP library + JsonRPC Client
MIT License
116 stars 76 forks source link

Some base58.php fixes #110

Closed pandabadger closed 4 years ago

pandabadger commented 4 years ago

Syntax errors:

Line 75: if (!is_array($bin) { should be: if (!is_array($bin)) {

Line 97: if (!is_string($str) { should be: if (!is_string($str)) {

Type check error: Line 220, double is valid. if (!is_int($index)) { should be: if (!is_int($index) && !is_float($index)) {

When autoloading, an exception will try to load a class named 'MoneroIntegrations\MoneroPhp\Exception' resulting in a class not found error. After line 30: namespace MoneroIntegrations\MoneroPhp; re-add: use Exception;

pandabadger commented 4 years ago

@serhack my mistake, the following:

Line 220, double is valid. if (!is_int($index)) {

was intended to be line 295, ie. it should be changed in decode_block(). The change to encode_block() may well still apply (as was previously 'integer' || 'double' with gettype()) but I have not tested that one.

serhack commented 4 years ago

@pandabadger fixed.