php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52040 Fatal error (undefined function) not reported when php within html tag's attr
Submitted: 2010-06-10 16:41 UTC Modified: 2010-06-11 11:03 UTC
From: michal_musial at o2 dot pl Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5.3.2 OS: Windows 7 Ultimate (any?)
Private report: No CVE-ID: None
 [2010-06-10 16:41 UTC] michal_musial at o2 dot pl
Description:
------------
PHP does not print Fatal error when an undefined function is called from within a 
html tag's attribute.
Error is saved to php error log if one is specified in php.ini, but there's 
nothing being printed. Execution ends at the line preceding the line containing 
the undefined function.

Test script:
---------------
<p>p1</p>
<p class="<?php echo bogus(); ?>">p2</p>
<p>p3</p>

Expected result:
----------------
<p>p1</p> 
<p class="<br />
<b>Fatal error</b>:  Call to undefined function bogus() in 
<b>E:\_webroot\localhost\test.php</b> on line <b>3</b><br /> 

Actual result:
--------------
<p>p1</p> 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-06-10 16:48 UTC] michal_musial at o2 dot pl
Also tested it on FreeBSD 7.2-RELEASE with PHP 5.2.11 and Apache 2.2.13.
Same problem.
 [2010-06-10 17:07 UTC] fa@php.net
-Status: Open +Status: Feedback
 [2010-06-10 17:07 UTC] fa@php.net
Can't reproduce with the VC9 build of 5.3.2 from windows.php.net in CLI mode.
Are you sure you have no special php.ini settings (like auto_prepend) or anything related to output buffering?

This really looks like a configuration issue at first glance.
 [2010-06-10 17:13 UTC] michal_musial at o2 dot pl
-Status: Feedback +Status: Open
 [2010-06-10 17:13 UTC] michal_musial at o2 dot pl
I'm no expert in php config, so it's entirely possible.
Have a look at my config:
http://mmusial.nazwa.pl/php.ini
 [2010-06-10 17:19 UTC] fa@php.net
-Status: Open +Status: Feedback
 [2010-06-10 17:19 UTC] fa@php.net
Please try http://windows.php.net/downloads/releases/php-5.3.2-nts-Win32-VC9-x86.zip with the php.ini-production and try to reproduce
 [2010-06-11 10:39 UTC] michal_musial at o2 dot pl
-Status: Feedback +Status: Open
 [2010-06-11 10:39 UTC] michal_musial at o2 dot pl
I can confirm that the problem does not exist when parsing the code in CLI mode on 
my current setup (PHP 5.3.2 VC6 - for apache). This points the problem to php5-
module for apache.
I am not able to check whether VC9 version is affected as from what 
windows.php.net says VC9 should not be used with apache binaries and I don't have 
IIS.
 [2010-06-11 11:03 UTC] michal_musial at o2 dot pl
-Status: Open +Status: Closed
 [2010-06-11 11:03 UTC] michal_musial at o2 dot pl
I've found the problem source.
Turned out it was the browser itself stripping out the invalid line altogether 
for some reason - Chrome 6.0-dev

Testing reavealed that:
- IE8 displays the error normally in the browser (which is wrong really as it 
should be only visible in the source)
- Firefox 3.6 shows the error in the source
- Opera 10.53 shows the error in the source

I'm closing the bug.
Thanks for your help fa.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 04:01:31 2024 UTC