Skip to content

Commit

Permalink
Item11189: Allow spaces before and after URL
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk@12815 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
OlivierRaginel authored and OlivierRaginel committed Oct 20, 2011
1 parent d35a32e commit 935f49e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion UnitTestContrib/test/unit/FormattingTests.pm
Expand Up @@ -1284,7 +1284,7 @@ sub test_externalLinkWithImageUrl {
EXPECTED

my $actual = <<ACTUAL;
[[$this->{test_topic}][http://foswiki.org/pub/System/ProjectLogos/foswiki-logo.gif]]
[[$this->{test_topic}][ http://foswiki.org/pub/System/ProjectLogos/foswiki-logo.gif ]]
ACTUAL
$this->do_test( $expected, $actual );
}
Expand Down
2 changes: 2 additions & 0 deletions core/lib/Foswiki/Render.pm
Expand Up @@ -893,6 +893,8 @@ sub _handleSquareBracketedLink {
sub _isImageLink {
my ( $this, $url ) = @_;

$url =~ s/^\s+//;
$url =~ s/\s+$//;
if ( $url =~ /^[^?]*\.(?:gif|jpg|jpeg|png)$/i ) {
my $filename = $url;
$filename =~ s@.*/@@;
Expand Down

0 comments on commit 935f49e

Please sign in to comment.