Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 149403

Summary: Invalid HTML error with embedded PHP
Product: z_Archived Reporter: Seva Lapsha <seva.lapsha>
Component: PDTAssignee: Shalom Gibly <shalom>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P1 CC: gadi, ganoro, jeremia, joe.roback, melitonas, piter75
Version: unspecifiedKeywords: plan
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Seva Lapsha CLA 2006-07-02 08:46:03 EDT
Paste this code to an empty PHP file:

<A href='<?=$a?>'></A>

You will see an HTML error "Start tag (<A>) not closed".

If you'll save, close and reopen this file it won't appear.
Comment 1 Piotr Szczepanik CLA 2006-07-06 18:00:30 EDT
I have written about smarty support in the newsgroup. It would really be enough for the beginning if you made html editor to ignore the contents of the curly braces in the following example: <a href="{$xxx}"></A> in the PHP files.

This is a little bit off topic but it's actually a similar thing so I decided to write about it here. :)
Comment 2 Guy Gurfinkel CLA 2006-12-21 07:01:09 EST
*** Bug 164169 has been marked as a duplicate of this bug. ***
Comment 3 Roy Ganor CLA 2007-01-02 10:26:59 EST
*** Bug 168987 has been marked as a duplicate of this bug. ***
Comment 4 Roy Ganor CLA 2007-01-22 07:49:25 EST
fixed.
from now on embedded PHP is aggregated into one TextRegionContainer then 
treated as tag attribute name or value.
Comment 5 Gadi Goldbarg CLA 2007-01-30 08:09:52 EST
fixed
Comment 6 jeremia CLA 2008-02-10 02:55:34 EST
I still get an wrong warning, if i write something like this

<input type="checkbox" name="<?=$name?>" <?=$checked?'checked="checked"':'' ?>></input>

This Part:
<?=$checked?'checked="checked"':'' ?>
is marked with the following warning:
"Undefined attribute name (<?=$checked?'checked="checked"':'' ?>)"

A file is also marked as warnign if i wrote something like this:

<?php if(empty($class)): ?>
<div>
<?php else: ?>
<div class="<?=$class?>">
<?php endif; ?>
	<form action="post">
		<textarea rows="20" cols="40"><?=$text?></textarea><br/>
		<input type="submit" value="speichern"></input>
	</form>
</div> 

There is actually no warnign marker, but the file is marked if it has a warning.
If i write this:

<div class="<?=$class?>">
	<form action="post">
		<textarea rows="20" cols="40"><?=$text?></textarea><br/>
		<input type="submit" value="speichern"></input>
	</form>
</div> 

the warning marker disappears.
Comment 7 Roy Ganor CLA 2008-02-10 03:59:10 EST
I reopen it, per Jeremia's request
Comment 8 Shalom Gibly CLA 2008-04-01 16:56:44 EDT
The first part of Jeremia's description is related to a bug that was resolved in WTP 3.0M5 (see duplicate bug #207194).

The second part of the bug (which is actually a different bug) occures when we have 2 <div> tags that are generated with a PHP if-else, but only one closing div tag. Thus, we get the warning: "No end tag (</div>)." (visible in the Problems view).
Comment 9 Roy Ganor CLA 2008-04-07 09:53:27 EDT
fixed in both WTP 2.0.2 and 3.0 Streams, so we will have it on both 1.0.3 and 1.1.

Comment 10 Gadi Goldbarg CLA 2008-04-16 11:23:55 EDT
fixed in 1.0.3
Comment 11 melitonas CLA 2008-10-07 08:27:03 EDT
I get a wrong warning too, if I write something like this

<input type="checkbox" name="<?=$name?>" <?=$checked?'checked="checked"':''
?>></input>

I have Zend Studio for Eclipse 6.1.0. How can I update WTP x.x.x or is it the latest in my zend studio version?..
Comment 12 Gadi Goldbarg CLA 2008-10-15 09:01:39 EDT
Currently seems that it is problematic again :(
Comment 13 Gadi Goldbarg CLA 2008-10-16 11:01:29 EDT
seems to have been fixed in nightly
Comment 14 Gadi Goldbarg CLA 2008-10-16 11:02:15 EDT
fixed