Skip to content

Escape UPS rate XML fields#327

Open
haradahinata wants to merge 1 commit into
BAWES-Universe:mainfrom
haradahinata:codex/escape-ups-rate-xml-fields
Open

Escape UPS rate XML fields#327
haradahinata wants to merge 1 commit into
BAWES-Universe:mainfrom
haradahinata:codex/escape-ups-rate-xml-fields

Conversation

@haradahinata
Copy link
Copy Markdown

Summary

  • XML-escape UPS rate request credentials, shipper fields, ship-from fields, and destination address fields before concatenating them into XML
  • keep the UPS request structure, package handling, and debug behavior unchanged
  • add a focused static guard so raw UPS XML interpolation is not reintroduced

/claim #59

Why this satisfies the bounty

UPS rate calculation is part of keeping checkout shipping reliable. The current request builder inserts raw configured store values and customer destination values into XML tags. If a city, shipper name, postcode, or credential contains XML-sensitive characters such as &, <, >, quotes, or apostrophes, the request can become malformed and rate lookup can fail. Escaping those values keeps the existing integration behavior while making the generated XML valid.

Existing PRs checked

  • Harden UPS rate debug output #323 hardens UPS debug output, but it does not escape the values used to build the UPS rate request XML.
  • I searched open PRs for UPS XML/address escaping and did not find a duplicate.

Validation

  • C:\Users\Harada Hinata\.cache\codex-runtimes\codex-primary-runtime\dependencies\python\python.exe tests\check-ups-rate-xml-escaping.py
  • C:\Users\Harada Hinata\.cache\codex-runtimes\codex-primary-runtime\dependencies\python\python.exe -m py_compile tests\check-ups-rate-xml-escaping.py
  • git diff --cached --check

php -l common/models/shipping/Ups.php could not be run locally because PHP is not installed in this environment.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 17, 2026

Warning

Rate limit exceeded

@haradahinata has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 60 minutes before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c2772227-073c-4e96-891e-633271c9f258

📥 Commits

Reviewing files that changed from the base of the PR and between bc485b0 and 46e1c4a.

📒 Files selected for processing (2)
  • common/models/shipping/Ups.php
  • tests/check-ups-rate-xml-escaping.py
✨ 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 and usage tips.

@haradahinata
Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 17, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant