mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 12:19:28 +00:00
PHP8 compatibility: replaced the curly brackets {} with square brackets [] where used in combination with strings
This commit is contained in:
@@ -178,7 +178,7 @@ class File_CSV
|
||||
return $field;
|
||||
}
|
||||
|
||||
if ($quote && $field{0} == $quote && $field{strlen($field)-1} == $quote) {
|
||||
if ($quote && $field[0] == $quote && $field[strlen($field) - 1] == $quote) {
|
||||
return substr($field, 1, -1);
|
||||
}
|
||||
return $field;
|
||||
@@ -230,7 +230,7 @@ class File_CSV
|
||||
} elseif ($c == "\n" || $c == "\r") {
|
||||
$sub = ($prev == "\r") ? 2 : 1;
|
||||
if ((strlen($buff) >= $sub) &&
|
||||
($buff{strlen($buff) - $sub} == $quote))
|
||||
($buff[strlen($buff) - $sub] == $quote))
|
||||
{
|
||||
$in_quote = false;
|
||||
}
|
||||
@@ -312,9 +312,9 @@ class File_CSV
|
||||
$last =& $fields[count($fields) - 1];
|
||||
// Fallback to read the line with readQuoted when guess
|
||||
// that the simple explode won't work right
|
||||
if (($last{strlen($last) - 1} == "\n"
|
||||
&& $last{0} == $conf['quote']
|
||||
&& $last{strlen(rtrim($last)) - 1} != $conf['quote'])
|
||||
if (($last[strlen($last) - 1] == "\n"
|
||||
&& $last[0] == $conf['quote']
|
||||
&& $last[strlen(rtrim($last)) - 1] != $conf['quote'])
|
||||
||
|
||||
(count($fields) != $conf['fields'])
|
||||
// XXX perhaps there is a separator inside a quoted field
|
||||
@@ -511,4 +511,4 @@ class File_CSV
|
||||
return true;
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -96,7 +96,7 @@ class File_Util
|
||||
{
|
||||
if (File_Util::isAbsolute($path)) {
|
||||
if (FILE_WIN32) {
|
||||
return substr($path, $path{3} == '\\' ? 4 : 3);
|
||||
return substr($path, $path[3] == '\\' ? 4 : 3);
|
||||
}
|
||||
return ltrim($path, '/');
|
||||
}
|
||||
@@ -182,7 +182,7 @@ class File_Util
|
||||
if (FILE_WIN32) {
|
||||
return preg_match('/^[a-zA-Z]:(\\\|\/)/', $path);
|
||||
}
|
||||
return ($path{0} == '/') || ($path{0} == '~');
|
||||
return ($path[0] == '/') || ($path[0] == '~');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -244,11 +244,11 @@ class File_Util
|
||||
} else {
|
||||
$cwd = getcwd();
|
||||
$drive = substr($cwd, 0, 2);
|
||||
if ($path{0} !== $separator{0}) {
|
||||
if ($path[0] !== $separator[0]) {
|
||||
$path = substr($cwd, 3) . $separator . $path;
|
||||
}
|
||||
}
|
||||
} elseif ($path{0} !== $separator) {
|
||||
} elseif ($path[0] !== $separator) {
|
||||
$path = getcwd() . $separator . $path;
|
||||
}
|
||||
|
||||
@@ -323,7 +323,7 @@ class File_Util
|
||||
|
||||
$entries = array();
|
||||
for ($dir = dir($path); false !== $entry = $dir->read(); ) {
|
||||
if ($list & FILE_LIST_DOTS || $entry{0} !== '.') {
|
||||
if ($list & FILE_LIST_DOTS || $entry[0] !== '.') {
|
||||
$isRef = ($entry === '.' || $entry === '..');
|
||||
$isDir = $isRef || is_dir($path .'/'. $entry);
|
||||
if ( ((!$isDir && $list & FILE_LIST_FILES) ||
|
||||
|
||||
@@ -240,7 +240,7 @@ class filter extends basis_db
|
||||
{
|
||||
//$value->value = preg_replace('/(.*?)selected=.selected./', '$1', $value->value);
|
||||
//$value->value = preg_replace('/(.*?)\s*[selected=?selected?]/', '$1', $value->value);
|
||||
//$value->value = preg_replace('/(.*?)\s*selected="selected"\s*/', '${1}', $value->value);
|
||||
//$value->value = preg_replace('/(.*?)\s*selected="selected"\s*/', '$[1]', $value->value);
|
||||
//$value->value = preg_replace('/^\s*selected=.*?selected.*?\s*/', ' ', $value->value);
|
||||
//$value->value = str_replace('selected=', '', $value->value);
|
||||
|
||||
|
||||
@@ -1532,7 +1532,7 @@ class WavFile
|
||||
} else {
|
||||
// replace
|
||||
for ($i = 0; $i < $sampleBytes; ++$i) {
|
||||
$this->_samples{$offset + $i} = $sampleBinary{$i};
|
||||
$this->_samples[$offset + $i] = $sampleBinary[$i];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1435,7 +1435,7 @@ class Securimage
|
||||
$length = strlen($code['display']);
|
||||
|
||||
for($i = 0; $i < $length; ++$i) {
|
||||
$letter = $code['display']{$i};
|
||||
$letter = $code['display'][$i];
|
||||
$letters[] = $letter;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user