-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Fix "Uninitialized string offset: 0 at Node.php" #11465
Conversation
Signed-off-by: Daniel Hansson daniel@hanssonit.se
Backport stable 14: #11466 |
Backport stable 13 #11467 |
@@ -284,7 +284,7 @@ public function getName() { | |||
* @return string | |||
*/ | |||
protected function normalizePath($path) { | |||
if ($path === '' or $path === '/') { | |||
if (!$path || $path === '' or $path === '/') { |
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.
This is hiding the symptoms and not fixing the cause. The function is called with null
even if only string
should be handed in into this method. Thus the root cause it to search somewhere else. Could you first try the patch from #10262 (comment) to find it.
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.
This solved my problem and my log isn't spammed anymore on 14.0.1. I'm no PHP developer so I don't have a clue what this does, just trying to help out here since a PR was requested with the fix in the original issue. 👼
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.
Sure it solved the symptoms, but still we should not hide them but actually look why it is happening. THat's the reason I asked you to apply the patch, because it logs actually useful information that I or any other developer could use then to properly analyze the problem. 😉
@MorrisJobke Gotcha! Will edit the original post. |
Feel free to close this and fix the cause of the issue. I want clean logs, but at the same time I totally get that we should fix the the cause. |
OK, so I should add this instead:
|
@enoch85 Correct 👍 |
It will for now do the same, but also log some stack trace. You could remove the line with the logger once you have some stack traces. |
Oh! I thought that was the fix. :D |
Signed-off-by: Daniel Hansson daniel@hanssonit.se
Add the suggested fix in #10262 which without this fix spams the log with
Uninitialized string offset: 0 at Node.php#290
cc @MorrisJobke