@@ -164,8 +164,8 @@ public function __construct($options = array())
164
164
165
165
if (($ this ->amount <= 0 && $ this ->amountUSD <= 0 ) || ($ this ->amount > 0 && $ this ->amountUSD > 0 )) die ("You can use in cryptobox options one of variable only: amount or amountUSD. You cannot place values in that two variables together (submitted amount = ' " .$ this ->amount ."' and amountUSD = ' " .$ this ->amountUSD ."' ) " );
166
166
167
- if ($ this ->amount && (!is_numeric ($ this ->amount ) || $ this ->amount < 0.0001 || $ this ->amount > 50000000 )) die ("Invalid Amount - $ this ->amount $ this ->coinLabel . Allowed range: 0.0001 .. 50 ,000,000 " );
168
- if ($ this ->amountUSD && (!is_numeric ($ this ->amountUSD ) || $ this ->amountUSD < 0.01 || $ this ->amountUSD > 1000000 )) die ("Invalid amountUSD - $ this ->amountUSD USD. Allowed range: 0.01 .. 1,000,000 " );
167
+ if ($ this ->amount && (!is_numeric ($ this ->amount ) || $ this ->amount < 0.0001 || $ this ->amount > 500000000 )) die ("Invalid Amount - " . sprintf ( ' %.8f ' , $ this ->amount ). " $ this ->coinLabel . Allowed range: 0.0001 .. 500 ,000,000 " );
168
+ if ($ this ->amountUSD && (!is_numeric ($ this ->amountUSD ) || $ this ->amountUSD < 0.01 || $ this ->amountUSD > 1000000 )) die ("Invalid amountUSD - " . sprintf ( ' %.8f ' , $ this ->amountUSD ). " USD. Allowed range: 0.01 .. 1,000,000 " );
169
169
170
170
$ this ->period = trim (strtoupper (str_replace (" " , "" , $ this ->period )));
171
171
if (substr ($ this ->period , -1 ) == "S " ) $ this ->period = substr ($ this ->period , 0 , -1 );
@@ -1235,14 +1235,16 @@ function convert_currency_live($from_Currency, $to_Currency, $amount)
1235
1235
if ($ from_Currency == "TRL " ) $ from_Currency = "TRY " ; // fix for Turkish Lyra
1236
1236
if ($ from_Currency == "ZWD " ) $ from_Currency = "ZWL " ; // fix for Zimbabwe Dollar
1237
1237
if ($ from_Currency == "RIAL " ) $ from_Currency = "IRR " ; // fix for Iranian Rial
1238
+ if ($ from_Currency == "RM " ) $ from_Currency = "MYR " ; // fix for Malaysian Ringgit
1238
1239
1239
1240
$ url = "https://finance.google.com/finance/converter?a= " .$ amount ."&from= " .$ from_Currency ."&to= " .$ to_Currency ;
1240
1241
1241
1242
$ ch = curl_init ();
1242
1243
curl_setopt ($ ch , CURLOPT_URL , $ url );
1243
1244
curl_setopt ( $ ch , CURLOPT_SSL_VERIFYPEER , FALSE );
1244
1245
curl_setopt ($ ch , CURLOPT_RETURNTRANSFER , 1 );
1245
- curl_setopt ($ ch , CURLOPT_USERAGENT , "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko " );
1246
+ curl_setopt ($ ch , CURLOPT_IPRESOLVE , CURL_IPRESOLVE_V4 );
1247
+ curl_setopt ($ ch , CURLOPT_USERAGENT , "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko " );
1246
1248
curl_setopt ($ ch , CURLOPT_CONNECTTIMEOUT , 20 );
1247
1249
curl_setopt ($ ch , CURLOPT_TIMEOUT , 20 );
1248
1250
$ res = curl_exec ($ ch );
@@ -1518,14 +1520,14 @@ function run_sql($sql)
1518
1520
);
1519
1521
1520
1522
if (!defined ("CRYPTOBOX_LOCALISATION " )) define ("CRYPTOBOX_LOCALISATION " , json_encode ($ cryptobox_localisation ));
1521
- unset($ cryptobox_localisation );
1523
+ unset($ cryptobox_localisation );
1522
1524
1523
1525
if (!CRYPTOBOX_WORDPRESS || defined ("CRYPTOBOX_PRIVATE_KEYS " ))
1524
1526
{
1525
1527
$ cryptobox_private_keys = explode ("^ " , CRYPTOBOX_PRIVATE_KEYS );
1526
1528
foreach ($ cryptobox_private_keys as $ v )
1527
1529
if (strpos ($ v , " " ) !== false || strpos ($ v , "PRV " ) === false || strpos ($ v , "AA " ) === false || strpos ($ v , "77 " ) === false ) die ("Invalid Private Key - " . (CRYPTOBOX_WORDPRESS ? "please setup it on your plugin settings page " : "$ v in variable \$cryptobox_private_keys, file cryptobox.config.php. " ));
1528
1530
1529
- unset($ v ); unset($ cryptobox_private_keys );
1531
+ unset($ v ); unset($ cryptobox_private_keys );
1530
1532
}
1531
1533
?>
0 commit comments