Skip to content

Commit 8d9c0ca

Browse files
committed
fix curly braces
1 parent 34c50b9 commit 8d9c0ca

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

lib/Tools.php

+13-13
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public static function my_strtok($string = NULL, $delimiter = NULL)
157157
if ($i == $match_pos) {
158158
if ($i != $curr_pos) {
159159
$result = trim(substr($str_original, $curr_pos, $i - $curr_pos));
160-
if (strncasecmp($result, 'delimiter', 9) == 0 && (strlen($result) == 9 || FALSE !== strpos(" \t", $result{9}))) {
160+
if (strncasecmp($result, 'delimiter', 9) == 0 && (strlen($result) == 9 || FALSE !== strpos(" \t", $result[9]))) {
161161
$delim = trim(strtolower(substr($result, 10)));
162162
if ("" == $delim) {
163163
$delim = ";";
@@ -177,23 +177,23 @@ public static function my_strtok($string = NULL, $delimiter = NULL)
177177
if (FALSE !== $result) {
178178
break;
179179
}
180-
} else if ($str{$i} == "'") {
180+
} else if ($str[$i] == "'") {
181181
for ($j = $i + 1; $j < $len; ++$j) {
182-
if ($str{$j} == "\\") ++$j;
183-
else if ($str{$j} == "'") break;
182+
if ($str[$j] == "\\") ++$j;
183+
else if ($str[$j] == "'") break;
184184
}
185185
$i = $j;
186-
} else if ($str{$i} == "\"") {
186+
} else if ($str[$i] == "\"") {
187187
for ($j = $i + 1; $j < $len; ++$j) {
188-
if ($str{$j} == "\\") ++$j;
189-
else if ($str{$j} == "\"") break;
188+
if ($str[$j] == "\\") ++$j;
189+
else if ($str[$j] == "\"") break;
190190
}
191191
$i = $j;
192-
} else if ($i < $len - 1 && $str{$i} == "/" && $str{$i + 1} == "*") {
192+
} else if ($i < $len - 1 && $str[$i] == "/" && $str[$i + 1] == "*") {
193193
$j = $i + 2;
194194
while ($j) {
195195
$j = strpos($str, "*/", $j);
196-
if (!$j || $str{$j - 1} != "\\") {
196+
if (!$j || $str[$j - 1] != "\\") {
197197
break;
198198
}
199199
++$j;
@@ -202,26 +202,26 @@ public static function my_strtok($string = NULL, $delimiter = NULL)
202202
break;
203203
}
204204
$i = $j + 1;
205-
} else if ($str{$i} == "#") {
205+
} else if ($str[$i] == "#") {
206206
$j = strpos($str, "\n", $i + 1) or strpos($str, "\r", $i + 1);
207207
if (!$j) {
208208
break;
209209
}
210210
$i = $j;
211-
} else if ($i < $len - 2 && $str{$i} == "-" && $str{$i + 1} == "-" && FALSE !== strpos(" \t", $str{$i + 2})) {
211+
} else if ($i < $len - 2 && $str[$i] == "-" && $str[$i + 1] == "-" && FALSE !== strpos(" \t", $str[$i + 2])) {
212212
$j = strpos($str, "\n", $i + 3) or strpos($str, "\r", $i + 1);
213213
if (!$j) {
214214
break;
215215
}
216216
$i = $j;
217-
} else if ($str{$i} == "\\") {
217+
} else if ($str[$i] == "\\") {
218218
++$i;
219219
}
220220
}
221221

222222
if (FALSE === $result && $curr_pos < $len) {
223223
$result = trim(substr($str_original, $curr_pos));
224-
if (strncasecmp($result, 'delimiter', 9) == 0 && (strlen($result) == 9 || FALSE !== strpos(" \t", $result{9}))) {
224+
if (strncasecmp($result, 'delimiter', 9) == 0 && (strlen($result) == 9 || FALSE !== strpos(" \t", $result[9]))) {
225225
$delim = trim(strtolower(substr($result, 10)));
226226
if ("" == $delim) {
227227
$delim = ";";

0 commit comments

Comments
 (0)