Right now any text can be inserted into Preview URL input. Only a valid URL should be allowed. 
Activity
colinmurphy commentedon Jun 9, 2025
@ahuseyn I will look at this. I am currently writing tests for settings so I should be able to fix this. Currently we just sanitize the text field.
colinmurphy commentedon Jun 9, 2025
@ahuseyn We can add a new field called URL_Text_Field in the PR #241
colinmurphy commentedon Jun 10, 2025
@ahuseyn
Just a heads up with this issue when you try and escape the URL
https://example.com/?preview=true&name={slug}becomes
https://example.com/?preview=true&name=slugwhich is problematic for the parameter resolver.So we probably need to check that the URL has a valid HTTP protocol too rather than escaping the URL (sanitize_url WP function)
ahuseyn commentedon Jun 11, 2025
@colinmurphy thanks for the clarification 🙂.
Sanitization is important, but for this ticket we should check if URL is valid and reject if not as you said. This one looks good for the job.
On the frontend we need to add URL type to the input, so user can't accidentally put wrong URL in the first place 🙂.
colinmurphy commentedon Jun 11, 2025
Thanks @ahuseyn I will check that out :)
colinmurphy commentedon Jun 11, 2025
Sorry we can also update the URL input type too to ensure the input is a URL :)
colinmurphy commentedon Jun 13, 2025
@ahuseyn
This should be fixed now. It might be worth double checking :)
colinmurphy commentedon Jun 16, 2025
@ahuseyn Going to move into sprint 13 as we should make sure we add a e2e test for this.
colinmurphy commentedon Jun 24, 2025
Closing as tested with PHPUnit tests and also manually . I cannot find any issues.
ahuseyn commentedon Jun 24, 2025
I've added an e2e test for this validation: 06dc013
colinmurphy commentedon Jun 24, 2025
Thanks @ahuseyn ❤