[TYPO3-core] RFC #16027: Let typolink honour secure filelink configuration
Fernando Arconada
falcifer2001 at yahoo.es
Sun Oct 17 12:20:32 CEST 2010
Hi,
Is it possible to configure a folder so every file inside this folder
should be rendered as secure?
Kind Redards
Fernando Arconada
El Sat, 16 Oct 2010 22:53:09 -0400, Stanislas Rolland escribió:
> Hi,
>
> This is a SVN patch request.
>
> Branches: trunk
>
> Type: feature
>
> BT reference: http://bugs.typo3.org/view.php?id=16027
>
> Problem:
> filelink may be configured to be rendered as secure file download link.
> Not so with typolinks in general when they are links to internal files.
>
> Solution:
> The attached patch makes typolink honour the following configuration:
> typolink.jumpurl =1
> typolink.jumpurl.secure =1
> typolink.jumpurl.secure.mimeTypes = list of mimetypes, syntax [ext] =
> [mimetype]
>
> With such configuration, typolink will be rendered as secure download
> link whenever the link is to an internal file.
>
> How to test:
> For example, assuming CSS Styled Content is installed and assuming that
> DAM is either not installed or not integrated with RTE, the following
> settings in TS template will make any link to an internal file inserted
> in the RTE be rendered as a secure file download:
> lib.parseFunc_RTE.tags.link.typolink.jumpurl = 1
> lib.parseFunc_RTE.tags.link.typolink.jumpurl {
> secure = 1
> secure.mimeTypes = pdf=application/pdf, doc=application/msword,
> png=image/png, gif=image/gif, jpg=image/jpg }
>
> Note:
> This will require update to TSRef and follow-up patch to DAM to render
> similarly the media tag.
>
> Kind regards,
> Stanislas
> Index: typo3/sysext/cms/tslib/class.tslib_content.php
> =================================================================== ---
> typo3/sysext/cms/tslib/class.tslib_content.php (révision 9112) ++
+
> typo3/sysext/cms/tslib/class.tslib_content.php (copie de
travail)
@@
> -7662,10 +7662,12 @@
> if (file_exists(rawurldecode
($splitLinkParam[0])) || $isLocalFile)
> {
> if ($linktxt == '')
> $linktxt =
rawurldecode($link_param);
> - if ($GLOBALS['TSFE']-
>config['config']['jumpurl_enable']) { +
> if ($GLOBALS['TSFE']->config['config']['jumpurl_enable'] ||
> $conf['jumpurl']) { +
$theFileEnc = str_replace('%2F', '/',
> rawurlencode(rawurldecode($link_param)));
> $this-
>lastTypoLinkUrl = $GLOBALS['TSFE']->absRefPrefix .
> $GLOBALS
['TSFE']->config['mainScript'] . $initP . '&jumpurl=' .
>
rawurlencode($link_param) .
> + ($conf
['jumpurl.']['secure'] ? $this->locDataJU($theFileEnc,
> $conf['jumpurl.']['secure.']) : '') .
> $GLOBALS
['TSFE']->getMethodUrlIdToken;
> } else {
> $this-
>lastTypoLinkUrl = $GLOBALS['TSFE']->absRefPrefix .
> $link_param;
More information about the TYPO3-team-core
mailing list