Skip to content

Fixed fatal error#628

Open
girishpanchal30 wants to merge 2 commits into
developmentfrom
bugfix/617
Open

Fixed fatal error#628
girishpanchal30 wants to merge 2 commits into
developmentfrom
bugfix/617

Conversation

@girishpanchal30

@girishpanchal30 girishpanchal30 commented May 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Used wp_unslash instead of stripslashes to remove the slashes.

Check before Pull Request is ready:

Closes #617

@pirate-bot

pirate-bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Tip

You can preview the changes in the Playground

Plugin build for 8333074 is ready 🛎️!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Replaces stripcslashes() calls in Engine::get_field_prices() with wp_unslash() so array-shaped posted PPOM field values (e.g. checkboxes/multi-selects) no longer trigger a TypeError on PHP 8, fixing the site-breaking fatal reported in #617. wp_unslash() recursively handles strings and arrays, matching the WordPress-standard unslashing pattern already used elsewhere in this codebase (e.g. CartHandler.php:409, ProductHandler.php:220).

Changes:

  • Use wp_unslash() for the per-field posted $value normalization in get_field_prices().
  • Use wp_unslash() for the bulkquantity field_meta['options'] JSON decode.
  • Use wp_unslash() for select/radio and checkbox option-value comparisons.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Labels

pr-checklist-complete The Pull Request checklist is complete. (automatic label) pr-checklist-skip Allow this Pull Request to skip checklist.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stripcslashes(): Argument #1 must be of type string, array given — Fatal error still present in v34.0.1 despite changelog claiming fix

4 participants