Repository navigation
Fix: webhook URL lost percent-encoded characters on form save - #1670
Conversation
QA suite — refused, no regression specThis PR changes product source but adds no spec, so the suite was Source files changed with no matching spec |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The only outstanding feedback is a non-blocking test-coverage nit.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Fixes form-save sanitization so webhook URLs retain percent-encoded characters.
Changes:
- Routes webhook URL settings through
esc_url_raw(). - Preserves existing HTML sanitization behavior.
| File | Summary |
|---|---|
includes/evf-core-functions.php |
Preserves encoded webhook URL characters; a PHPUnit regression test was suggested as a minor nit (2 votes). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| if ( preg_match( '/\<.*\>/', $data->value ) ) { | ||
| $value = wp_kses_post( $data->value ); | ||
| } elseif ( 'settings[external_url]' === $data->name ) { | ||
| } elseif ( 'settings[external_url]' === $data->name || preg_match( '/\[webhook_url\]$/', $data->name ) ) { |
|
Build for ⬇️ Download everest-forms.zip (11M) Installs directly via Plugins → Add New → Upload Plugin. A later push only rebuilds this if its commit message includes |

All Submissions:
Changes proposed in this Pull Request:
Closes themegrill/everest-forms-pro#1247.
Problem. Saving a form strips every percent-encoded octet (
%2F,%3D, …) from the Pro webhook Request URL. Signed URLs break as a result. A Microsoft Power Automate HTTP trigger URL withsp=%2Ftriggers%2Fmanual%2Frunis stored assp=triggersmanualrun, the signature no longer matches, and Power Automate answers every submission with401 AuthorizationFailed.Root cause.
evf_sanitize_builder()givesesc_url_raw()only tosettings[external_url]. Every other plain-text setting falls through tosanitize_text_field(). That includessettings[webhooks][<id>][webhook_url], and core's_sanitize_text_fields()removes all/%[a-f0-9]{2}/imatches.Fix. Webhook URL settings (any name ending in
[webhook_url], which covers the multi-webhook and legacy single-webhook names) now take the sameesc_url_raw()branch as the redirect URL. That is a one-line change inincludes/evf-core-functions.php.esc_url_raw()is the correct sanitizer for a URL stored in the database, and it keeps encoded octets.Notes
elseifchain, after the HTML check, so a value containing tags still goes throughwp_kses_post()first, exactly as before.everest-formssubmodule pointer bump to pick it up.Verified on a local site (WP + free 3.6.2 + Pro 1.9.21), in the real form builder with Playwright:
…?api-version=1&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=abc…&sp=triggersmanualrun&…https://webhook.site/plain-hook…?q="><script>alert(1)</script>The outgoing webhook request was also captured after the fix, and it carries the encoded URL byte for byte.
PHPCS: the changed line is clean against the repo's
phpcs.xml.dist. The file's total violation count is the same before and after (pre-existing, untouched).How to test the changes in this Pull Request:
Preconditions: Everest Forms Pro active, any form.
https://webhook.site/<your-id>?api-version=1&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=abcand Save.sp=%2Ftriggers%2Fmanual%2Frun. Ondevelopit showssp=triggersmanualrun.sp=%2Ftriggers%2Fmanual%2Frun.?a=%2Fx). Save and reload. It is unchanged, as before.Types of changes:
Other information:
Changelog entry