-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Avoid substr() error when strpos returns false #21844
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
Avoid substr() error when strpos returns false #21844
Conversation
"Exception: substr() expects parameter 3 to be int, bool given" can occur on Line 378 $mimePart = substr($icon, 0, strpos($icon, '-')); This happens, when '-' is not found and strpos returns false instead of an int. When this occurs, e.g., Activity hangs. Signed-off-by: lui87kw <[email protected]>
Signed-off-by: lui87kw <[email protected]>
MorrisJobke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code makes sense 👍
|
/backport to stable19 |
|
/backport to stable18 |
|
/backport to stable17 |
|
Thanks for your first pull request and welcome to the community! Feel free to keep them coming! If you are looking for issues to tackle then have a look at this selection: https://github.com/nextcloud/server/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22 |
|
Shouldn't this be already shipped with 19.0.5? I'm facing this exact error at #24365 🤔 |
|
/backport to stable19 |
|
/backport to stable18 |
seems so. let me try to trigger it again |
"Exception: substr() expects parameter 3 to be int, bool given" can occur on Line 378 $mimePart = substr($icon, 0, strpos($icon, '-'));
This happens, when '-' is not found and strpos returns false instead of an int.
When this occurs, e.g., Activity hangs.
Signed-off-by: Lukas Iffländer [email protected]