Bug #47097
closedImg tag not closed at all
0%
Description
Hello, I have found a bug in Typo3.
I have made an extension that get's contents of some user-defined parts using this:$partContent = $this->cObj->cObjGetSingle($partType, $conf['parts.'][$partName.'.'], $partName);
Now, when I have made a content element of type "Text and Images" and insert an image,
this image will not get a closing tag. For example I made an example element with one line of text and 1 image.
The output is as follows:
@<div id="c8" class="csc-default">
<div class="csc-textpic csc-textpic-left csc-textpic-above">
<div class="csc-textpic-imagewrap">
<figure class="csc-textpic-image csc-textpic-last">
<img src="uploads/pics/logo_small.png" width="75" height="14" alt=""*>*
</figure>
</div>
<div class="csc-textpic-text">
<p class="bodytext">Left Content w/ Image</p>
</div>
</div>
</div>@
Note that the img tag does not have a closing tag. This is unprocessed content, directly received from the call to cObjGetSingle.
Yes, in HTML5 this may be allowed (I think) but I also tried switching back to HTML4 (by setting doctype in typo3 to a HTML4 one) and the same issue occurs there, img tag not closed.
You may think, big deal, but because I use DOM to parse my html it simply won't show the element since it's not correctly formatted (missing end-tag).
Could you please fix this bug? I have only tested Typo3 4.7, with only content element type "Text and Images". It could occur with other element types as well.
Greetings!
Updated by Puja Singh over 11 years ago
JMTiepo3 wrote:
Hello, I have found a bug in Typo3.
I have made an extension that get's contents of some user-defined parts using this:
$partContent = $this->cObj->cObjGetSingle($partType, $conf['parts.'][$partName.'.'], $partName);
Now, when I have made a content element of type "Text and Images" and insert an image,
this image will not get a closing tag. For example I made an example element with one line of text and 1 image.
The output is as follows:@<div id="c8" class="csc-default">
<div class="csc-textpic csc-textpic-left csc-textpic-above">
<div class="csc-textpic-imagewrap">
<figure class="csc-textpic-image csc-textpic-last">
<img src="uploads/pics/logo_small.png" width="75" height="14" alt=""*>*
</figure>
</div><div class="csc-textpic-text">
<p class="bodytext">Left Content w/ Image</p>
</div>
</div>
</div>@Note that the img tag does not have a closing tag. This is unprocessed content, directly received from the call to cObjGetSingle.
Yes, in HTML5 this may be allowed (I think) but I also tried switching back to HTML4 (by setting doctype in typo3 to a HTML4 one) and the same issue occurs there, img tag not closed.
You may think, big deal, but because I use DOM to parse my html it simply won't show the element since it's not correctly formatted (missing end-tag).
Could you please fix this bug? I have only tested Typo3 4.7, with only content element type "Text and Images". It could occur with other element types as well.
Greetings!
Updated by Gerrit Code Review over 11 years ago
- Status changed from New to Under Review
Patch set 1 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/20204
Updated by Markus Klein over 11 years ago
Just to give a short summary:
- XHTML and HTML5 rendering has to be:
<img ... />
- HTML4 rending can stay:
<img ...>
Using a closing image tag (</img>
) is rather uncommon.
Updated by ananth no-lastname-given over 11 years ago
the author/team members are requested to close or reject this bug
Updated by Wouter Wolters over 11 years ago
- Status changed from Under Review to Resolved
Closed per request