Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit c02b44f

Browse files
committed
Switch to looser restrictions if WP_DEBUG is enabled and stricter ones otherwise
1 parent c9b32bd commit c02b44f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

includes/class-linkbacks-mf2-handler.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,12 @@ public static function is_url( $string ) {
288288
if ( ! is_string( $string ) ) {
289289
return false;
290290
}
291-
return preg_match( '/^https?:\/\/.+\..+$/', $string );
291+
// If debugging is on just validate that URL is validly formatted
292+
if ( WP_DEBUG ) {
293+
return filter_var( $string, FILTER_VALIDATE_URL ) !== false;
294+
}
295+
// If debugging is off limit based on WordPress parameters
296+
return wp_http_validate_url( $string );
292297
}
293298

294299
// Accepted h types

0 commit comments

Comments
 (0)