We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9f771d0 commit 14745ceCopy full SHA for 14745ce
1 file changed
includes/Checker/Checks/Plugin_Repo/Plugin_Header_Fields_Check.php
@@ -485,7 +485,17 @@ public function run( Check_Result $result ) {
485
* @return bool true if the URL is valid, otherwise false.
486
*/
487
private function is_valid_url( $url ) {
488
- return filter_var( $url, FILTER_VALIDATE_URL ) === $url && str_starts_with( $url, 'http' );
+ if ( filter_var( $url, FILTER_VALIDATE_URL ) !== $url || ! str_starts_with( $url, 'http' ) ) {
489
+ return false;
490
+ }
491
+
492
+ // Detect duplicated protocol (e.g., "https://http://example.com/").
493
+ $parsed_url = wp_parse_url( $url );
494
+ if ( isset( $parsed_url['scheme'] ) && str_contains( substr( $url, strlen( $parsed_url['scheme'] ) + 3 ), '://' ) ) {
495
496
497
498
+ return true;
499
}
500
501
/**
0 commit comments