Bug #66090 [Opn->Nab]: echo function in a script tag problem
| From: | derick@php.net | Date: | Wed, 13 Nov 2013 14:30:55 +0000 |
| Subject: | Bug #66090 [Opn->Nab]: echo function in a script tag problem | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-182738@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=66090&edit=1
ID: 66090
Updated by: derick@php.net
Reported by: leesec dot com at gmail dot com
Summary: echo function in a script tag problem
-Status: Open
+Status: Not a bug
Type: Bug
Package: *General Issues
Operating System: win 7
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
PHP is warning you about an undefined array element. This is exactly what should happen.
Previous Comments:
------------------------------------------------------------------------
[2013-11-13 14:18:00] leesec dot com at gmail dot com
Description:
------------
Test environment is as follows:
---------------------------------
PHP version:5.4.16
Apache version:2.4.4
Mysql version:5.6.12
---------------------------------
Test script:
---------------
Copy the following code:
-------------------------------------------------------------------------
<html>
<head>
<title>Hello World</title>
<meta http-equiv="Content-type" content="text/html;charset=utf-8" />
<script>
var a="<?php echo $_GET['name'] ?>";
</script>
</head>
<body>
</body>
</html>
-----------------------------------------------------------------
Save as test.php, then run http://localhost/test.php (no
parameters)
The browser's source code leak path found
Then view browser's source code with the following code:
<script>
var a="<br />
<font size='1'><table class='xdebug-error xe-notice'
dir='ltr' border='1' cellspacing='0' cellpadding='1'>
<tr><th align='left' bgcolor='#f57900'
colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size:
x-large;'>( ! )</span> Notice: Undefined index: name in E:\wamp\www\test.php on line
<i>7</i></th></tr>
<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call
Stack</th></tr>
<tr><th align='center' bgcolor='#eeeeec'>#</th><th
align='left' bgcolor='#eeeeec'>Time</th><th align='left'
bgcolor='#eeeeec'>Memory</th><th align='left'
bgcolor='#eeeeec'>Function</th><th align='left'
bgcolor='#eeeeec'>Location</th></tr>
<tr><td bgcolor='#eeeeec' align='center'>1</td><td
bgcolor='#eeeeec' align='center'>0.0000</td><td
bgcolor='#eeeeec' align='right'>139408</td><td
bgcolor='#eeeeec'>{main}( )</td><td title='E:\wamp\www\test.php'
bgcolor='#eeeeec'>..\test.php<b>:</b>0</td></tr>
</table></font>
";
</script>
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=66090&edit=1