Bug #15400
closedFalse return-value in class recordList, method linkUrlMail
0%
Description
This error causes the removing of all human-readable-formatting by the method getProcessedValue in class t3lib_BEfunc when rendering the record values in list-view.
In my opinion the method linkUrlMail should return the parameter $code not $testString, in case the $value is no url. The return of $testString removes all formatting of the value done before.
(issue imported from #M2244)
Updated by Michael Stucki almost 19 years ago
I agree that it needs to be changed, but I don't know if it's a good idea if the URL is just removed. Suggestion: "$code ($testString)"
What do you think?
Updated by old_heldenschreck almost 19 years ago
In my opinion the return of $code at the end of the function does not remove the Url, because there are two returns already if an Url is found. So the return of $code is only done if no link or mail is found.
I have c&p the changed method as example:
function linkUrlMail($code,$testString) {
// Check for URL:
$schema = parse_url($testString);
if ($schema['scheme'] && t3lib_div::inList('http,https,ftp',$schema['scheme'])) {
return '<a href="'.htmlspecialchars($testString).'" target="_blank">'.$code.'</a>';
}
// check for email:
if (t3lib_div::validEmail($testString)) {
return '<a href="mailto:'.htmlspecialchars($testString).'" target="_blank">'.$code.'</a>';
}
// Return if nothing else...
return $code;
// instead of return $testString;
}