Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve URL validation #890

Open
ernilambar opened this issue Mar 11, 2025 · 0 comments · May be fixed by #900
Open

Improve URL validation #890

ernilambar opened this issue Mar 11, 2025 · 0 comments · May be fixed by #900
Labels
[Team] Plugin Review Issues owned by Plugin Review Team [Type] Bug An existing feature is broken

Comments

@ernilambar
Copy link
Member

We have pretty basic URL validation currently:

function is_valid_url( $url ) {
	return filter_var( $url, FILTER_VALIDATE_URL ) === $url && str_starts_with( $url, 'http' );
}

We frequently get this type of URL with duplicated protocol but our function does not detect that.

https://http://example.com/

We could improve the is_valid_url() function to handle such edge case.

@ernilambar ernilambar added [Type] Bug An existing feature is broken [Team] Plugin Review Issues owned by Plugin Review Team labels Mar 11, 2025
@nikunj8866 nikunj8866 linked a pull request Mar 28, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Team] Plugin Review Issues owned by Plugin Review Team [Type] Bug An existing feature is broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant