This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 202029

Summary: HTML Validation claims PHP tag inside HTML attribute value is invalid whitespace
Product: web Reporter: cautionbug
Component: HTML EditorAssignee: Marek Fukala <mfukala>
Status: RESOLVED DUPLICATE    
Severity: normal Keywords: UI, USABILITY
Priority: P3    
Version: 7.0.1   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description cautionbug 2011-09-12 16:45:11 UTC
Product Version = NetBeans IDE 7.0.1 (Build 201107282000)
Operating System = Windows 7 version 6.1 running on x86
Java; VM; Vendor = 1.6.0_27
Runtime = Java HotSpot(TM) Client VM 20.2-b06

Test case i've been able to reproduce consistently:
<form action="<?=$_SERVER['SCRIPT_NAME'];?>" method="post">

The HTML validator parses the PHP tag as whitespace and signals a warning. This happens pretty much anywhere that an HTML attribute should not have whitespace in the value.
Validator should probably be set to ignore the server-language tags, or at least not report the parsing result as a problem. If it's going to signal a possible validation warning, it should be more accurate, such as "This attribute cannot be empty or contain whitespace. Make sure your [PHP/JSP/etc.] outputs an actual value." - with the option to disable checking just THAT parsing rule.
Comment 1 Marek Fukala 2011-10-31 13:28:47 UTC
Html validation of PHP code is disabled by default. But it may be enabled if you imported 6.9 settings - see [Bug 202959] HTML error checking enabled for non-pure html mimetypes  after settings import

*** This bug has been marked as a duplicate of bug 202959 ***