From:             dereks at x-no-archive dot co dot uk
Operating system: Win XP Pro SP2
PHP version:      5.2.0
PHP Bug Type:     Unknown/Other Function
Bug description:  > sign escapes from PHP

Description:
------------
This might be something I've got wrong, but in PHP5 it appears that if you
use the shorthand <? to start a php script, if you have a > sign anywhere
before the closing ?>, PHP escapes and starts processing the rest of the
script as HTML as if ?>; has been entered.

This didn't happen in 4.x, and feels like a bug rather than a feature.

This is with PHP Windows NT 5.1.6 build 2600, dated Aug 23 2006 16:31:18. 
I would have upgraded in order to retest, but am unable to due to client's
requirements.

Reproduce code:
---------------
<?

/*
 *  test break out of php with greater than sign
 *
 */
function somefunction($x) {
  if ($x > 100) {
    do_something();
  }
}
?>



Expected result:
----------------
Running this script on it's own should produce no output.

Actual result:
--------------
Actual output is:

100) { do_something(); } } ?>



-- 
Edit bug report at http://bugs.php.net/?id=39526&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=39526&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=39526&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=39526&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=39526&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=39526&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=39526&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=39526&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=39526&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=39526&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=39526&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=39526&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=39526&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=39526&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=39526&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=39526&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=39526&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=39526&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=39526&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=39526&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=39526&r=mysqlcfg

Reply via email to