Commit 528429b9 authored by Marc Bastian Heinrichs's avatar Marc Bastian Heinrichs Committed by Wouter Wolters
Browse files

[BUGFIX] softrefproc typolink lacks support for separation by line feed

Since #24121 the field content in "image_link" is separated by line
feeds instead of commas. Since then the soft reference processor
for "typolink[linkList]" is broken for this field. This results in broken
image links in imports and exports and possible unchecked links in
linkvalidator extension. In 4.7 this applies also for the field

This have not to be fixed for versions later than 4.7, because since 6.0
the fields "image_link" and "longdescURL" aren't used anymore.

Resolves: #57006
Releases: 4.7, 4.5
Change-Id: I3a070d4d6e24b60a0658ec5bb6cc77d26a3e2f2d

Reviewed-by: default avatarMarkus Klein <>
Tested-by: default avatarMarkus Klein <>
Reviewed-by: Wouter Wolters's avatarWouter Wolters <>
Tested-by: Wouter Wolters's avatarWouter Wolters <>
parent a62c19e5
......@@ -280,9 +280,17 @@ class t3lib_softrefproc {
// First, split the input string by a comma if the "linkList" parameter is set.
// An example: the link field for images in content elements of type "textpic" or "image". This field CAN be configured to define a link per image, separated by comma.
if (is_array($spParams) && in_array('linkList', $spParams)) {
$linkElement = explode(',', $content); // Preserving whitespace on purpose.
// Preserving whitespace on purpose.
if (strpos($content, LF) !== FALSE) {
$linkElement = explode(LF, $content);
$glue = LF;
} else {
$linkElement = explode(',', $content);
$glue = ',';
} else {
$linkElement = array($content); // If only one element, just set in this array to make it easy below.
$glue = '';
// Traverse the links now:
......@@ -295,7 +303,7 @@ class t3lib_softrefproc {
// Return output:
if (count($elements)) {
$resultArray = array(
'content' => implode(',', $linkElement),
'content' => implode($glue, $linkElement),
'elements' => $elements
......@@ -868,4 +876,4 @@ if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLA
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment