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

Fix undefined var when posting new top-level comment #247

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

neapsix
Copy link

@neapsix neapsix commented Jun 6, 2023

Hello! Here's a small patch for you to consider.

With 0.24, when I post a comment that's not a reply, if the recent_changes module is enabled, I see the following PHP warning and the automatic redirect to my posted comment doesn't work.

Warning: Undefined variable $comment_thread in /usr/local/www/wiki/index.php on line 3956

This PR fixes the issue. I've tested it on FreeBSD with Apache and PHP 8.0, 8.1, and 8.2.

Thank you for all your work on Pepperminty Wiki—what a fabulous bit of software!

I agree to release this contribution under the Mozilla Public License 2.0.

With the recent changes module, adding a recent change for a new comment
caused the warning "Undefined variable $comment_thread" if the comment
was not a reply. Use `isset()` instead of `!== NULL` to check for reply
depth, avoiding the warning when $comment_thread is not set.
@neapsix neapsix marked this pull request as ready for review June 6, 2023 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant