Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to access array offset on value of type int #186

Closed
dwwe2017 opened this issue Mar 3, 2023 · 3 comments
Closed

Trying to access array offset on value of type int #186

dwwe2017 opened this issue Mar 3, 2023 · 3 comments
Assignees
Labels
bug Confirmed as a valid bug and requires fix.

Comments

@dwwe2017
Copy link

dwwe2017 commented Mar 3, 2023

I have a lot of lines in my error log with the following message

[error] (8) Trying to access array offset on value of type int: ../vendor/planetteamspeak/ts3-php-framework/libraries/TeamSpeak3/Node/Host.php 613

if($permission["permid"]["permcatid"] == $val)

@Sebbo94BY
Copy link
Collaborator

Sebbo94BY commented Mar 3, 2023

@dwwe2017 can you please provide some more information?

  • Which version of this library do you use?
  • How does your code look like, which causes this issue? (So that we can reproduce it.)
  • Which PHP version do you use?

@dwwe2017
Copy link
Author

dwwe2017 commented Mar 3, 2023

Hi, I'm using the latest version of the framework (1.1.35) and I'm using it as intended. The framework is currently operated with PHP 7.4.

I would suggest to include a check if the array keys exist.

Sebbo94BY pushed a commit to Sebbo94BY/ts3phpframework that referenced this issue Mar 6, 2023
Avoids the error `Trying to access array offset on value of type int`
by ensuring first, that the array has the required structure.
@Sebbo94BY Sebbo94BY self-assigned this Mar 9, 2023
@Sebbo94BY Sebbo94BY added the bug Confirmed as a valid bug and requires fix. label Apr 19, 2023
ronindesign pushed a commit that referenced this issue Aug 3, 2023
* Fetch permission list only once

This reduces the amount of executed `permissionlist` ServerQuery
commands, which also should improve the overall performance of
this function.

* Issue #186: Fix offset error

Avoids the error `Trying to access array offset on value of type int`
by ensuring first, that the array has the required structure.

---------

Co-authored-by: sebastian_kraetzig <sebastian.kraetzig@4g-server.eu>
@ronindesign
Copy link
Collaborator

This should now be resolved, please reopen if not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed as a valid bug and requires fix.
Projects
None yet
Development

No branches or pull requests

3 participants