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 almost 11 years ago. Updated over 5 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 #1

Updated by Gerrit Code Review almost 11 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/21036

Actions #2

Updated by Gerrit Code Review almost 11 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/21036

Actions #3

Updated by Gerrit Code Review almost 11 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/21036

Actions #4

Updated by Gerrit Code Review almost 11 years ago

Patch set 4 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/21036

Actions #5

Updated by Markus Klein almost 10 years ago

  • Is Regression set to No

I can confirm the issue, but there is a very easy workaround: prefix the relative path with a slash.

But I agree this is simply not consistent, since if you don't use forceAbsoluteUrl you must not specify this slash.

Actions #6

Updated by Markus Klein almost 10 years ago

Example for clarifying the problem even more.

Assumed URL of the site: http://devserver/

page.20 = TEXT
page.20.value = demolink
page.20.typolink.parameter = fileadmin/dummy.jpg

Gives href="fileadmin/dummy.jpg"

page.20 = TEXT
page.20.value = demolink
page.20.typolink.parameter = fileadmin/dummy.jpg
page.20.typolink.forceAbsoluteUrl = 1

Gives href="fileadmin/dummy.jpg"

page.20 = TEXT
page.20.value = demolink
page.20.typolink.parameter = /fileadmin/dummy.jpg
page.20.typolink.forceAbsoluteUrl = 1

Gives href="http://devserver/fileadmin/dummy.jpg"

Actions #7

Updated by Gerrit Code Review almost 10 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/21036

Actions #8

Updated by Gerrit Code Review almost 10 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/21036

Actions #9

Updated by Gerrit Code Review almost 10 years ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/21036

Actions #10

Updated by Gerrit Code Review almost 10 years ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/21036

Actions #11

Updated by Gerrit Code Review almost 10 years ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/21036

Actions #12

Updated by Gerrit Code Review almost 10 years ago

Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/21036

Actions #13

Updated by Gerrit Code Review over 9 years ago

Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/21036

Actions #14

Updated by Gerrit Code Review over 9 years ago

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/34411

Actions #15

Updated by Gerrit Code Review over 9 years ago

Patch set 2 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/34411

Actions #16

Updated by Markus Klein over 9 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #17

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF