diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/CheckUser.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/CheckUser.pm index 2c7845fed..eeb8f9146 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/CheckUser.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/CheckUser.pm @@ -282,14 +282,14 @@ sub display { sub _urlFormat { my ( $self, $url ) = @_; - $url = 'http://' . $url unless ( $url =~ m#^https?://[^/]*.*# ); - my ( $proto, $vhost, $appuri ) = $url =~ m#^(https?://)([^/]*)(.*)#; + $url = 'http://' . $url unless ( $url =~ m#^https?://[^/]*.*#i ); + my ( $proto, $vhost, $appuri ) = $url =~ m#^(https?://)([^/]*)(.*)#i; my ($port) = $vhost =~ m#^.+(:\d+)$#; $port ||= ''; $vhost =~ s/:\d+$//; $vhost .= $self->conf->{domain} unless ( $vhost =~ /\./ ); - $appuri ||= '/'; - return "$proto$vhost$port$appuri"; + #$appuri ||= '/'; + return lc ("$proto$vhost$port") . "$appuri"; } sub _userDatas { diff --git a/lemonldap-ng-portal/t/67-CheckUser.t b/lemonldap-ng-portal/t/67-CheckUser.t index 6a8005b28..eb36a8107 100644 --- a/lemonldap-ng-portal/t/67-CheckUser.t +++ b/lemonldap-ng-portal/t/67-CheckUser.t @@ -123,7 +123,7 @@ count(1); # Request with good VH & user $query =~ - s/url=http%3A%2F%2Ftry.example.com/url=http%3A%2F%2Ftest1.example.com/; + s#url=http%3A%2F%2Ftry.example.com#url=hTTp%3A%2F%2FTest1.exAmple.cOm/UriTesT#; ok( $res = $client->_post( @@ -141,7 +141,7 @@ count(1); expectForm( $res, undef, '/checkuser', 'user', 'url' ); ok( $res->[2]->[0] =~ m%%, 'Found trspan="checkUser"' ) or explain( $res->[2]->[0], 'trspan="checkUser"' ); -ok( $res->[2]->[0] =~ m%value="http://test1.example.com/"%, 'Found well formatted url' ) +ok( $res->[2]->[0] =~ m%value="http://test1.example.com/UriTesT"%, 'Found well formatted url' ) or explain( $res->[2]->[0], 'Well formatted url' ); count(2); @@ -178,7 +178,7 @@ count(11); # Request with short VH url & user $query =~ - s/url=http%3A%2F%2Ftest1.example.com/url=http%3A%2F%2Ftest1:1234/; + s#url=http%3A%2F%2Ftest1.example.com%2FUriTesT#url=http%3A%2F%2Ftest1:1234#; ok( $res = $client->_post( @@ -196,7 +196,7 @@ count(1); expectForm( $res, undef, '/checkuser', 'user', 'url' ); ok( $res->[2]->[0] =~ m%%, 'Found trspan="checkUser"' ) or explain( $res->[2]->[0], 'trspan="checkUser"' ); -ok( $res->[2]->[0] =~ m%value="http://test1.example.com:1234/"%, 'Found well formatted url' ) +ok( $res->[2]->[0] =~ m%value="http://test1.example.com:1234"%, 'Found well formatted url' ) or explain( $res->[2]->[0], 'Well formatted url' ); count(2);