Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 357868 - Validation runs out of context in mixed PHP/HTML files
Summary: Validation runs out of context in mixed PHP/HTML files
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: PHP UI CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-15 15:34 EDT by Ryan P CLA
Modified: 2020-05-14 11:39 EDT (History)
1 user (show)

See Also:


Attachments
return from outside a function (twice), start of element is obsolete (179.29 KB, image/png)
2011-09-15 15:35 EDT, Ryan P CLA
no flags Details
end of element is obsolete, full screen of yellow squigglies (163.59 KB, image/png)
2011-09-15 15:35 EDT, Ryan P CLA
no flags Details
result from 'Steps to reproduce' (11.15 KB, image/png)
2011-09-15 15:36 EDT, Ryan P CLA
no flags Details
patch (864 bytes, patch)
2011-11-22 03:24 EST, Zhongwei Zhao CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan P CLA 2011-09-15 15:34:07 EDT
Build Identifier: I20110613-1736

In mixed PHP/HTML files, the validator will find errors that aren't errors and highlights the wrong parts of the file. For example, in an HTML section, <a onclick="return false;"> will generate an error on "return false;" that you cannot return outside a function or method. This would be a valid error if it were inside a PHP block. Another example: I have a <center> tag that generates an Element is obsolete error, but the <center> tag itself does not get marked for the error. Instead, the <center> tag is on line 31 at character 35 in this particular file, but the yellow squiggly starts on line 38 at character 14, which is in a PHP block. The squiggly continues, without a break, until line 195 character 129, which is inside a PHP block on a commented line.

Reproducible: Always

Steps to Reproduce:
1. Create a new PHP file
2. Create an empty PHP block <?php ?>
3. Create a link with onclick return false <a onclick="return false;"></a>
4. "return false;" will generate an error
5. Delete the PHP block - the error will disappear
6. Add a PHP block below the link
7. "return false;" will generate an error again - this time the mark starts at the 'l' in false and continues through the '?' in <?php
Comment 1 Ryan P CLA 2011-09-15 15:35:22 EDT
Created attachment 203442 [details]
return from outside a function (twice), start of element is obsolete
Comment 2 Ryan P CLA 2011-09-15 15:35:55 EDT
Created attachment 203443 [details]
end of element is obsolete, full screen of yellow squigglies
Comment 3 Ryan P CLA 2011-09-15 15:36:30 EDT
Created attachment 203444 [details]
result from 'Steps to reproduce'
Comment 4 Zhongwei Zhao CLA 2011-11-22 03:24:17 EST
Created attachment 207347 [details]
patch
Comment 5 Zhongwei Zhao CLA 2013-01-29 22:37:47 EST
Can not be reproduced now.
Comment 6 Sylvia Tancheva CLA 2015-02-17 02:58:33 EST
It's been 2y since it cannot be reproduced. Closing the bug