Project

General

Profile

Actions

Bug #48529

closed

typolink cannot create absolute links to local files even if forceAbsoluteUrl property is set

Added by Michael Klapper over 11 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2013-05-25
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

In "tslib_content::forceAbsoluteUrl" is a regular expression used to extract the url parts of the given $url. Unfortunately the pattern does not take care of file links since it detects the following (wrong) url parts.

Given URL "fileadmin/some/file.pdf"

array (size=4)
  'scheme' => string ''
  'delimiter' => string '://' 
  'host' => string 'fileadmin'
  'path' => string '/some/file.pdf'

The build in function "parse_url" did it like:

array (size=1)
  'path' => string 'fileadmin/some/file.pdf'

Some test code:

page = PAGE
page {
  dokType = 0
  1112220 = COA
  1112220 {
    5 = TEXT
    5.value = FORCED ABSOLUTE URL:
    10 = TEXT
    10 {
      typolink {
        parameter.data = page:uid
        forceAbsoluteUrl = 1
        forceAbsoluteUrl.scheme = https
        returnLast = url
      }
      wrap = [|],
    }
    20 < .10
    20.typolink.parameter >
    20.typolink.parameter = /
    30 < .20
# this file link is expected to be absolute prefixed!
    30.typolink.parameter = fileadmin/some/file.pdf
  }
  20 < .10
  20.5.value = REGULAR:
  20.10.typolink.forceAbsoluteUrl >
}


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #22655: typolink creates incomplete links in combination with the forceAbsoluteUrl propertyClosedOliver Hader2010-05-15

Actions
Related to TYPO3 Core - Bug #60545: typolink to file with forceAbsoluteUrl does not consider subfolder of instanceClosedMarkus Klein2014-07-24

Actions
Actions

Also available in: Atom PDF