Stop using {} for arrays (#11319)

This avoids this message in ./validate.php - line numbers differ because I'm on 1.61

PHP Deprecated:  Array and string offset access syntax with curly braces is deprecated in /usr/local/www/librenms/includes/functions.php on line 1833
PHP Deprecated:  Array and string offset access syntax with curly braces is deprecated in /usr/local/www/librenms/includes/functions.php on line 2336
This commit is contained in:
Dan Langille 2020-03-21 15:49:15 -04:00 committed by GitHub
parent 5a48b6f2a7
commit 5c163a4a2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1742,7 +1742,7 @@ function hytera_h2f($number, $nd)
if (strlen(str_replace(" ", "", $number)) == 4) {
$hex = '';
for ($i = 0; $i < strlen($number); $i++) {
$byte = strtoupper(dechex(ord($number{$i})));
$byte = strtoupper(dechex(ord($number[$i])));
$byte = str_repeat('0', 2 - strlen($byte)).$byte;
$hex.=$byte." ";
}
@ -2210,7 +2210,7 @@ function cache_peeringdb()
$get = Requests::get($peeringdb_url . '/net?depth=2&asn=' . $asn, array(), array('proxy' => get_proxy()));
$json_data = $get->body;
$data = json_decode($json_data);
$ixs = $data->{'data'}{0}->{'netixlan_set'};
$ixs = $data->{'data'}[0]->{'netixlan_set'};
foreach ($ixs as $ix) {
$ixid = $ix->{'ix_id'};
$tmp_ix = dbFetchRow("SELECT * FROM `pdb_ix` WHERE `ix_id` = ? AND asn = ?", array($ixid, $asn));