Project

General

Profile

Actions

Bug #14977

closed

Function 'getBorderAttr' for removing 'border="0"' from img-tags doesn't work

Added by Franz Koch over 18 years ago. Updated over 17 years ago.

Status:
Closed
Priority:
Should have
Category:
Frontend
Target version:
-
Start date:
2005-09-18
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
3.8.0
PHP Version:
4
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

By validating my website I found out, that typo3 automatically renders the parameter 'border="0"' into img-tags. On my search to remove those, I found the function 'getBorderAttr' which should remove those attributes if a special doctype is set, or if the variable 'disableImgBorderAttr' is set. But the function has a logical error in the if-clause, so that the parameter only gets removed when both clauses are true insted of one of them.

BUG:
function: 'getBorderAttr'
file: 'class.tslib_content.php'
lines: 2511-2521

wrong (line 2518):
--------
if (t3lib_div::inList('xhtml_strict,xhtml_11,xhtml_2',$GLOBALS['TSFE']->config['config']['doctype']) || $GLOBALS['TSFE']->config['config']['disableImgBorderAttr']) {
--------

correct:
--------
if (t3lib_div::inList('xhtml_strict,xhtml_11,xhtml_2',$GLOBALS['TSFE']->config['config']['doctype']) && !$GLOBALS['TSFE']->config['config']['disableImgBorderAttr']) {
--------

Here the complete working function:
----------------------
/** * Returns the 'border' attribute for an <img> tag only if the doctype is not xhtml_strict,xhtml_11 or xhtml_2 or if the config parameter 'disableImgBorderAttr' is not set. * * @param string the border attribute * @return string the border attribute
*/
function getBorderAttr($borderAttr) {
if (t3lib_div::inList('xhtml_strict,xhtml_11,xhtml_2',$GLOBALS['TSFE']->config['config']['doctype']) && !$GLOBALS['TSFE']->config['config']['disableImgBorderAttr']) {
return $borderAttr;
}
}
(issue imported from #M1461)


Files

class.tslib_content.diff (2.17 KB) class.tslib_content.diff Administrator Admin, 2005-10-20 16:05

Related issues 1 (0 open1 closed)

Has duplicate TYPO3 Core - Bug #14914: config.disableImgBorderAttr should override anythingClosed2005-08-08

Actions
Actions

Also available in: Atom PDF