aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey Armstrong <jeff@approximatrix.com>2020-05-07 14:49:34 -0400
committerJeffrey Armstrong <jeff@approximatrix.com>2020-05-07 14:49:34 -0400
commit4cd4c15f1bbe35e5544cd706f327b4a1b32bc493 (patch)
treebb9de8c2188117413448e2815b7adaa33d59844e
parenta817aaade595cc09f09545f3154cd069f7d12ae5 (diff)
downloadLR-87-4cd4c15f1bbe35e5544cd706f327b4a1b32bc493.tar.gz
LR-87-4cd4c15f1bbe35e5544cd706f327b4a1b32bc493.zip
Fixed some more URL handling issues.
-rw-r--r--protocol.f9014
-rw-r--r--render.f9011
2 files changed, 20 insertions, 5 deletions
diff --git a/protocol.f90 b/protocol.f90
index 3348663..8f0cd70 100644
--- a/protocol.f90
+++ b/protocol.f90
@@ -265,8 +265,11 @@ contains
end if
end if
- if(present(once) .and. once) then
- exit
+ ! All on the same line crashes GNU Fortran...
+ if(present(once)) then
+ if(once) then
+ exit
+ end if
end if
i = index(string, pattern)
@@ -301,7 +304,12 @@ contains
exit
end if
- call replace_text(url, url(pattern_start:i+2), once=.true.)
+ ! Check for root...
+ if(url(pattern_start-1:pattern_start) == "//") then
+ call replace_text(url, "/../", replacement="/", once=.true.)
+ else
+ call replace_text(url, url(pattern_start:i+2), once=.true.)
+ end if
i = index(url, '/../')
end do
diff --git a/render.f90 b/render.f90
index da3406a..860e06a 100644
--- a/render.f90
+++ b/render.f90
@@ -175,10 +175,17 @@ contains
character(*), intent(in)::mimetype
logical::type_supported
integer::i
-
+
+ integer::istop
+
+ istop = index(mimetype, ";") - 1
+ if(istop < 1) then
+ istop = len_trim(mimetype)
+ end if
+
type_supported = .false.
do i = 1, size(base_supported_types)
- if(trim(mimetype) == trim(base_supported_types(i))) then
+ if(mimetype(1:istop) == trim(base_supported_types(i))) then
type_supported = .true.
exit
end if