@@ 412-424 (lines=13) @@ | ||
409 | $elements = []; |
|
410 | $i = $j = 0; |
|
411 | $in_quotes = false; |
|
412 | while ($i < strlen($arr)) { |
|
413 | // If current char is a double quote and it's not escaped, then |
|
414 | // enter quoted bit |
|
415 | $char = substr($arr, $i, 1); |
|
416 | if ($char == '"' && ($i == 0 || substr($arr, $i - 1, 1) != '\\')) { |
|
417 | $in_quotes = !$in_quotes; |
|
418 | } elseif ($char == ',' && !$in_quotes) { |
|
419 | // Add text so far to the array |
|
420 | $elements[] = substr($arr, $j, $i - $j); |
|
421 | $j = $i + 1; |
|
422 | } |
|
423 | $i++; |
|
424 | } |
|
425 | // Add final text to the array |
|
426 | $elements[] = substr($arr, $j); |
|
427 |
@@ 2116-2128 (lines=13) @@ | ||
2113 | $aces = []; |
|
2114 | $i = $j = 0; |
|
2115 | $in_quotes = false; |
|
2116 | while ($i < strlen($acl)) { |
|
2117 | // If current char is a double quote and it's not escaped, then |
|
2118 | // enter quoted bit |
|
2119 | $char = substr($acl, $i, 1); |
|
2120 | if ($char == '"' && ($i == 0 || substr($acl, $i - 1, 1) != '\\')) { |
|
2121 | $in_quotes = !$in_quotes; |
|
2122 | } elseif ($char == ',' && !$in_quotes) { |
|
2123 | // Add text so far to the array |
|
2124 | $aces[] = substr($acl, $j, $i - $j); |
|
2125 | $j = $i + 1; |
|
2126 | } |
|
2127 | $i++; |
|
2128 | } |
|
2129 | // Add final text to the array |
|
2130 | $aces[] = substr($acl, $j); |
|
2131 |