Closed paiva-thiago closed 5 years ago
What did the $data
and $splits
variable look like look like after line 242 $splits = $this->jsonSplit($data);
, was it a boolean? If so maybe this should be done:
if (is_array($splits)) {
foreach ($splits as $split) { ... }
}
This was the problem <
vs >
:
if ($fbrac < $fcurl || $fcurl === false) {
// If '[' is before '{' use [].
$fchar = '[';
$lchar = ']';
$start = $fbrac;
} elseif ($fcurl < $fbrac || $fbrac === false) { // Fixed.
} elseif ($fcurl > $fbrac || $fbrac === false) { // Old.
// If '{' is before '[' use {}.
$fchar = '{';
$lchar = '}';
$start = $fcurl;
} else {
return false;
}
@kingga
If I am not wrong, $fcurl > $fbrac
and $fbrac < $fcurl
will return the same result.
And the purpose of this comparison is for checking the first positions of the {
($fcurl
) and [
($fbrac
), and for verify who comes first.
That's the reason I changed for $fcurl < $fbrac
in the condition. It will check if the curl comes before the brackets.
And I agree about adding a validation if $splits
is an array.
Edit Now I see! I put the wrong code in the end of this issue! 😭 Let me edit there.
Hello everbody.
I'm facing a problem while executing an code with php-gui:
Executing this code, when I click the $button, the error below appears and the event does not execute
I was evaluating the values and I believe the problem might be in Receiver.php in line 176. Below is this class between lines 171 and 183:
The comparisons in the lines 171 and 176 are equals and will return the same result.
I changed line 176 to
} elseif ($fcurl > $fbrac || $fbrac === false) {
and it worked well.Edit
Obviously I didn't change to the code above and it worked. I changed to
$fcurl < $fbrac
!