Bug #29246

HTMLparser_tags: fixAttrib.unset = 0 in fact unsets the value, too

Added by Egbert van der Hout about 8 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Should have
Category:
TypoScript
Target version:
Start date:
2011-08-25
Due date:
% Done:

100%

TYPO3 Version:
4.5
PHP Version:
Tags:
Complexity:
no-brainer
Is Regression:
Sprint Focus:

Description

According to http://typo3.org/documentation/document-library/references/doc_core_tsref/4.5.0/view/1/5/ the option "unset" for fixAttrib.[tag] is a boolean.

In the code of class.t3lib_parsehtml.php it is not. A strlen is used:

if (strlen($params['unset'])) {
unset($tagAttrib0[$attr]);
}

So if you give it any value (including 0) the tag will be removed. Either change the documentation or the code.


Related issues

Related to TYPO3 Core - Bug #29769: Parse error in t3lib/class.t3lib_parsehtml.php Closed 2011-09-14

Associated revisions

Revision 5df562ee (diff)
Added by Markus Klein about 8 years ago

[BUGFIX] HTMLparser, treat fixAttrib.unset as boolean

HTMLparser_tags fixAttrib.unset is documented to be boolean, but is
currently treated as string.
This patch corrects for the expected behavior.

Change-Id: I608debf23280dd7d3816fe1ee05421cc88efc752
Resolves: #29246
Releases: 4.6, 4.5, 4.4, 4.3
Reviewed-on: http://review.typo3.org/4605
Reviewed-by: Christopher
Tested-by: Christopher
Reviewed-by: Egbert van der Hout
Reviewed-by: Björn Pedersen
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert

Revision 94981037 (diff)
Added by Markus Klein about 8 years ago

[BUGFIX] HTMLparser, treat fixAttrib.unset as boolean

HTMLparser_tags fixAttrib.unset is documented to be boolean, but is
currently treated as string.
This patch corrects for the expected behavior.

Change-Id: Ie063cfd2f7aab0a09c712faefb31c3894f651d79
Resolves: #29246
Releases: 4.6, 4.5, 4.4, 4.3
Reviewed-on: http://review.typo3.org/4644
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert

Revision b670ca82 (diff)
Added by Markus Klein about 8 years ago

[BUGFIX] HTMLparser, treat fixAttrib.unset as boolean

HTMLparser_tags fixAttrib.unset is documented to be boolean, but is
currently treated as string.
This patch corrects for the expected behavior.

Change-Id: I716580d9a6fa9b5909f53e870afb4029a28598af
Resolves: #29246
Releases: 4.6, 4.5, 4.4, 4.3
Reviewed-on: http://review.typo3.org/4645
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert

Revision d27f4abf (diff)
Added by Markus Klein about 8 years ago

[BUGFIX] HTMLparser, treat fixAttrib.unset as boolean

HTMLparser_tags fixAttrib.unset is documented to be boolean, but is
currently treated as string.
This patch corrects for the expected behavior.

Change-Id: Ib7e9d179ae21f59fc650a4e5c95c08ec6ec38e19
Resolves: #29246
Releases: 4.6, 4.5, 4.4, 4.3
Reviewed-on: http://review.typo3.org/4647
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert

History

#1 Updated by Chris topher about 8 years ago

  • Subject changed from HTMLparser_tags - fixAttrib - unset is NOT a boolean to HTMLparser_tags: fixAttrib.unset = 0 in fact unsets the value, too

It does not make sense to unset the value when you write .unset = 0. This behaviour should be fixed.

So I suggest not to change the documentation, but to fix the code.

#2 Updated by Mr. Hudson about 8 years ago

Patch set 1 of change I608debf23280dd7d3816fe1ee05421cc88efc752 has been pushed to the review server.
It is available at http://review.typo3.org/4605

#3 Updated by Markus Klein about 8 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

#4 Updated by Markus Klein about 8 years ago

Hi Egbert,

the thing is fixed and will be included in the next releases.
Thanks for spotting this!

A forward from Jigal:
"Merged in 4.5 - 4.3

Thanks for the patch, good catch!"

Cheers
Markus

#5 Updated by Chris topher about 8 years ago

  • Category set to TypoScript
  • Assignee set to Jigal van Hemert
  • Target version set to 4.3.14

#6 Updated by Riccardo De Contardi almost 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF