Skip to content

Commit

Permalink
php 8.1 fix
Browse files Browse the repository at this point in the history
php fatal error array and string offset access syntax
  • Loading branch information
chris18890 committed Oct 17, 2022
1 parent b737762 commit fc8d10a
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Seltzer CRM 0.7.21 - An open source CRM for hackerspaces
Seltzer CRM 0.7.24 - An open source CRM for hackerspaces
Copyright 2009-2022 Edward L. Platt <[email protected]>
Distributed under GPLv3 (see COPYING for more info)

Expand Down
2 changes: 1 addition & 1 deletion crm/include/crm.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
$crm_version = array(
'major' => 0
, 'minor' => 7
, 'patch' => 21
, 'patch' => 24
, 'revision' => 'dev'
);
require_once($crm_root . '/config.inc.php');
Expand Down
6 changes: 3 additions & 3 deletions crm/include/sys/csv.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ function csv_parse ($content, $row_terminate = "\n", $field_terminate = ",", $fi
$index = 0;
$length = strlen($content);
while ($index < $length) {
$char = $content{$index};
$char = $content[$index];
if ($char == $field_escape) {
// Escaped character
$index++;
$field .= $content{$index};
$field .= $content[$index];
} else if ($char == $field_quote) {
if ($is_quoted) {
// We've reached the end of a quoted field
Expand All @@ -77,7 +77,7 @@ function csv_parse ($content, $row_terminate = "\n", $field_terminate = ",", $fi
$index++;
break;
}
$char = $content{$index + 1};
$char = $content[$index + 1];
if ($char == $field_terminate) {
break;
}
Expand Down
2 changes: 1 addition & 1 deletion crm/include/sys/page.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function theme_page ($page_name, $options = array()) {
// Loop through each tab
foreach ($data as $tab => $tab_data) {
// Skip special keys
if ($tab{0} === '#') {
if ($tab[0] === '#') {
continue;
}
// Generate tab name
Expand Down
4 changes: 2 additions & 2 deletions crm/modules/member/command.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function command_member_add () {
$n = 0;
while (empty($username) && $n < 100) {
// Construct test username
$test_username = strtolower($_POST['firstName']{0} . $_POST['lastName']);
$test_username = strtolower($_POST['firstName'][0] . $_POST['lastName']);
if ($n > 0) {
$test_username .= $n;
}
Expand Down Expand Up @@ -404,7 +404,7 @@ function command_member_import () {
$n = 0;
while (empty($username) && $n < 100) {
// Construct test username
$test_username = strtolower($row['firstname']{0} . $row['lastname']);
$test_username = strtolower($row['firstname'][0] . $row['lastname']);
if ($n > 0) {
$test_username .= $n;
}
Expand Down
2 changes: 1 addition & 1 deletion crm/modules/payment/payment.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ function payment_parse_currency ($value, $code = null) {
if (strlen($parts[1]) < 2) {
error_register("Warning: parsing of cents failed: '$parts[1]'");
}
$count += intval($parts[1]{0})*10 + intval($parts[1]{1});
$count += intval($parts[1][0[)*10 + intval($parts[1][1]);
}
break;
case 'GBP':
Expand Down
2 changes: 1 addition & 1 deletion crm/modules/register/register.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function command_register_member () {
$n = 0;
while (empty($username) && $n < 100) {
// Construct test username
$test_username = strtolower($_POST['firstName']{0} . $_POST['lastName']);
$test_username = strtolower($_POST['firstName'][0] . $_POST['lastName']);
if ($n > 0) {
$test_username .= $n;
}
Expand Down
2 changes: 1 addition & 1 deletion crm/modules/user/user.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ function user_salt () {
$salt_length = 16;
$salt = '';
for ($i = 0; $i < 16; $i++) {
$salt .= $chars{rand(0, $char_count - 1)};
$salt .= $chars[rand(0, $char_count - 1)];
}
return $salt;
}
Expand Down
3 changes: 2 additions & 1 deletion crm/modules/user_meta/user_meta.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ function user_meta_data ($opts = array()) {
";
}
if (!empty($opts['cid'])) {
$esc_cid = mysqli_real_escape_string($db_connect, $opts['cid']);
$cid = $opts['cid'][0];
$esc_cid = mysqli_real_escape_string($db_connect, $cid);
$sql .= "
AND `cid`='$esc_cid'
";
Expand Down

0 comments on commit fc8d10a

Please sign in to comment.