Skip to content

Drop the empty else in the XOBJ_DTYPE_SOURCE branch - #1690

Open
darkdi wants to merge 1 commit into
XOOPS:master2.5.11from
darkdi:fix/write-cleanv-self-assign
Open

Drop the empty else in the XOBJ_DTYPE_SOURCE branch#1690
darkdi wants to merge 1 commit into
XOOPS:master2.5.11from
darkdi:fix/write-cleanv-self-assign

Conversation

@darkdi

@darkdi darkdi commented Sep 2, 2026

Copy link
Copy Markdown

In XoopsModelWrite::cleanVars the XOBJ_DTYPE_SOURCE branch ends its GPC handling with an else whose only statement is $cleanv = $cleanv;, so the branch does nothing at all.

The case right below it, which has the same stripSlashesGPC guard and no second transformation to apply, is already written without the else, so dropping it here lines the two up. The cases that do keep an else, like the censored-string ones above, have something real to do in it.

Summary by Sourcery

Enhancements:

  • Remove the redundant no-op else branch from XOBJ_DTYPE_SOURCE variable cleaning for consistency with adjacent handling.

Summary by CodeRabbit

  • Refactor
    • Removed redundant internal code with no change to observable behavior.

@sourcery-ai

sourcery-ai Bot commented Sep 2, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Simplifies XOBJ_DTYPE_SOURCE cleaning by removing an else branch that assigned the value to itself, with no behavioral change.

File-Level Changes

Change Details Files
Remove a redundant no-op else branch from XOBJ_DTYPE_SOURCE GPC handling.
  • Retain slash stripping only when the variable is GPC-managed.
  • Allow the existing value to pass through unchanged when not GPC-managed, without self-assignment.
  • Align the branch structure with the equivalent case below it.
htdocs/class/model/write.php

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 3a1141eb-73a3-4be9-bf16-d74ac02c27ce

📥 Commits

Reviewing files that changed from the base of the PR and between d435770 and b74969d.

📒 Files selected for processing (1)
  • htdocs/class/model/write.php
💤 Files with no reviewable changes (1)
  • htdocs/class/model/write.php

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change removes a no-op else branch from XoopsModelWrite::cleanVars for XOBJ_DTYPE_SOURCE. Runtime behavior remains unchanged.

Changes

Source variable cleanup

Layer / File(s) Summary
Remove redundant source branch
htdocs/class/model/write.php
The XOBJ_DTYPE_SOURCE cleanup path no longer self-assigns $cleanv when not_gpc is set.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to b7496

This localized cleanup removes redundant code without changing the intended variable-cleaning behavior, so no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: removing the redundant empty else branch from the XOBJ_DTYPE_SOURCE case.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@gitar-bot

gitar-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown

Important

You are using the Gitar free plan. Upgrade to unlock code review, CI analysis, auto-apply, custom automations, and more.

Gitar

@sonarqubecloud

sonarqubecloud Bot commented Sep 2, 2026

Copy link
Copy Markdown

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.

1 participant