Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion inc/class-tachyon.php
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ public function filter_srcset_array( $sources, $size_array, $image_src, $image_m
public static function validate_image_url( $url ) {
$parsed_url = @parse_url( $url );

if ( ! $parsed_url ) {
if ( ! isset( $parsed_url['path'] ) ) {
return false;
}

Expand Down
7 changes: 7 additions & 0 deletions tests/tests/class-tests-linking.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,13 @@ function data_content_filtering() {
'http://tachy.on/u/tachyon.jpg?resize=150%2C150',
],
],
// An image can link to a homepage with no URL path.
'pathless image link' => [
'tachyon',
'<p><a href="https://example.org"><img class="alignnone size-thumbnail wp-image-%%ID%%" src="%%BASE_URL%%/tachyon-150x150.jpg" alt="" width="150" height="150" /></a></p>',
'https://example.org',
'http://tachy.on/u/tachyon.jpg?resize=150%2C150',
],
// Block editor linked thumbnail.
[
'tachyon',
Expand Down
Loading