feat: sanitize CLOUDINARY_URL= prefix and add inline format hint in w…#1158
Open
Udilh wants to merge 1 commit intocloudinary:masterfrom
Open
feat: sanitize CLOUDINARY_URL= prefix and add inline format hint in w…#1158Udilh wants to merge 1 commit intocloudinary:masterfrom
Udilh wants to merge 1 commit intocloudinary:masterfrom
Conversation
…izard - Add Connect::sanitize_connection_url() — strips the CLOUDINARY_URL= prefix (case-insensitive) and trims surrounding whitespace, covering the common copy-paste pattern from the Cloudinary dashboard. - Wire the new method into verify_connection(), rest_test_connection(), upgrade_connection(), and maybe_connection_string_constant(), replacing the previous case-sensitive str_replace() calls. - Wizard PHP: add #connection-format-hint <p> beneath the error indicator so users see the expected URL format inline without leaving the page. - Wizard JS: expose formatHint in the connection object; show the hint in showError(), hide it in showSuccess() and on each new keystroke; upgrade the prefix-strip regex from literal string to /^CLOUDINARY_URL=/i with a .trim() so leading/trailing whitespace is also handled client-side. - Add PHPUnit 9 test suite (tests/php/test-class-connect.php) covering sanitize_connection_url() (8 cases) and CLOUDINARY_VARIABLE_REGEX (6 cases), plus 3 sanitize-then-validate integration tests. Bootstrap stubs the minimal WP functions so tests run without a WP installation. - Add phpunit/phpunit ^9.6 to composer require-dev and create phpunit.xml.dist. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…izard
beneath the error indicator so users see the expected URL format inline without leaving the page.
Fixes #123
Approach
QA notes