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

Bug 357868

Summary: Validation runs out of context in mixed PHP/HTML files
Product: z_Archived Reporter: Ryan P <dkived>
Component: PDTAssignee: PHP UI <php.ui-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: silviya
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
return from outside a function (twice), start of element is obsolete
none
end of element is obsolete, full screen of yellow squigglies
none
result from 'Steps to reproduce'
none
patch none

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