Project

General

Profile

Actions

Bug #47097

closed

Img tag not closed at all

Added by JMTiepo3 over 11 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
-
Target version:
-
Start date:
2013-04-10
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.7
PHP Version:
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:

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>

&lt;div class=&quot;csc-textpic-text&quot;&gt;
&lt;p class=&quot;bodytext&quot;&gt;Left Content w/ Image&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;@

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!

Actions #1

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!

Actions #2

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

Actions #3

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.

Actions #4

Updated by ananth no-lastname-given over 11 years ago

the author/team members are requested to close or reject this bug

Actions #5

Updated by Wouter Wolters over 11 years ago

  • Status changed from Under Review to Resolved

Closed per request

Actions #6

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF